Skip to main content
POST /api/auth/login Authenticates a user with email and password. Returns a short-lived access token and a long-lived refresh token. Rate limited to 10 requests per hour per IP address.

Request body

email
string
required
The user’s registered email address. Case-insensitive.
password
string
required
The user’s password.

Response

200 OK

Returns both tokens and the authenticated user’s profile.
success
boolean
required
true on success.
message
string
Confirmation message.
data
object
required

Error responses

StatusDescription
401Invalid email or password
403Account is deactivated
curl --request POST \
  --url https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/auth/login \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "[email protected]",
    "password": "SecurePass123"
  }'
{
  "success": true,
  "message": "Inicio de sesion exitoso",
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MiIsImlhdCI6MTc0MjIwMDAwMCwiZXhwIjoxNzQyMjg2NDAwfQ.abc123",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MiIsImlhdCI6MTc0MjIwMDAwMCwiZXhwIjoxNzQ0NzkyMDAwfQ.def456",
    "user": {
      "id": 42,
      "username": "johndoe",
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Doe",
      "full_name": "John Doe",
      "is_active": true,
      "created_at": "2026-03-17T10:00:00.000000",
      "updated_at": "2026-03-17T10:00:00.000000",
      "role": {
        "id": 2,
        "name": "user",
        "description": "Standard user role"
      }
    }
  }
}

Build docs developers (and LLMs) love