---
title: Obtain a Bearer token
description: Generate an access token for use with the Casebook API
---

[Skip to content](https://gohub.casebook.net/knowledge/obtain-a-bearer-token#main-content)

[More support](https://gohub.casebook.net/knowledge/kb-tickets/new)

[![logo-raspberry (1)](https://gohub.casebook.net/hs-fs/hubfs/logo-raspberry%20(1).png?width=1286&height=255&name=logo-raspberry%20(1).png)](https://gohub.casebook.net/)

- [Knowledge Base](https://gohub.casebook.net/knowledge)
- [Video Library](https://gohub.casebook.net/video-library)
- [Still Need Help?](https://gohub.casebook.net/knowledge/kb-tickets/new)

Open main navigation

Close main navigation

- [Knowledge Base](https://gohub.casebook.net/knowledge)
- [Video Library](https://gohub.casebook.net/video-library)
- [Still Need Help?](https://gohub.casebook.net/knowledge/kb-tickets/new)
- [More support](https://gohub.casebook.net/knowledge/kb-tickets/new)

 Hi. How can we help?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://gohub.casebook.net/knowledge)
2. [Integrations](https://gohub.casebook.net/knowledge/integrations)
3. [Custom incoming integrations with Casebook API](https://gohub.casebook.net/knowledge/integrations#custom-incoming-integrations-with-casebook-api)

# Obtain a Bearer token

## Generate an access token for use with the Casebook API

### Introduction

The Casebook API is secured with OAuth 2.0 authentication.  Every request to the Casebook API requires an `Authorization` header containing a valid OAuth 2.0 Bearer token.

This guide provides instructions and code samples for obtaining a Bearer token for use with the Casebook API.

### Prerequisites

**Your organization must be licensed for External Data Interoperability (API)** to interact with the Casebook API.

**You will need to [register an incoming application](https://gohub.casebook.net/knowledge/register-an-incoming-application) <https://gohub.casebook.net/knowledge/obtain-a-bearer-token>** before starting this guide.

### Instructions

Get started by noting **three details from your incoming integration**:

1. Navigate to *Casebook → Admin → Global → Integrations → **Incoming integrations***
2. Locate the incoming integration which you would like to use
3. Click the expand button on the external application to display the **Client ID** and **Callback URL**
4. Click the “View client secret” (key) icon to display the **Client Secret**

If you do not yet have an application, start with [Register an incoming application](https://gohub.casebook.net/knowledge/register-an-incoming-application) instructions.

#### Obtain a Bearer token<https://www.postman.com/payload-specialist-61143556/workspace/casebook-api/request/21327246-23bbf046-3389-452c-accd-c3585531fd40?action=share&source=copy-link&creator=21327246&ctx=documentation>

Next, use the "Obtain a Bearer token" request to **exchange these details for a Bearer token**.

```
POST <YOUR_CALLBACK_URL>/oauth2/token 
```

- Headers:  
    - Content-Type: `application/x-www-form-urlencoded`
- Body: N/A
- Query Parameters:
  
    - `client_id` (Required): `<YOUR_CLIENT_ID>`
    - `client_secret` (Required): `<YOUR_CLIENT_SECRET>`
    - `grant_type` (Required): `client_credentials`

### Tips

**Bearer tokens are valid for one hour**, so be sure to refresh your token regularly or before each new interaction with the Casebook API

### Examples

#### cURL

```
curl -X POST "<YOUR_CALLBACK_URL>/oauth2/token" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d "client_id=<YOUR_CLIENT_ID>" \  -d "client_secret=<YOUR_CLIENT_SECRET>" \  -d "grant_type=client_credentials"
```

#### JavaScript

```
const clientId = '<YOUR_CLIENT_ID>';const clientSecret = '<YOUR_CLIENT_SECRET>';const callbackUrl = '<YOUR_CALLBACK URL>';async function getAccessToken() {  const params = new URLSearchParams();  params.append('client_id', clientId);  params.append('client_secret', clientSecret);  params.append('grant_type', 'client_credentials');  const authenticationResponse = await axios({    url: callbackUrl + '/oauth2/token',    headers: { 'Content-Type', 'application/x-www-form-urlencoded' },    method: 'post',    data: params,  });  const token = authenticationResponse.data.access_token; // ← Look here!  return token;} 
```

#### Python

```
import requestsurl = "<YOUR_CALLBACK_URL>/oauth2/token"payload = {  "client_id": "YOUR_CLIENT_ID",  "client_secret": "YOUR_CLIENT_SECRET",  "grant_type": "client_credentials",  "redirect_uri": "YOUR_CALLBACK_URL"}headers = {  "Content-Type": "application/x-www-form-urlencoded"}response = requests.post(url, data=payload, headers=headers)if response.status_code == 200:  token = response.json()["access_token"] # ← Look here!  print("Access token:", token) else:  print("Error:", response.status_code, response.text)
```

### Next steps

Next, use your Bearer token to make a request to the Casebook API:

- [Format requests to the Casebook API](https://gohub.casebook.net/knowledge/format-requests-to-the-casebook-api)

---

For more help with the Casebook API, [get in touch with the Casebook Support team](https://gohub.casebook.net/knowledge/get-help-in-casebook).

- [Getting Started With Casebook](https://gohub.casebook.net/knowledge/getting-started-with-casebook#main-content)

    - [Casebook Overview](https://gohub.casebook.net/knowledge/getting-started-with-casebook#casebook-overview)
    - [Getting Started for New Users](https://gohub.casebook.net/knowledge/getting-started-with-casebook#getting-started-for-new-users)
    - [Services in Casebook](https://gohub.casebook.net/knowledge/getting-started-with-casebook#services-in-casebook)
    - [Notes](https://gohub.casebook.net/knowledge/getting-started-with-casebook#notes)
- [Admin](https://gohub.casebook.net/knowledge/admin#main-content)

    - [Casebook Security](https://gohub.casebook.net/knowledge/admin#casebook-security)
    - [Roles and Permissions](https://gohub.casebook.net/knowledge/admin#roles-and-permissions)
    - [User Management](https://gohub.casebook.net/knowledge/admin#user-management)
    - [Notifications](https://gohub.casebook.net/knowledge/admin#notifications)
    - [Data](https://gohub.casebook.net/knowledge/admin#data)
    - [Field Configuration](https://gohub.casebook.net/knowledge/admin#field-configuration)
    - [Dynamic Fields](https://gohub.casebook.net/knowledge/admin#dynamic-fields)
    - [Forms](https://gohub.casebook.net/knowledge/admin#forms)
    - [Implementation & Adoption](https://gohub.casebook.net/knowledge/admin#implementation-adoption)
- [People](https://gohub.casebook.net/knowledge/people)
- [Intake](https://gohub.casebook.net/knowledge/intake)
- [Engage](https://gohub.casebook.net/knowledge/engage#main-content)

    - [Text Messages](https://gohub.casebook.net/knowledge/engage#text-messages)
    - [Configuration](https://gohub.casebook.net/knowledge/engage#configuration)
    - [Notes](https://gohub.casebook.net/knowledge/engage#notes)
- [Track](https://gohub.casebook.net/knowledge/track)
- [Access](https://gohub.casebook.net/knowledge/access)
- [Workflow & Tasks](https://gohub.casebook.net/knowledge/workflow-tasks)
- [Reporting](https://gohub.casebook.net/knowledge/reporting#main-content)

    - [Overview](https://gohub.casebook.net/knowledge/reporting#overview)
    - [Datasets](https://gohub.casebook.net/knowledge/reporting#datasets)
    - [Dashboards](https://gohub.casebook.net/knowledge/reporting#dashboards)
    - [Pre-built Reports](https://gohub.casebook.net/knowledge/reporting#pre-built-reports)
    - [Custom Reports](https://gohub.casebook.net/knowledge/reporting#custom-reports)
    - [Data Visualizations](https://gohub.casebook.net/knowledge/reporting#data-visualizations)
    - [Filters](https://gohub.casebook.net/knowledge/reporting#filters)
    - [Calculated Fields](https://gohub.casebook.net/knowledge/reporting#calculated-fields)
    - [Other](https://gohub.casebook.net/knowledge/reporting#other)
- [Audit Logs](https://gohub.casebook.net/knowledge/audit-logs)
- [Integrations](https://gohub.casebook.net/knowledge/integrations#main-content)

    - [Low-code incoming integrations with Zapier](https://gohub.casebook.net/knowledge/integrations#low-code-incoming-integrations-with-zapier)
    - [Custom incoming integrations with Casebook API](https://gohub.casebook.net/knowledge/integrations#custom-incoming-integrations-with-casebook-api)
    - [Custom outgoing integrations with Webhooks](https://gohub.casebook.net/knowledge/integrations#custom-outgoing-integrations-with-webhooks)
- [Program Area Specific](https://gohub.casebook.net/knowledge/program-area-specific#main-content)

    - [VOCA Reporting](https://gohub.casebook.net/knowledge/program-area-specific#voca-reporting)
- [Customer Support](https://gohub.casebook.net/knowledge/customer-support#main-content)

    - [Getting Unstuck](https://gohub.casebook.net/knowledge/customer-support#getting-unstuck)
    - [Account Management](https://gohub.casebook.net/knowledge/customer-support#account-management)
- [Product Release Notes](https://gohub.casebook.net/knowledge/product-release-notes#main-content)

    - [2026](https://gohub.casebook.net/knowledge/product-release-notes#2026)
    - [2025](https://gohub.casebook.net/knowledge/product-release-notes#2025)
    - [2024](https://gohub.casebook.net/knowledge/product-release-notes#2024)
    - [2023](https://gohub.casebook.net/knowledge/product-release-notes#2023)
    - [2022](https://gohub.casebook.net/knowledge/product-release-notes#2022)
    - [2021](https://gohub.casebook.net/knowledge/product-release-notes#2021)
    - [2020](https://gohub.casebook.net/knowledge/product-release-notes#2020)
- [Frequently Asked Questions](https://gohub.casebook.net/knowledge/frequently-asked-questions#main-content)

    - [Global](https://gohub.casebook.net/knowledge/frequently-asked-questions#global)
    - [Casebook Calendar](https://gohub.casebook.net/knowledge/frequently-asked-questions#casebook-calendar)
    - [Casebook Services](https://gohub.casebook.net/knowledge/frequently-asked-questions#casebook-services)
    - [Casebook Forms](https://gohub.casebook.net/knowledge/frequently-asked-questions#casebook-forms)
    - [Casebook Notes](https://gohub.casebook.net/knowledge/frequently-asked-questions#casebook-notes)
    - [cb Admin](https://gohub.casebook.net/knowledge/frequently-asked-questions#cb-admin)
    - [cb Track](https://gohub.casebook.net/knowledge/frequently-asked-questions#cb-track)
    - [cb Reporting](https://gohub.casebook.net/knowledge/frequently-asked-questions#cb-reporting)
    - [cb Access](https://gohub.casebook.net/knowledge/frequently-asked-questions#cb-access)
    - [Program Specific](https://gohub.casebook.net/knowledge/frequently-asked-questions#program-specific)

[![logo-raspberry-1-1](https://gohub.casebook.net/hs-fs/hubfs/logo-raspberry-1-1.png?width=32&height=30&name=logo-raspberry-1-1.png "logo-raspberry-1-1")](https://www.casebook.net/)

© 2025 Casebook. All rights reserved.

Casebook Knowledge Base [Video Library](https://gohub.casebook.net/video-library) [Still Need Help?](https://gohub.casebook.net/knowledge/kb-tickets/new)