Skip to main content
POST
Refresh Token
Exchanges a Cognito refresh token for a new access token and ID token. Use this endpoint to maintain an authenticated session without requiring the user to log in again.

Authentication

This is a public endpoint that does not require authentication. However, you must provide a valid refresh token obtained from a previous login.

Rate Limiting

This endpoint is rate-limited to 5 requests per minute per IP address.

Request Body

string
required
Cognito refresh token obtained from a previous login responseThis is the long-lived token returned by /api/auth/login.Example: eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ...

Request Example

Response

Success Response (200 OK)

string
New Cognito JWT access tokenUse this token in the Authorization: Bearer <token> header for authenticated requests.
string
The same refresh token that was provided in the requestCognito does not issue a new refresh token on refresh, so the original token is returned.
number
Token expiration time in secondsTypically 3600 (1 hour).
boolean
Always false for refresh token responses

Error Responses

Invalid or expired refresh tokenThe refresh token is malformed, expired, or has been revoked.
Rate limit exceeded — More than 5 requests in 1 minute

Notes

  • Refresh tokens are long-lived and remain valid until explicitly revoked
  • Cognito does not rotate refresh tokens automatically—the same refresh token can be used multiple times
  • Access tokens expire after 1 hour, so refresh them before they expire to maintain a seamless user experience
  • If the refresh token is expired or invalid, the user must log in again using /api/auth/login