Skip to main content
Question

Refresh token using oauth with calendly api encounters failure

  • November 16, 2024
  • 7 replies
  • 408 views

Hi community,

when i refresh the oauth token using the calendly api
url: `https://auth.calendly.com/oauth/token`
method: POST

data: 'grant_type=refresh_token&refresh_token=<refresh_token>'
 

it throws bad request error
code: 'ERR_BAD_REQUEST',
response
    data: {
      error: 'invalid_grant',
      error_description: 'The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.'
    }

please help or suggest what could be the issue, we are following the api reference correctly,
this happens when token gets expired multiple times and after multiple times of refresh it throws the above error or let’s say the oauth token expired and later after when refreshing the token throws the above error

7 replies

  • Employee
  • December 20, 2024

Hello!

 

I have replied to your inquiry in the help desk ticket you submitted. Thank you for reaching out to our support! 

 


  • New Community Member
  • January 13, 2025

Can you please post the solution here as well?


  • Community Member
  • January 15, 2025

Can you please post the solution here as well?


  • New Community Member
  • February 1, 2026

Hello!

 

I have replied to your inquiry in the help desk ticket you submitted. Thank you for reaching out to our support! 

 

@Tessa0991 Encountering same error, could you please share the solution here?


  • New Community Member
  • February 2, 2026

@Vansh75850 - are you able to share an example of the request you are sending (with credentials redacted)?

This error typically occurs due to the authorization header being incorrectly set. Although it is not specified in the documentation, you can send a json request (instead of URL form encoded format) as seen in Calendly’s example code:

https://github.com/calendly/buzzwordcrm/blob/main/services/calendlyService.js#L187


  • New Community Member
  • February 3, 2026

Hey ​@Calforce50652 ,
this is how i am sending the request

const tokenUrl = 'https://auth.calendly.com/oauth/token';

      const response = await axios.post(tokenUrl, {

        grant_type: 'refresh_token',

        client_id: this.clientId,

        client_secret: this.clientSecret,

        refresh_token: this.calendlyRefreshToken,

            });

When token gets expired 2-3 times and after refresh it throws invalid_grant error.
{
  "error": "invalid_grant",
  "error_description": "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
}

I’ve tried sending the request with headers, but I’m still getting the same error.


  • New Community Member
  • February 3, 2026

@Vansh75850 - the axios request looks correct, so this means that either the newly returned refresh token isn’t being saved or that there is some type of race condition where you are sending the refresh request in parallel using the same refresh token.

Are you able to share more of your code, or upload a portion of the code having the issue to GitHub? As I mentioned, the request looks fine so it’s likely something else that i causing the issue.