Authentication
The base path is /api/v1 on the deployed game origin. The browser uses an HttpOnly session. Native clients send Authorization: Bearer <player token> and keep the token in protected device storage. Browser writes accept same-origin JSON. Never embed a platform service credential or an AI key in a mobile build.
Play a guest game
POST /api/v1/auth/guest
{"client":"native"}
POST /api/v1/games
Authorization: Bearer <player token>
Content-Type: application/json
{"mode":"solo","requestId":"<unique request ID>"}Send the returned game ID with the zero-based round. Repeating the same answer for that player, game, and round returns current state. A conflicting replacement gets HTTP 409. Private game views return HTTP 404 to outsiders.
Synchronization
Poll active live games about every 1.5 seconds. Async games can poll less often. Use the server deadline for countdowns. Only the game view’s history contains answers and points that have unlocked. Poll after a reconnect or submission to recover authoritative state.
Endpoints
OpenAPI 3.1 specification (JSON)
| Method | Path | Behavior |
|---|---|---|
| GET | /me | Read the current player, account availability, and browser moderator status. |
| POST | /auth/guest | Create a guest. For native clients, send {"client":"native"} to receive a bearer token. |
| POST | /auth/register | Create a free profile from a verified Netlify Identity sign-in. Send name and city. Browser session required. |
| POST | /auth/token | Issue a 30-day mobile token for the signed-in account. Use the verified browser session. |
| POST | /auth/revoke | Revoke all native tokens for the signed-in player. |
| POST | /auth/logout | Invalidate the current session. Browser sign-out also uses the hosted sign-out route. |
| GET / POST | /profile | Read personal stats and games, or update a registered display name and city. |
| POST | /games | Send mode and a unique requestId. Modes are live, friend, async, solo, and daily. A friend challenge accepts pace live or async. |
| POST | /games/join | Join a private invitation using its code. |
| GET | /games/{id} | Poll the participant-only game view. Use serverNow and deadline for the local clock. |
| POST | /games/{id}/answers | Submit {round, answer}. Round is zero-based. An empty string passes. The first submission locks the round. |
| POST | /games/{id}/next | Advance a revealed solo or daily round with {round}. |
| POST | /games/{id}/cancel | Cancel a still-unmatched challenge as its creator. |
| POST | /games/{id}/rematch | Offer or accept a rematch with {requestId}. Solo and daily replay as fresh practice. |
| POST | /games/{id}/disputes | Request review of a revealed answer with {round, reason}. |
| GET | /daily | Read the current Boise day and optional sponsor. |
| GET | /leaderboard | Filter with period=week|month|all and type=players|cities. |
| GET / POST | /submissions | Read your proposals or submit a sourced question. |
| GET / POST | /admin | Read moderation queues or apply question, suggestion, decision or sponsor actions. Authorized moderator browser session required. |
Launch configuration
AI equivalence checks require a server-side AI key. Without it, canonical answers and common spellings are scored and uncertain responses enter the human review queue. Live play uses authenticated polling. Public access, domain verification, and native app sign-in handoff are deployment and mobile integration steps.