Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Antonelli-Tech-Solutions/spades/llms.txt

Use this file to discover all available pages before exploring further.

The lobby exposes two list endpoints and one player-table lookup. GET /api/tables returns all waiting public tables with no filtering. GET /api/lobby/tables targets the in-app lobby browser and supports optional query filters for seat availability and name search. Both list endpoints return the same response shape — an array of enriched table objects under the tables key. GET /api/player/table is a lightweight lookup that tells the caller which table (if any) they are currently seated at or observing. All three endpoints require a valid session. Pass x-session-id and x-player-id in every request header.

GET /api/tables

Returns all public tables whose status is waiting (game not yet started). No query parameters are accepted — use GET /api/lobby/tables for filtered browsing. Required headers
HeaderDescription
x-session-idSession token from login
x-player-idAuthenticated player’s UUID
Responses
200
object
Success. Returns the full table list.
401
object
Missing or invalid session. Body: { "error": "..." }.

GET /api/lobby/tables

The public lobby browser. Only returns tables with visibility: "public". Supports optional query parameters to filter the result set; filters compose — both can be used at the same time. Required headers
HeaderDescription
x-session-idSession token from login
x-player-idAuthenticated player’s UUID
Query parameters
hasSeats
boolean string
When set to "true", only tables with at least one open seat are returned. Omit or pass any other value to include full tables.
Case-insensitive substring match against the table name. Tables with name: null are excluded when a non-empty search term is provided.
Response shape Identical to GET /api/tables{ tables: [...] } with the same per-table fields. The canJoin field is computed relative to the authenticated player’s friendship with each host. Example — filter by seat availability and name
curl 'http://localhost:3000/api/lobby/tables?hasSeats=true&search=alice' \
  -H 'x-session-id: <sessionId>' \
  -H 'x-player-id: <playerId>'
Responses
StatusMeaning
200Body: { tables: [...] } — filtered list of public waiting tables
401Missing or invalid session
GET /api/lobby/tables computes canJoin relative to the authenticated player: for friends-only join-policy tables, the flag is true only when the requester is a friend of the host and a seat is available. GET /api/tables does not receive the requester identity and always sets canJoin: false for friends-only tables.

GET /api/player/table

Returns the tableId of the table the authenticated player is currently seated at or observing. Returns null if the player is not at any table. Tables whose game phase is game_over are excluded. Required headers
HeaderDescription
x-session-idSession token from login
x-player-idAuthenticated player’s UUID
Responses
200
object
tableId
string | null
UUID of the player’s current table, or null if they are not at one.
401
object
Missing or invalid session. Body: { "error": "..." }.
Example response — player is at a table
{ "tableId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
Example response — player is not at a table
{ "tableId": null }

Build docs developers (and LLMs) love