Creating an OAuth app
Create an OAuth app to access Calendly data on behalf of other Calendly users. Then use the OAuth authorization code flow with PKCE to get an access token for each user.
Create your OAuth app
-
Log in to Calendly, or sign up for a Calendly account.
-
Open Developer tools. In Calendly, open the Profile menu and select Developer.
Don’t see Developer in your Profile menu? Your account is still being moved. Until then, manage OAuth apps at developer.calendly.com.
-
On the OAuth apps tab, select Create OAuth app.
-
Enter the app details:
- App name: use letters, numbers, hyphens, and spaces only.
- Redirect URI: the URL where Calendly sends users after they authorize your app. Enter exactly one URI.
- Environment type: select Sandbox for development and testing, or Production when your app is ready for real users.
-
Select Next.
-
Select the scopes that your app needs. Select at least one scope. Learn more about scopes.
-
Select Create.
Redirect URI rules
We recommend that you start with a Sandbox app for development. Create a second app for Production when you are ready to use real customer data.
Save your credentials
After you create the app, Calendly shows these values:
- Client ID: your app’s identifier. Send it in each OAuth request.
- Client secret: a secret that your server uses to authenticate with Calendly.
- Webhook signing key: a key that you use to verify webhook signatures.
Copy all three values and store them securely before you leave this screen. You cannot view the client secret or the webhook signing key again. At this time, you also cannot view the client ID again in Developer tools.
Authorize users with PKCE
Every OAuth app must use Proof Key for Code Exchange (PKCE) with the S256 method. If the authorization request does not include a code challenge, the request fails. For more information about PKCE, see this guide. For a JavaScript example, see pkce-vanilla-js.
Get an authorization code
- Generate a
CODE_VERIFIER. - Build a
CODE_CHALLENGEfrom the verifier with SHA-256. - Redirect the user to Calendly’s authorization page in a web browser. Replace
CLIENT_ID,REDIRECT_URI, andCODE_CHALLENGEwith your values.
After the user grants access, Calendly redirects the user to your redirect URI with the authorization code:
Exchange the code for an access token
Send a POST request to Get Access Token at https://auth.calendly.com/oauth/token. Include these parameters:
grant_type:authorization_codecode: the authorization coderedirect_uri: the same redirect URI that you used to get the codeclient_id: your client IDcode_verifier: the verifier that you generated in step 1
If your app runs on a server, also send your client secret. Use HTTP Basic authentication with your client ID as the username and your client secret as the password.
Edit your OAuth app
- Open Developer tools.
- Select the pencil icon next to the app.
- Change the app name, redirect URI, environment type, or scopes.
- Save your changes.
You cannot view the client secret or the webhook signing key when you edit an app.
Delete your OAuth app
- Open Developer tools.
- Select the trash icon next to the app.
- Select Delete to confirm. You cannot undo this action.
See more
Learn what else you can accomplish with the Calendly API.
For the conditions that cause an access token to be revoked, see the Frequently Asked Questions.