Entitlements
Entitlements are account-level: they attach to your login, not to a player or a realm, so a grant applies everywhere you play at once.
There are two, and they are granted by arrangement with an administrator. Nothing in the game sells them. There is no shop, no checkout, no in-game currency that buys one, and no route that accepts payment. Spins, resources, medals and titles are earned by playing and cannot be bought either — see the fortune wheel.
The tiers
| Premium | Creator | |
|---|---|---|
| Extra concurrent building upgrades per town | +2 | — |
| Extra pending training orders per building | +5 | — |
| API and MCP access | yes | yes |
| Maximum simultaneous tokens | 25 | 25 |
Premium is for players: deeper queues, a higher token cap, and access to the API and MCP surface.
Creator is for people building things on top of Restfall — a client, a bot, a research project. It grants API and MCP access and a raised token cap and nothing else: no queue depth, no combat advantage, nothing that would let a tool author outplay someone who is not one. It is granted per project and can be revoked.
Holding both stacks the queue bonuses; the token cap is the larger of the two, not the sum. At the cap, signing in revokes your oldest token rather than failing, an agent’s OAuth token last (see Log In); if a grant lapses while you hold more tokens than the free cap, your next sign-in revokes the oldest ones, in the same order, until you are back under it.
What “API access” gates
Scripting. A free account plays through the web client; API access is what lets a script, a bot or an agent play. Three places check it:
- Every request to the MCP endpoint (
/mcp), whatever token it carries — including a realm token you pasted into a client’sRESTFALL_TOKEN. - OAuth token exchange (
POST /oauth/token). Without an active API-access entitlement the exchange fails withaccess_denied. This exchange is how a script or a bot gets a token of its own, because password sign-in carries the web client’s human check: Scripting needs Premium. - An account or realm token used outside the web client. On a free
account those tokens work only in the web client; anywhere else every
endpoint refuses them with
403and the Scripting needs Premium message (Log In).
Playing in the web client never checks for an entitlement, and on the REST API neither does a token from the OAuth flow (the exchange already did).
Revoking the entitlement that grants API access — when it leaves the account with no active api-access entitlement left — deletes every token that was issued to that account through OAuth. Access stops immediately rather than when those tokens would have expired. Tokens with no OAuth client attached — the ones you actually play with — are never touched by a revoke.
Queue depth
A premium account’s building-upgrade queue is its town’s normal depth plus two, and its per-building training queue is five orders deeper. The limits are enforced server-side; a request over the limit still returns 400 with the same message it always did, just at a higher threshold. See developing a town and units.
Tokens
A free account may hold 5 simultaneous tokens. Premium and Creator raise that to 25. Expired tokens are cleaned up automatically before the limit is checked, so a long-lived account does not silently fill up.
For administrators
These endpoints require an administrator account: your email must be in the
deployment’s ADMIN_EMAILS setting. That list is read once at process start,
so adding or removing an administrator needs an app restart to take effect.
They also require the administrator’s account token from password login
(POST /api/v1/token/login/): a realm token or an OAuth token gets 403,
an administrator’s included. The routes are excluded from the MCP tool
surface, and an agent’s token could not pass them anyway. Like every account
token, an administrator’s works outside the web client only on an account
with premium or creator, so the raw requests below need one; the operator
script scripts/grant_entitlement.py (see OAuth clients)
works with a free administrator account.
Two rules decide who is an administrator:
- Only two domains. Every
ADMIN_EMAILSentry must be an address atsnek.plorrestfall.com, exactly: no subdomains, ASCII only, any letter case. An entry anywhere else is a configuration error, and the app refuses to start with an error naming that entry (any non-ASCII character in it is shown as its code point, so a look-alike stands out). - The exact address. An account is an administrator only if its stored
email is exactly one of the entries, both in the
one normalized form every account email is stored in.
Letter case does not matter. A look-alike that is a different letter never
matches: with
boss.fixer@restfall.comon the list,boſs.fixer@…(long s),boß.fixer@…orboss.fixer@…(anfiligature) is a separate account and never an administrator, even though some Unicode comparisons treat them as equal.
The normalized form does fold a few characters that Unicode treats as the
same letter, before anything is stored. The Kelvin sign (U+212A) before the
@ is a plain K. In the domain, fullwidth letters such as r and
compatibility forms such as the Roman numeral ⅼ (U+217C) become the plain
letters, as the internationalized-domain rules require. Those spellings
are the plain address: the same account, and the same administrator.
Registration verifies email addresses: an account
cannot sign in, so it cannot act as an administrator, until its owner opens
the link mailed to the address with the password chosen at registration.
That includes the folded spellings above: registering admin@restfall.com
creates the account admin@restfall.com, and its link goes to that address.
Still register the administrator account, and verify it, before you add its
address to ADMIN_EMAILS, and remove an entry as soon as nobody needs it.
A grant or revoke is cached per-worker for a short time (currently 60 seconds), so a change can take up to that long to take effect on a request served by a different worker than the one that made the change.
POST /api/v1/admin/entitlements/grant
import httpx
httpx.post( "http://localhost:8731/api/v1/admin/entitlements/grant", json={"email": "player@example.com", "slug": "premium"}, headers={"Authorization": "Bearer your-admin-token"},)curl -X POST http://localhost:8731/api/v1/admin/entitlements/grant \ -H "Authorization: Bearer your-admin-token" \ -H "Content-Type: application/json" \ -d '{"email": "player@example.com", "slug": "premium"}'await fetch("http://localhost:8731/api/v1/admin/entitlements/grant", { method: "POST", headers: { Authorization: "Bearer your-admin-token", "Content-Type": "application/json", }, body: JSON.stringify({ email: "player@example.com", slug: "premium" }),});{ "email": "player@example.com", "slugs": ["premium"]}slugs is the account’s full active list after the call. Granting something
the account already holds is a success that changes nothing.
POST /api/v1/admin/entitlements/revoke
Same request body, same response shape. Revoking something the account does not hold is a success.
GET /api/v1/admin/entitlements/{email}
A paginated list of the account’s active entitlements, each with slug,
granted_at and granted_by.
OAuth clients
Client registration is open, but a newly registered client is not
approved and cannot complete /oauth/authorize until an administrator
approves it:
POST /api/v1/admin/oauth-clients/{client_id}/approvePOST /api/v1/admin/oauth-clients/{client_id}/revoke-approval
Withdrawing approval also deletes every token that client holds, for every account that used it.
The operator script scripts/grant_entitlement.py wraps all five of these
routes (grant, revoke, list, approve-client, revoke-client) as
idempotent CLI subcommands, so day-to-day operation rarely needs a raw HTTP
call.
Every change is on the record
Each grant and revoke writes a game-transaction ledger entry against the account, recording the active entitlement list before and after the change and which administrator made it. Repeat calls that change nothing write nothing.