Log in

Live
POST/api/v1/auth/login

Log 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

FieldTypeRequiredDescription
Authorizationstring—Not used — this endpoint is public; no member token required
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-IPstring—The player's real IP (IPv4/IPv6) — recommended (used in login history)
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

Request bodyapplication/json

FieldTypeRequiredDescription
phonestringYesMobile number
passwordstringYesPassword
Request example
{
  "phone": "0812345678",
  "password": "P@ssw0rd123"
}

Response

Fields in data

FieldTypeRequiredDescription
access_tokenstring—JWT to send as Authorization: Bearer
expires_innumber—Access-token lifetime in seconds (900 = 15 minutes)
refresh_tokenstring—For requesting a new access token; valid 7 days
userobject—Member summary
└ idstring—Member id (uuid)
└ usernamestring—Username (agent prefix + phone)
└ rolestring—RoleMEMBER
└ statusstring—Account status, e.g. ACTIVE
└ member_tierstring | null—Member tier (e.g. BRONZE)
└ full_namestring | null—Full name
└ selected_promotion_idstring | 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

codeNameHTTPMessage
1005INVALID_CREDENTIALS401Invalid credentials
1008USER_SUSPENDED403User is suspended
1009USER_BANNED403User is banned
1016ACCOUNT_LOCKED429Too many failed login attempts. Try again laterMore than 5 failed attempts in 15 minutes — temporarily locked
4001VALIDATION_ERROR400Validation error