> ## Documentation Index
> Fetch the complete documentation index at: https://calcomhelp-mintlify-webhook-seat-attendee-1775490034.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use OAuth to authorize apps with cal.com accounts

As an example, you can view our OAuth flow in action on Zapier. Try to connect your cal.com account [here](https://zapier.com/apps/calcom/integrations). To enable OAuth in one of your apps, you will need a Client ID, Client Secret, Authorization URL, Access Token Request URL, and Refresh Token Request URL.

<Frame>
  <img src="https://mintcdn.com/calcomhelp-mintlify-webhook-seat-attendee-1775490034/QyER6DPdfmxTQ-V4/images/oauth-zapier.png?fit=max&auto=format&n=QyER6DPdfmxTQ-V4&q=85&s=e05af8a4b59a510a2d0b88a317a0da7d" alt="" width="1092" height="824" data-path="images/oauth-zapier.png" />
</Frame>

### OAuth Client Credentials

Only the cal.com team can create new OAuth clients. Please fill out [this form](https://i.cal.com/forms/4052adda-bc79-4a8d-9f63-5bc3bead4cd3) and book us to get started.

The Cal.com team will register the app and provide you with the Client ID and Client Secret. Keep these credentials confidential and secure.

### Authorization URL

To initiate the OAuth flow, direct users to the following authorization URL:

* `https://app.cal.com/auth/oauth2/authorize`
* URL Parameters:
  * *client\_id*
  * *state*: A securely generated random string to mitigate CSRF attacks
  * *redirect\_uri*: This is where users will be redirected after authorization

After users click *Allow*, they will be redirected to the redirect\_uri with the code (authorization code) and state as URL parameters.

### Access Token Request

Endpoint: `POST https://app.cal.com/api/auth/oauth/token`

Request Body:

* *code*: The authorization code received in the redirect URI
* *client\_id*
* *client\_secret*
* *grant\_type*: "authorization\_code"
* *redirect\_uri*

Response:

```
{
    access_token: “exampleAccessToken”
    refresh_token: “exampleRefreshToken”
}
```

### Refresh Token Request

Endpoint: `POST https://app.cal.com/api/auth/oauth/refreshToken`

Headers:

* Authorization: Bearer *exampleRefreshToken*

Request Body:

* *grant\_type*: "refresh\_token"
* *client\_id*
* *client\_secret*

Response:

```
{
    access_token: “exampleAccessToken”,
    refresh_token: "exampleRefreshToken"
}
```

### Testing OAuth Credentials

To verify the correct setup and functionality of OAuth credentials you can use the following endpoint: `GET https://api.cal.com/v2/me`

Headers:

* Authorization: Bearer *exampleAccessToken*
