Skip to main content

Refresh Access Token

Endpoint: POST auth/refresh Refreshes an expired access token using a valid refresh token. Use this endpoint when your access token has expired but you have a valid refresh token to obtain a new set of tokens without requiring the user to re-authenticate.

Body

{
  "refreshToken": "string" // Required: The refresh token obtained from previous login or refresh
}

Response

{
  "accessToken": "string",  // JWT access token
  "refreshToken": "string", // Refresh token for future token renewal
  "tokenType": "Bearer",   // Type of token (always "Bearer")
  "expiresIn": 3600,      // Access token validity period in seconds
  "userId": "string",      // User identifier
  "deviceId": "string",    // Device identifier
  "gameId": "string",      // Game identifier
  "tenantId": "string"     // Tenant identifier
}

Example

curl -X POST \
  https://api.gameramp.com/auth/refresh \
  -H 'Content-Type: application/json' \
  -d '{
    "refreshToken": "734539f4-19ad-4b78-836e-a4c61e5911bc"
  }'
Response:
{
  "accessToken":"eyJraWQiOiJhZTMwOWE2Yy1mMGVlLTRlYmYtYjIzNi1hMGQ3ZDk0ODg1ZTQiLCJhbGciOiJSUzI1NiJ9.eyJ0ZW5hbnRfaWQiOiJ0ZXN0X3RlbmFudF8xNzUyNTIzNDIxIiwiZGV2aWNlX2lkIjoiZGV2aWNlLTEyMyIsImdhbWVfaWQiOiJkZWZhdWx0X2dhbWUiLCJzdWIiOiJkZXZpY2UtMTIzXzVjODUwNzE0IiwiaWF0IjoxNzUyNzI2OTg1LCJleHAiOjE3NTI3Mjc4ODV9.Dz9npGt6jrTavM2oFchFi4Lw7tIoePd0TFsBxmx7f-yfxYwiIIBMiXfL_A0SMpTnINXvQkZrux16L_EXtZtEy2dfgO79ywac1TyYyuR_UPwrmuKR5jbNbXm5e9P8WY2z1KJOOQ7XVjvrZfkUrasyz-ZhDUmMIhAcwrLz9bDy3ih4I2rhCWvadM8my0tEBQ1vLTFt5uvJKQdt2L30zz5H2jOiV7JIWzFDhPW8eZZqFky259RU7WPMeAy1Z6pf4tYCnAf5zXtVuX0Wx_d5K0vqKoYf4YH1kb-tHBkh88jPCCLwY3liMHbCKO9mzqHbv7zirP6u6gIgcSy7TNX-ESKt5A",
  "refreshToken":"eebd9f2b-c421-4dda-a9ae-05ea08c6db6b",
  "tokenType":"Bearer",
  "expiresIn":900000,
  "userId":"device-123_5c850714",
  "deviceId":"device-123",
  "gameId":"default_game",
  "tenantId":"test_tenant_1752523421"
}

Error Responses

  • Status Code: 401 Unauthorized - When the refresh token is expired, invalid, revoked or not found
  • Status Code: 500 Internal Server Error - When an unexpected server error occurs during token refresh