Skip to main content

Endpoint

POST /users/login
Authenticate with an existing username and password to receive a JWT token valid for 30 days.

Request body

username
string
required
Username of the account to login to.
password
string
required
Password for the account.

Response

token
string
JWT token valid for 30 days. Use this token in the Authorization header for authenticated requests.

Response format

Returns a plain text JWT token string:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Error codes

400 Bad Request
Payload was malformed, or the username or password was incorrect.Exception: UsernameOrPasswordIncorrectExceptionThis error occurs when:
  • The username does not exist
  • The password is incorrect
  • Request body is missing required fields

Example request

curl -X POST https://api.example.com/users/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "johndoe",
    "password": "mySecurePassword123"
  }'

Example response

Success (200)

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwidXNlcm5hbWUiOiJqb2huZG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Error (400 Bad Request)

{
  "message": "Username or password incorrect"
}

Build docs developers (and LLMs) love