Skip to main content
Calling this endpoint authenticates an existing player and returns a fresh pair of JWT tokens. The response shape is identical to POST /auth/register, so your token-handling code works for both flows without modification.

Endpoint

POST /auth/login
No authentication is required.

Request body

email
string
required
The player’s registered email address.
password
string
required
The player’s password.

Example request

curl -X POST https://playsmart-gateway-1w8ko864.uc.gateway.dev/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "player@example.com",
    "password": "s3cur3pass"
  }'

Response

200 OK

access_token
string
A signed JWT bearer token. Include this in the Authorization: Bearer header on every authenticated request. Expires in 30 days.
refresh_token
string
A signed JWT refresh token. Use this to obtain a new access token when the current one expires. Expires in 180 days.
user
object
{
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "user": {
      "id": "device-abc-123",
      "email": "player@example.com",
      "pseudo": "CoolPlayer99",
      "total_games_completed": 42
    }
  }
}

Error responses

HTTP statusCodeMessageMeaning
400 BAD_REQUESTBAD_REQUESTinvalid_payloadThe request body failed validation. Check details for field-level errors.
401 UNAUTHORIZEDUNAUTHORIZEDinvalid_credentialsNo account exists for this email, or the password is incorrect.
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "invalid_credentials"
  }
}