Skip to main content
POST /api/auth/login No authentication required.

Request body

email
string
required
The email address associated with the account.
password
string
required
The account password.

Example

curl --request POST \
  --url http://localhost:3000/api/auth/login \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "[email protected]",
    "password": "s3cr3tpass"
  }'

Response

200 OK
token
string
required
A signed JWT valid for 30 days. Include this token in the Authorization header for authenticated requests.
user
object
required
Example response
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "a3f2c1d0-89b4-4e7a-b6f5-1234567890ab",
    "name": "Maria Silva",
    "email": "[email protected]",
    "points": 120,
    "current_streak": 5,
    "max_streak": 14
  }
}

Errors

StatusDescription
401Email or password is incorrect, or no account found for that email. Message: "Email ou senha inválidos".
500Internal server error.

Build docs developers (and LLMs) love