Skip to main content

Endpoint

POST /api/auth/login
Authenticate a user with their email and password. Returns access and refresh tokens for subsequent API requests. No authentication required.

Request body

email
string
required
User’s email address.
password
string
required
User’s password.

Response

success
boolean
Indicates whether the request was successful.
timestamp
string
ISO 8601 timestamp of when the response was generated.
data
object
The login response data.
data.accessToken
string
JWT access token for authenticating API requests.
data.refreshToken
string
JWT refresh token for obtaining new access tokens.

Example request

curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123"
  }'

Example response

{
  "success": true,
  "timestamp": "2026-03-03T10:35:00Z",
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}

Build docs developers (and LLMs) love