The JWT access token expires after 120 minutes . The refresh token expires after 240 minutes . Call this endpoint before the refresh token expires to maintain an active session without requiring the user to log in again.
Request
POST /api/auth/refresh-token
No authentication required.
Body
The expired or soon-to-expire JWT access token.
The refresh token issued during login or the last token refresh. Must match the refresh token stored for the user and must not be expired.
Response
HTTP status code of the operation. 200 on success, 401 on failure.
true if the token was refreshed successfully, false otherwise.
A human-readable message describing the result.
Present on success. Contains the new token pair and user information. The user’s email address.
The new JWT access token.
ISO 8601 datetime indicating when the new access token expires (120 minutes from issue time).
The new refresh token. Replace your stored refresh token with this value.
ISO 8601 datetime indicating when the new refresh token expires (240 minutes from issue time).
curl --request POST \
--url https://localhost:7191/api/auth/refresh-token \
--header 'Content-Type: application/json' \
--data '{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."
}'
200 Success
401 Unauthorized
{
"statusCode" : 200 ,
"status" : true ,
"message" : "Token renovado satisfactoriamente." ,
"data" : {
"fullName" : "Jane Doe" ,
"email" : "jane.doe@example.com" ,
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"tokenExpiration" : "2024-01-15T16:30:00Z" ,
"refreshToken" : "bmV3UmVmcmVzaFRva2VuU3RyaW5n..." ,
"refreshTokenExpire" : "2024-01-15T18:30:00Z"
}
}