Skip to content

Place a Town

After founding a town, you must place it on the season map. Each town occupies a single tile, and towns must maintain a minimum distance from each other (configured per realm).

Endpoint

POST /api/v1/towns/{town_id}/place/

Request Body

FieldTypeDescription
xintX coordinate, from 0 up to 2,147,483,647.
yintY coordinate, from 0 up to 2,147,483,647.
import httpx
town_id = "your-town-uuid"
response = httpx.post(
f"http://localhost:8731/api/v1/towns/{town_id}/place/",
headers={"Authorization": "Bearer your-token-here"},
json={"x": 10, "y": 15},
)
print(response.json())

Response

{
"x": 10,
"y": 15,
"town": {
"id": "uuid",
"name": "My Town"
},
"tile_type": "forest"
}

The tile_type tells you what kind of terrain your town sits on. On the shipped realms it is scenery only: a town’s own ground grants no production bonus — production bonuses come from the valleys a town holds, and the terrain decides which valley types are found nearby. A realm may still attach a per-resource multiplier to a tile type (GET /api/v1/resources/ lists them under tile_bonuses); where it does, that multiplier composes with the held valleys.

Validation Rules

  • The tile must exist on the season map (404 if out of bounds).
  • The tile must not already be occupied by another town (400).
  • The town must not already be placed elsewhere (400).
  • The town must be at least min_town_distance tiles away from all other placed towns (400). This distance is configured per realm.
  • The season must be active (403 if the season has ended).
  • Coordinates must be integers from 0 to 2,147,483,647, the largest coordinate a map can store (422 outside that). One that is in that range but off your realm’s map is the 404 above.

Placement is permanent — a placed town cannot be moved.