Launch a game
LivePOST
/api/v1/games/:gameId/launchGet a game-entry link for the member (access token required). The system verifies the game/provider is offered on your site, then issues the provider's launch_url to open in the player's browser.
Open launch_url in the player's browser as soon as you receive it (full redirect or iframe) — the link is short-lived and expires at expires_at; do not store or reuse it.
Headers
| Field | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Used — send Bearer <member access_token> |
| X-Api-Key | string | Yes | Agent API key (ak_…) from the bo screen |
| X-Timestamp | string | Yes | Signing time in unix milliseconds (±300s skew allowed) |
| X-Nonce | string | Yes | Unique per-request value (UUIDv4) for replay protection |
| X-Signature | string | Yes | hex(HMAC-SHA256(secret, canonical)) — see the Authentication page |
| X-Player-IP | string | Yes | The player's real IP (IPv4/IPv6) — required on this endpoint on the external channel (forwarded to the game provider) |
| X-Player-UA | string | — | The player's User-Agent (optional — recorded in login history) |
| X-Request-Id | string | — | Your correlation id — echoed back as request_uuid (recommended) |
| x-lang | string | — | th (default) or en — the language of message |
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| gameId | string (uuid) | Yes | Game id from the game list |
Request bodyapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
| device_type | string | Yes | The player's device typedesktop | mobile |
| return_url | string (URL) | Yes | Your page the provider returns the player to when they exit the game |
| lang | string | — | In-game language (ISO 639-1, max 8 chars) — defaults to th |
Request example
{
"device_type": "mobile",
"return_url": "https://www.your-site.com/lobby",
"lang": "th"
}Response
Fields in data
| Field | Type | Required | Description |
|---|---|---|---|
| launch_url | string (URL) | — | The provider's game-entry link — open it in the player's browser (redirect or iframe) |
| expires_at | string (ISO 8601) | — | when the launch_url expires |
Response example
{
"success": true,
"code": 0,
"message": "สำเร็จ",
"data": {
"launch_url": "https://m.pg-games.example.com/126/index.html?ot=eyJhbGciOiJIUzI1NiIs…",
"expires_at": "2026-07-05T12:15:00.000Z"
},
"request_uuid": "9f2b7d1e-4a83-4c1f-b2ce-6d5a0e8f3c21"
}Possible error codes
| code | Name | HTTP | Message |
|---|---|---|---|
| 3001 | GAME_NOT_FOUND | 404 | Game not foundThe game does not exist, or is disabled for your site |
| 3002 | PROVIDER_UNAVAILABLE | 503 | Game provider is unavailableThe provider is under maintenance / not offered on your site, or the provider rejected the launch |
| 4001 | VALIDATION_ERROR | 400 | Validation error |
| 9002 | SERVICE_UNAVAILABLE | 503 | Service unavailableThe internal game service is temporarily unreachable — retry later |