Log in
LivePOST
/api/v1/auth/loginLog in with the member's phone and password to get a 15-minute access token. More than 5 failed attempts within 15 minutes temporarily locks the account.
Refresh tokens are single-use (rotated) and each member has exactly one session — a new login replaces the old session.
Headers
| Field | Type | Required | Description |
|---|---|---|---|
| Authorization | string | — | Not used — this endpoint is public; no member token required |
| 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 | — | The player's real IP (IPv4/IPv6) — recommended (used in login history) |
| 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 |
Request bodyapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | Mobile number |
| password | string | Yes | Password |
Request example
{
"phone": "0812345678",
"password": "P@ssw0rd123"
}Response
Fields in data
| Field | Type | Required | Description |
|---|---|---|---|
| access_token | string | — | JWT to send as Authorization: Bearer |
| expires_in | number | — | Access-token lifetime in seconds (900 = 15 minutes) |
| refresh_token | string | — | For requesting a new access token; valid 7 days |
| user | object | — | Member summary |
| └ id | string | — | Member id (uuid) |
| └ username | string | — | Username (agent prefix + phone) |
| └ role | string | — | RoleMEMBER |
| └ status | string | — | Account status, e.g. ACTIVE |
| └ member_tier | string | null | — | Member tier (e.g. BRONZE) |
| └ full_name | string | null | — | Full name |
| └ selected_promotion_id | string | null | — | Deposit bonus the member selected (null = no bonus) |
Response example
{
"success": true,
"code": 0,
"message": "สำเร็จ",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIs…",
"expires_in": 900,
"refresh_token": "eyJhbGciOiJIUzI1NiIs…",
"user": {
"id": "0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0",
"username": "abc0812345678",
"role": "MEMBER",
"status": "ACTIVE",
"member_tier": "BRONZE",
"full_name": "สมชาย ใจดี",
"selected_promotion_id": null
}
},
"request_uuid": "9f2b7d1e-4a83-4c1f-b2ce-6d5a0e8f3c21"
}Possible error codes
| code | Name | HTTP | Message |
|---|---|---|---|
| 1005 | INVALID_CREDENTIALS | 401 | Invalid credentials |
| 1008 | USER_SUSPENDED | 403 | User is suspended |
| 1009 | USER_BANNED | 403 | User is banned |
| 1016 | ACCOUNT_LOCKED | 429 | Too many failed login attempts. Try again laterMore than 5 failed attempts in 15 minutes — temporarily locked |
| 4001 | VALIDATION_ERROR | 400 | Validation error |