Docs / Refresh Token
POST /v1/auth/refresh

Refresh Token

Refresh an expired access token

Refresh Token

Refresh an expired access token using a refresh token.

Endpoint

POST /v1/auth/refresh

Request

Headers

Header Value
Content-Type application/json

Body Parameters

Parameter Type Required Description
refresh_token string Yes The refresh token

Example Request

curl -X POST https://api.apimw.com/v1/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{
    "refresh_token": "rt_abc123xyz456"
  }'

Response

Success Response (200 OK)

{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "token_type": "Bearer",
    "expires_in": 3600,
    "refresh_token": "rt_new789abc"
  }
}

Error Response (401 Unauthorized)

{
  "success": false,
  "error": {
    "code": "INVALID_REFRESH_TOKEN",
    "message": "Refresh token is invalid or expired"
  }
}

Notes

  • Refresh tokens are single-use; a new refresh token is returned with each refresh
  • Refresh tokens expire after 30 days
  • If the refresh token is expired, you must re-authenticate with API credentials