Skip to main content
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

token
string
required
The expired or soon-to-expire JWT access token.
refreshToken
string
required
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

statusCode
number
HTTP status code of the operation. 200 on success, 401 on failure.
status
boolean
true if the token was refreshed successfully, false otherwise.
message
string
A human-readable message describing the result.
data
object
Present on success. Contains the new token pair and user information.
curl --request POST \
  --url https://localhost:7191/api/auth/refresh-token \
  --header 'Content-Type: application/json' \
  --data '{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."
  }'
{
  "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"
  }
}

Build docs developers (and LLMs) love