v1

latestOpenAPI 3.0.02026-07-17121287546.7 KB
Deprecated: Platform / Managed Users

Refresh managed user tokens

<Warning>These endpoints are deprecated and will be removed in the future.</Warning> If managed user access token is expired then get a new one using this endpoint - it will also refresh the refresh token, because we use "refresh token rotation" mechanism. Access token is valid for 60 minutes and refresh token for 1 year. Make sure to store them in your database, for example, in your User database model calAccessToken and calRefreshToken fields. Response also contains accessTokenExpiresAt and refreshTokenExpiresAt fields, but if you decode the jwt token the payload will contain clientId (OAuth client ID), ownerId (user to whom token belongs ID), iat (issued at time) and expiresAt (when does the token expire) fields.

post/v2/oauth/{clientId}/refresh

Path parameters

clientIdstring required

Headers

x-cal-secret-keystring required

OAuth client secret key.

Request body

refreshTokenstring required

Managed user's refresh token.

Response

status'success' | 'error' required

Example response

{
  "status": "success",
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
  }
}