Platform / Managed Users
Refresh managed user tokens
Getting Started
Platform / Managed Users
Platform / Webhooks
Orgs / Attributes
Orgs / Attributes / Options
Orgs / Bookings
Orgs / Delegation Credentials
Orgs / Memberships
Orgs / Orgs
Orgs / Routing forms
Orgs / Schedules
Orgs / Teams
Orgs / Teams / Bookings
Orgs / Teams / Conferencing
Orgs / Teams / Event Types
Orgs / Teams / Memberships
Orgs / Teams / Routing forms
Orgs / Teams / Routing forms / Responses
Orgs / Teams / Users / Schedules
Orgs / Users / Bookings
Orgs / Users / OOO
Orgs / Users / Schedules
Orgs / Webhooks
Api Keys
Bookings
Calendars
Conferencing
Destination Calendars
Event Types
Event Types / Webhooks
OAuth Clients
Schedules
Selected Calendars
Slots
Stripe
Teams / Event Types
Teams / Memberships
Platform / Managed Users
Refresh managed user tokens
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
curl --request POST \
--url https://api.cal.com/v2/oauth/{clientId}/refresh \
--header 'Content-Type: application/json' \
--header 'x-cal-secret-key: <x-cal-secret-key>' \
--data '{
"refreshToken": "<string>"
}'
{
"status": "success",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"accessTokenExpiresAt": 123,
"refreshTokenExpiresAt": 123
}
}
Headers
OAuth client secret key.
Path Parameters
Body
application/json
Managed user's refresh token.
Response
200 - application/json
Available options:
success
, error
Example:
"success"
Was this page helpful?
curl --request POST \
--url https://api.cal.com/v2/oauth/{clientId}/refresh \
--header 'Content-Type: application/json' \
--header 'x-cal-secret-key: <x-cal-secret-key>' \
--data '{
"refreshToken": "<string>"
}'
{
"status": "success",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"accessTokenExpiresAt": 123,
"refreshTokenExpiresAt": 123
}
}