curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"user": {
"user.id": "<string>",
"user.email": "<string>",
"user.full_name": "<string>",
"user.is_active": true,
"user.is_verified": true,
"user.created_at": {}
},
"tokens": {
"tokens.access_token": "<string>",
"tokens.refresh_token": "<string>",
"tokens.token_type": "<string>",
"tokens.expires_in": 123
}
}Authenticate user and receive JWT tokens
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"user": {
"user.id": "<string>",
"user.email": "<string>",
"user.full_name": "<string>",
"user.is_active": true,
"user.is_verified": true,
"user.created_at": {}
},
"tokens": {
"tokens.access_token": "<string>",
"tokens.refresh_token": "<string>",
"tokens.token_type": "<string>",
"tokens.expires_in": 123
}
}POST /api/auth/login
Authorization: Bearer <token> header."bearer".curl -X POST https://api.example.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "securePassword123"
}'
{
"user": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"full_name": "John Doe",
"is_active": true,
"is_verified": false,
"created_at": "2026-03-03T10:30:00Z"
},
"tokens": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "7x9kP3mN8qR2wV5tY1uZ4jH6fL0sA3bC",
"token_type": "bearer",
"expires_in": 1800
}
}
{
"sub": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"type": "access",
"exp": 1709467800,
"iat": 1709466000
}
sub: User ID (UUID)email: User’s email addresstype: Token type ("access")exp: Expiration timestamp (Unix epoch)iat: Issued at timestamp (Unix epoch){
"detail": "Invalid email or password"
}
{
"detail": "User account is disabled"
}
{
"detail": "Failed to login"
}