Launch a game

Live
POST/api/v1/games/:gameId/launch

Get 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

FieldTypeRequiredDescription
AuthorizationstringYesUsed — send Bearer <member access_token>
X-Api-KeystringYesAgent API key (ak_…) from the bo screen
X-TimestampstringYesSigning time in unix milliseconds (±300s skew allowed)
X-NoncestringYesUnique per-request value (UUIDv4) for replay protection
X-SignaturestringYeshex(HMAC-SHA256(secret, canonical)) — see the Authentication page
X-Player-IPstringYesThe player's real IP (IPv4/IPv6) — required on this endpoint on the external channel (forwarded to the game provider)
X-Player-UAstring—The player's User-Agent (optional — recorded in login history)
X-Request-Idstring—Your correlation id — echoed back as request_uuid (recommended)
x-langstring—th (default) or en — the language of message

Path parameters

FieldTypeRequiredDescription
gameIdstring (uuid)YesGame id from the game list

Request bodyapplication/json

FieldTypeRequiredDescription
device_typestringYesThe player's device typedesktop | mobile
return_urlstring (URL)YesYour page the provider returns the player to when they exit the game
langstring—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

FieldTypeRequiredDescription
launch_urlstring (URL)—The provider's game-entry link — open it in the player's browser (redirect or iframe)
expires_atstring (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

codeNameHTTPMessage
3001GAME_NOT_FOUND404Game not foundThe game does not exist, or is disabled for your site
3002PROVIDER_UNAVAILABLE503Game provider is unavailableThe provider is under maintenance / not offered on your site, or the provider rejected the launch
4001VALIDATION_ERROR400Validation error
9002SERVICE_UNAVAILABLE503Service unavailableThe internal game service is temporarily unreachable — retry later