> Calendly developer docs. For page Markdown, append .md to any URL.
> Index: https://developer.calendly.com/llms.txt
> API catalog: https://developer.calendly.com/.well-known/api-catalog
> OpenAPI: https://developer.calendly.com/openapi/calendly-api.yaml
> OAuth authorization server: https://calendly.com/.well-known/oauth-authorization-server
> MCP protected resource: https://mcp.calendly.com/.well-known/oauth-protected-resource
> Scheduling MCP endpoint: https://mcp.calendly.com
> Docs search MCP: https://developer.calendly.com/_mcp/server

# Introspect Access/Refresh Token

POST https://auth.calendly.com/oauth/introspect
Content-Type: application/x-www-form-urlencoded

Use this endpoint to introspect an access/refresh token.

Reference: https://developer.calendly.com/api-docs/calendly-o-auth/o-auth/post-oauth-introspect

## Request

### Body (application/x-www-form-urlencoded)

This endpoint expects an object.

- `client_id` (string, required) — The ID provided by Calendly for the web application
- `client_secret` (string, required) — The secret provided by Calendly
- `token` (string, required) — The access/refresh token provided by Calendly

## Response

### 200

OK

- `active` (boolean, required) — Boolean indicator of whether or not the presented token is currently active
- `scope` (string, optional) — The scope of the access token
- `client_id` (string, optional) — The ID provided by Calendly for the web application
- `token_type` (string, optional) — The token type (currently this is always "Bearer")
- `exp` (double, optional) — The UNIX timestamp in seconds when the access-token will expire
- `iat` (double, optional) — The UNIX timestamp in seconds when the access-token was originally issued
- `owner` (string, optional) — A link to the resource that owns the token (currently, this is always a user)
- `organization` (string, optional) — A link to the owner's current organization

## Errors

### 400 Bad Request Error

Bad Request

- `error` (enum, required) — Error code
  - Allowed values: `invalid_request`
- `error_description` (string, required) — Error description

### 401 Unauthorized Error

Unauthorized

- `error` (enum, required) — Error code
  - Allowed values: `invalid_client`, `unauthorized_client`
- `error_description` (string, required) — Error description

## Examples

### Active token

**Request**

```json
{
  "client_id": "123",
  "client_secret": "456",
  "token": "abc"
}
```

**Response**

```json
{
  "active": true,
  "scope": "default",
  "client_id": "123",
  "token_type": "Bearer",
  "exp": 1601325434,
  "iat": 1601318234,
  "owner": "https://api.calendly.com/users/EBHAAFHDCAEQTSEZ",
  "organization": "https://api.calendly.com/organizations/EBHAAFHDCAEQTSEZ"
}
```

**SDK Code**

```python Active token
import requests

url = "https://auth.calendly.com/oauth/introspect"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Active token
const url = 'https://auth.calendly.com/oauth/introspect';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Active token
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://auth.calendly.com/oauth/introspect"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Active token
require 'uri'
require 'net/http'

url = URI("https://auth.calendly.com/oauth/introspect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java Active token
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://auth.calendly.com/oauth/introspect")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php Active token
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://auth.calendly.com/oauth/introspect', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp Active token
using RestSharp;

var client = new RestClient("https://auth.calendly.com/oauth/introspect");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift Active token
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://auth.calendly.com/oauth/introspect")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Inactive token

**Request**

```json
{
  "client_id": "123",
  "client_secret": "456",
  "token": "expired-or-revoked-token"
}
```

**Response**

```json
{
  "active": false
}
```

**SDK Code**

```python Inactive token
import requests

url = "https://auth.calendly.com/oauth/introspect"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Inactive token
const url = 'https://auth.calendly.com/oauth/introspect';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Inactive token
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://auth.calendly.com/oauth/introspect"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Inactive token
require 'uri'
require 'net/http'

url = URI("https://auth.calendly.com/oauth/introspect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java Inactive token
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://auth.calendly.com/oauth/introspect")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php Inactive token
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://auth.calendly.com/oauth/introspect', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp Inactive token
using RestSharp;

var client = new RestClient("https://auth.calendly.com/oauth/introspect");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift Inactive token
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://auth.calendly.com/oauth/introspect")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```