The JWT access token expires after 120 minutes . The refresh token expires after 240 minutes . Use the Refresh Token endpoint to obtain a new token pair before your session expires.
Request
POST /api/auth/login
No authentication required.
Body
The user’s email address.
Response
HTTP status code of the operation. 200 on success, 401 on failure.
true if the request succeeded, false otherwise.
A human-readable message describing the result.
Present on success. Contains the authenticated user’s token and profile information. The user’s full name (first name and last name).
The user’s email address.
The JWT access token. Include this as a Bearer token in the Authorization header for authenticated requests.
ISO 8601 datetime indicating when the access token expires (120 minutes from issue time).
The refresh token used to obtain a new access token pair.
ISO 8601 datetime indicating when the refresh token expires (240 minutes from issue time).
curl --request POST \
--url https://localhost:7191/api/auth/login \
--header 'Content-Type: application/json' \
--data '{
"email": "user@example.com",
"password": "YourPassword1!"
}'
200 Success
401 Unauthorized
{
"statusCode" : 200 ,
"status" : true ,
"message" : "Login exitoso." ,
"data" : {
"fullName" : "Jane Doe" ,
"email" : "user@example.com" ,
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"tokenExpiration" : "2024-01-15T14:30:00Z" ,
"refreshToken" : "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..." ,
"refreshTokenExpire" : "2024-01-15T16:30:00Z"
}
}