Refresh Token

Endpoint used for obtaining a new access token using the current valid token before it expires. This allows maintaining user session without requiring re-authentication.

Request

Property Value
Method POST
URL /api/auth/refresh
Content-Type application/json
Authentication Bearer Token

Response

Status Codes

Code Description
200 Success - Token refreshed
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or expired token
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Successful Response (200)

{
  "data": {
    "accessToken": "lQ7apV0tiH3OP7hKrLqBhWkAmKArdmkFJJLGoerQ",
    "tokenType": "Bearer",
    "expireDate": 1763639209689,
    "remainingTime": 899999
  },
  "meta": {
    "executionTime": 1,
    "generatedAt": 1763638309690
  },
  "message": "Your token has been restored"
}
Parameter Type Description
data.accessToken string New JWT access token
data.tokenType string Token type (always "Bearer")
data.expireDate integer Token expiration date (Unix timestamp in ms)
data.remainingTime integer Token validity time remaining in milliseconds
meta.executionTime integer Request processing time in milliseconds
meta.generatedAt integer Response generation timestamp (Unix timestamp in ms)
message string Main response status message

Error Response (4xx/5xx)

{
  "message": "Session not found"
}
Parameter Type Description
message string Human-readable error message

Notes

  • Token expires after 900 seconds (15 minutes).
  • Refresh should be called before the current token expires.