Game APIs
Public HTTP APIs use POST except health. Send Content-Type: application/json and token: YOUR_TOKEN to the approved app's base URL. See Authentication for errors and retries. IDs, URLs, players and amounts below are examples.
Game catalog
POST /api/v1/gamelist
Send {} with no parameters. The response message is a JSON string; parse it once more. The table describes the decoded object.
{"success":true,"message":"{\"list\":[{\"game_code\":\"baccarat\",\"name\":\"Baccarat\",\"game_type\":\"table\",\"thumb_url\":\"https://games.example.invalid/thumb/baccarat.png\",\"priority\":1,\"status\":1,\"version\":\"1\"}],\"timestamp\":1792000000}"}
| Field | Type | Meaning |
|---|---|---|
| list | array | Games; may be empty |
| timestamp | integer | Catalog generation time in Unix seconds, not a count or version |
| list[].game_code | string | Stable identifier used as launch game |
| list[].name | string | Display name |
| list[].game_type | string | Server category: table, betting, slots or fishing |
| list[].thumb_url | string | Thumbnail URL; use the returned value |
| list[].priority | integer | Recommended ascending order; break ties by game_code |
| list[].status | integer | 1 means enabled; show only available entries |
| list[].version | string | Resource version, possibly empty; not an API version |
The server does not guarantee sorting. The catalog does not return game_id, room_mode or hot_priority. Default rooms are server-managed; do not rebuild game URLs from directory names.
Launch a game
POST /api/v1/user/launch_url
Obtain an entry for a player authenticated on your site. Call from your server; do not let the browser impersonate arbitrary players.
| Field | Type | Meaning |
|---|---|---|
| user | string, required | Stable case-sensitive code: 1–32 ASCII letters, digits, underscores or hyphens |
| game | string, required | game_code from the catalog |
| name | string, optional | Nickname; defaults to user, not a unique identity |
| avatar | string, optional | Resource name from avatar catalog; defaults to default, not an arbitrary image URL |
| country_code | string, optional | Uppercase ISO two-letter country/region code, e.g. CN; defaults to empty |
| theme | string, optional | Theme passed to the entry; defaults to empty; support depends on game |
| room_id | integer, optional | Room location; ordinary launches use server defaults |
| server_id / table_id | integer, optional | For a machine, send together with room_id using current catalog values |
| watch | boolean, optional | Spectator intent for a machine; defaults to false; game decides whether allowed |
{"user":"test-player-001","name":"Test player","avatar":"default","country_code":"CN","game":"baccarat","theme":"0"}
{
"success":true,
"user_key":"WALLET_SESSION_KEY",
"game":"baccarat",
"launch_url":"https://games.example.invalid/?session=OPAQUE_SESSION&game=baccarat&theme=0&serverUrl=wss%3A%2F%2Fgames.example.invalid%2Fws"
}
| Field | Type | Meaning |
|---|---|---|
| success | boolean | Business result |
| user_key | string | Wallet session ID; retain server-side for callback validation |
| game | string | Actual game; an online player may resume their current game |
| launch_url | string | Complete entry URL; only this URL goes to the browser; treat as sensitive session data |
Identical user values are independent across partners. Obtaining a URL does not mean game login or wallet opening has completed. Repeated calls may issue another entry or resume the current game; read response game. Never construct, publicly expose or cache launch_url long-term. lobby_url currently does not change behavior. For iframe return, see Browser integration.
Typical failure messages: invalid user code (invalid format), invalid country_code, invalid user_code (player creation failure, possibly an invalid requested game), invalid game_code, machine unavailable (stale location), default room unavailable and profile update failed. These can arrive as HTTP 200 with success=false. Do not retry indefinitely.
Player status
POST /api/v1/user/status
Query a player under the current partner. user is required and must exactly match the launch value.
{"user":"test-player-001"}
{"success":true,"status":"offline"}
{
"success":true,
"game_code":"baccarat",
"status":"online",
"session":"OPAQUE_SESSION",
"session_timestamp":1792000000,
"session_time":60,
"login_timestamp":1792000010,
"login_time":50,
"balance":10000000,
"open_status":2
}
| Field | Type | Meaning |
|---|---|---|
| status | string | online or offline; reconcile wallet settlement separately |
| game_code / session | string, conditional | Present when a player exists in memory; session is sensitive |
| session_timestamp / session_time | integer, conditional | Entry issuance Unix seconds / seconds since issuance |
| login_timestamp / login_time | integer, online only | Login Unix seconds / seconds online |
| balance | integer, conditional | Raw server balance snapshot, not a replacement for your ledger |
| open_status | integer, conditional | 0 not started, 1 waiting, 2 wallet-open callback succeeded, 3 failed; not settlement completion |
Missing user returns success=false and message="user code empty". Without a runtime record, only success and status are returned. Do not assume optional fields exist.
Request exit
POST /api/v1/user/kick
user is a required string. This requests player exit; it is not synchronous settlement.
{"user":"test-player-001"}
{"success":true,"status":"pending"}
pending means an exit notification was sent; offline means the player is not currently online. Missing user returns user code empty. Neither successful status proves close callback completion. Withdrawals and adjustments must follow your reconciled wallet state. Query status after a timeout rather than assuming exit did not execute.
Avatar catalog
POST /api/v1/avatars
Send {}. This API returns top-level list directly, with no message parsing.
{"success":true,"list":[{"avatar":"default","url":"https://games.example.invalid/avatars/default.png"}]}
| Field | Type | Meaning |
|---|---|---|
| list | array | Available avatar catalog |
| list[].avatar | string | Resource name for launch avatar |
| list[].url | string | Display URL |
Public machine catalog
POST /api/v1/game/tables
Send {} to retrieve valid snapshots. message is a JSON string. Only games reporting machines appear; an empty array does not mean all games are unavailable.
{"success":true,"message":"{\"tables\":[{\"server_id\":101,\"room_id\":1,\"game_id\":100,\"table_id\":1,\"game_code\":\"example-game\",\"occupied\":false,\"players\":0,\"capacity\":1,\"jackpot\":\"100000\"}]}"}
| Decoded field | Type | Meaning |
|---|---|---|
| tables | array | Current public machine snapshots |
| tables[].game_code | string | Public game identifier |
| tables[].server_id / room_id / table_id | integer | Send all location fields together at launch; never invent IDs |
| tables[].game_id | integer | Internal identifier still returned here; join catalogs using game_code |
| tables[].occupied | boolean | Player count reached capacity; not a seat reservation |
| tables[].players / capacity | integer | Current count / capacity |
| tables[].jackpot | string, optional | Raw integer jackpot text for display only |
Snapshots older than 15 seconds are omitted. The catalog can change before launch. If launch returns machine unavailable, refresh and select again.
Game activity
POST /api/v1/game/activity
For online counts and win display, not transaction lookup. cursor is an optional string, initially empty. Send the previous response cursor unchanged; do not parse or construct it.
{"cursor":""}
{"success":true,"message":"{\"cursor\":\"EPOCH:42\",\"reset\":true,\"games\":[{\"game_code\":\"baccarat\",\"online\":12,\"stale\":false}],\"wins\":[{\"event_id\":\"101:example-event\",\"game_code\":\"baccarat\",\"nickname\":\"Example player\",\"avatar\":\"default\",\"country_code\":\"CN\",\"amount\":\"1000\",\"amount_type\":\"net_win\",\"occurred_at\":1792000000}]}"}
| Decoded field | Type | Meaning |
|---|---|---|
| cursor | string | Cursor for the next request |
| reset | boolean | True on first request, invalid/expired cursor or restart; clear old activity cache |
| games | array | Online snapshots |
| games[].game_code | string | Game identifier |
| games[].online | integer | Sum across valid instances, including bots; not this partner's human count |
| games[].stale | boolean | At least one instance is over 15 seconds old; stale counts are excluded |
| wins | array | Up to 100 events; deduplicate by event_id |
| wins[].event_id / game_code | string | Display event ID / game identifier |
| wins[].nickname / avatar / country_code | string | Display profile; country may be empty; not unique player identity |
| wins[].amount | string | Positive raw integer amount text |
| wins[].amount_type | string | Currently net_win |
| wins[].occurred_at | integer | Event Unix seconds |
Human activity is partner-filtered; bot activity is shared. Initial/reset results begin with at most the latest 20 global sequence entries and may contain fewer after filtering. Memory retains up to 2000 entries over roughly 10 minutes; historical replay is not guaranteed. Continue with returned cursors. There is no limit or historical-time-range query. Never use this feed for reconciliation.
Health
GET /api/v1/health
No request body or token. This checks only HTTP entry readiness.
{"status":"ok","pending":0}
| Field | Type | Meaning |
|---|---|---|
| status | string | ok or starting; either may use HTTP 200 |
| pending | integer | Requests currently pending at the HTTP entry |
Successful health checks do not prove database, all game instances, WebSocket or partner callback health. Public routes do not expose deposits, balance modification or historical ledger queries.