Skip to content

Refresh token of a session​

POST
/auth/refresh-token

3.0.0, AUTH_SESSIONS only: exchanges the refresh token (body refreshToken, or the httpOnly cookie mongocamp_refresh) for a new access token and a new refresh token (rotation, the cookie is set again). A refresh token that was exchanged before revokes the session (401, code 4014); the previous one within AUTH_REFRESH_GRACE_DURATION gets an access token without a new refresh token.

Request Body​

application/json
JSON
{
  
"refreshToken": "string"
}

Responses​

application/json
JSON
{
  
"authToken": "string",
  
"userProfile": {
  
  
"user": "string",
  
  
"isAdmin": true,
  
  
"apiKey": "string",
  
  
"roles": [
  
  
  
"string"
  
  
],
  
  
"grants": [
  
  
  
{
  
  
  
  
"name": "string",
  
  
  
  
"read": true,
  
  
  
  
"write": true,
  
  
  
  
"administrate": true,
  
  
  
  
"grantType": "COLLECTION"
  
  
  
}
  
  
],
  
  
"email": "string",
  
  
"emailVerified": true,
  
  
"displayName": "string",
  
  
"identities": [
  
  
  
{
  
  
  
  
"provider": "string",
  
  
  
  
"subject": "string",
  
  
  
  
"email": "string"
  
  
  
}
  
  
],
  
  
"disabled": true,
  
  
"lastLoginAt": "2024-01-01T00:00:00Z",
  
  
"mfaEnabled": true
  
},
  
"expirationDate": "2024-01-01T00:00:00Z",
  
"refreshToken": "string",
  
"refreshExpirationDate": "2024-01-01T00:00:00Z",
  
"sessionId": "string"
}

Playground​

Body

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.