Your First 10 Minutes
This is the story of going from nothing to a working town that produces resources on its own. It takes about 5–10 minutes and seven requests. Every step links to the full reference if you want the details.
By the end you will have: an account, a realm token, a town placed on the map, a production building under construction, and a resource counter that climbs without you touching it.
Before you start
The base URL in these examples is http://localhost:8731 — the origin the dockerized development backend listens on. Against a deployed instance, swap it for that instance’s origin (written https://YOUR-RESTFALL-HOST throughout these docs); nothing else about a request changes. See API base URL for the full story.
Every request after step 1 sends a bearer token:
Authorization: Bearer your-token-hereThere are two kinds of token and it matters which one you use:
- A user token authorizes account stuff — your profile, your players, and realm login.
- A realm token authorizes everything in the game — towns, buildings, combat, trading.
You will collect the user token first, then trade it for a realm token. See Realms & Realm Tokens for the full story.
Step 1 — Register an account
Send an email and password to create your account. No bearer token needed
yet. The turnstile_token is the human check
the web client’s forms carry: the development backend accepts Cloudflare’s
test token, XXXX.DUMMY.TOKEN.XXXX, as below.
A deployed instance accepts only its own widget’s token, so there you create the account and verify it in the web client, and a script gets its token through OAuth instead (Scripting needs Premium). That token is already a realm token for a player in the realm you pick: go straight to step 6.
import httpx
httpx.post( "http://localhost:8731/api/v1/users/", json={ "email": "you@example.com", "password": "a-strong-password", "turnstile_token": "XXXX.DUMMY.TOKEN.XXXX", },)curl -X POST http://localhost:8731/api/v1/users/ \ -H "Content-Type: application/json" \ -d '{"email": "you@example.com", "password": "a-strong-password", "turnstile_token": "XXXX.DUMMY.TOKEN.XXXX"}'await fetch("http://localhost:8731/api/v1/users/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email: "you@example.com", password: "a-strong-password", turnstile_token: "XXXX.DUMMY.TOKEN.XXXX", }),});Full details: Register an Account.
Step 2 — Verify your email, and get a user token
Registering emails you a link, valid for 24 hours. Open it in the browser
and enter your password, or send its token (the part after #token=) with
your password yourself, as below. Either way your email is verified and you
are signed in: the answer is your user token. (Until you verify, a log in is
refused with 403 Forbidden.)
resp = httpx.post( "http://localhost:8731/api/v1/users/verify-email/", json={ "token": "the-token-from-the-link", "password": "a-strong-password", "turnstile_token": "XXXX.DUMMY.TOKEN.XXXX", },)user_token = resp.json()["auth_token"]curl -X POST http://localhost:8731/api/v1/users/verify-email/ \ -H "Content-Type: application/json" \ -d '{"token": "the-token-from-the-link", "password": "a-strong-password", "turnstile_token": "XXXX.DUMMY.TOKEN.XXXX"}'const resp = await fetch("http://localhost:8731/api/v1/users/verify-email/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ token: "the-token-from-the-link", password: "a-strong-password", turnstile_token: "XXXX.DUMMY.TOKEN.XXXX", }),});const userToken = (await resp.json()).auth_token;The token is a plain hex string. Hold on to it. Next time, sign in with
POST /api/v1/token/login/ (your email, your password and a human-check
token). From step 4 on every request sends a token, so the account needs its
premium or creator entitlement by then (see the note above). Full details:
Verify Your Email and Log In.
On a development backend with no mail server, the link is not sent: the
worker writes it to its log instead (docker compose logs worker).
Step 3 — Pick a realm
A realm is a self-contained game world. List the joinable ones and grab the active_season id of whichever realm you like — you need it in the next step.
realms = httpx.get("http://localhost:8731/api/v1/realms/").json()season_id = realms["results"][0]["active_season"]["id"]curl http://localhost:8731/api/v1/realms/const realms = await (await fetch("http://localhost:8731/api/v1/realms/")).json();const seasonId = realms.results[0].active_season.id;Step 4 — Create a player in that realm
A player is your character in one realm’s season. You get an auto-generated, game-only username.
httpx.post( "http://localhost:8731/api/v1/players/", headers={"Authorization": f"Bearer {user_token}"}, json={"season": season_id},)curl -X POST http://localhost:8731/api/v1/players/ \ -H "Authorization: Bearer $USER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"season": "season-uuid"}'await fetch("http://localhost:8731/api/v1/players/", { method: "POST", headers: { Authorization: `Bearer ${userToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ season: seasonId }),});Full details: Create a Player.
Step 5 — Trade up for a realm token
Now exchange your user token for a realm token scoped to this realm. Everything from here on uses this token.
resp = httpx.post( "http://localhost:8731/api/v1/realms/login/", headers={"Authorization": f"Bearer {user_token}"}, json={"realm": realms[0]["name"]},)realm_token = resp.json()["api_key"]curl -X POST http://localhost:8731/api/v1/realms/login/ \ -H "Authorization: Bearer $USER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"realm": "realm-name"}'const r = await fetch("http://localhost:8731/api/v1/realms/login/", { method: "POST", headers: { Authorization: `Bearer ${userToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ realm: realms[0].name }),});const realmToken = (await r.json()).api_key;Step 6 — Found your town
One player, one town. Town names must be unique within the season. New towns start with the realm’s configured starter resources.
resp = httpx.post( "http://localhost:8731/api/v1/towns/", headers={"Authorization": f"Bearer {realm_token}"}, json={"name": "Riverbend"},)town_id = resp.json()["id"]curl -X POST http://localhost:8731/api/v1/towns/ \ -H "Authorization: Bearer $REALM_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Riverbend"}'const t = await fetch("http://localhost:8731/api/v1/towns/", { method: "POST", headers: { Authorization: `Bearer ${realmToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ name: "Riverbend" }),});const townId = (await t.json()).id;Full details: Found a Town.
Step 7 — Put it on the map
A town does nothing until it occupies a tile. Towns must stay a minimum distance apart (set per realm). The whole map is visible to you — before and after you settle, without exception — so you can pick an empty tile and a tile type whose resource bonus suits your plan.
httpx.post( f"http://localhost:8731/api/v1/towns/{town_id}/place/", headers={"Authorization": f"Bearer {realm_token}"}, json={"x": 10, "y": 15},)curl -X POST http://localhost:8731/api/v1/towns/$TOWN_ID/place/ \ -H "Authorization: Bearer $REALM_TOKEN" \ -H "Content-Type: application/json" \ -d '{"x": 10, "y": 15}'await fetch(`http://localhost:8731/api/v1/towns/${townId}/place/`, { method: "POST", headers: { Authorization: `Bearer ${realmToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ x: 10, y: 15 }),});Placing a town does not change what you can see — the map is fully public throughout the season, before and after you settle.
Full details: Place a Town.
Step 8 — Build a production building
Production buildings are how resources grow on their own. Building ids (yaml_id) are exact-match against the realm config — for example "Farm" or "Lumber Mill", not lowercase slugs. Browse GET /api/v1/buildings/types for everything the realm offers, and GET /api/v1/towns/{town_id}/buildings for what this town already has.
You construct a building by posting to POST /api/v1/buildings/ with the town’s id in the body — the town is not part of the path.
A new building starts at level 0 and is under construction — it produces nothing until its first construction finishes. (If the building type has no configured construction time, it starts at level 1 immediately.)
httpx.post( "http://localhost:8731/api/v1/buildings/", headers={"Authorization": f"Bearer {realm_token}"}, json={"yaml_id": "Farm", "town": town_id},)curl -X POST http://localhost:8731/api/v1/buildings/ \ -H "Authorization: Bearer $REALM_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"yaml_id\": \"Farm\", \"town\": \"$TOWN_ID\"}"await fetch("http://localhost:8731/api/v1/buildings/", { method: "POST", headers: { Authorization: `Bearer ${realmToken}`, "Content-Type": "application/json" }, body: JSON.stringify({ yaml_id: "Farm", town: townId }),});The cost is deducted right away. Construction completes on its own — the background resolver finishes it, and any read after the finish time reflects the new level.
Step 9 — Watch resources accrue
You never have to “collect.” Production accrues continuously and is calculated on the fly. The fastest way to watch everything at once is the game state snapshot:
state = httpx.get( "http://localhost:8731/api/v1/state/", headers={"Authorization": f"Bearer {realm_token}"},).json()
for town in state["towns"]: print(town["name"], town["resources"], "rate/s:", town["production"])curl http://localhost:8731/api/v1/state/ \ -H "Authorization: Bearer $REALM_TOKEN"const state = await (await fetch("http://localhost:8731/api/v1/state/", { headers: { Authorization: `Bearer ${realmToken}` },})).json();console.log(state.towns[0].resources, state.towns[0].production);Once your Farm finishes building, production shows a non-zero per-second rate and resources climbs every time you look. Resources are capped per type by each resource’s storage cap — overflow above the cap is discarded, so keep building storage as you grow.
Where to go next
- Grow the economy — upgrade buildings (Develop a Town), research permanent bonuses (Research).
- Defend and expand — train units (Units), scout neighbours (Scouting), and attack (Combat & Raiding). Read the Combat mechanics reference first so you can predict outcomes.
- Climb the ladder — understand Prestige & Scoring to know what actually moves your rank.
- Automate it — if you are an agent, jump to the Agent Playbook.