---
title: "Client Credentials Flow"
description: "Learn how to implement the Client Credentials flow for direct API access"
url: "https://api-docs.centraldispatch.com/authentication/client-credentials-flow"
image: "https://api-docs.centraldispatch.com/_og/d/c_Ocean.takumi,title_Client+Credentials+Flow,description_Learn+how+to+implement+the+Client+Credentials+flow+for+direct+API+access,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiNmZTgyMWUifX19,p_Ii9hdXRoZW50aWNhdGlvbi9jbGllbnQtY3JlZGVudGlhbHMtZmxvdyI,s_UOQ_xqxzUZTvd1WR.png"
---

# Client Credentials Flow

The Client Credentials flow is used when making API requests directly from your application without user interaction. This flow is suitable for server-to-server integrations where you're accessing the API on behalf of your own service.

## [Implementation Guide](#implementation-guide)

### [Requesting an Access Token](#requesting-an-access-token)

To obtain a service token, make a POST request to the token endpoint:

```http
POST https://id.centraldispatch.com/connect/token
```

#### [Required Request Parameters](#required-request-parameters)

| Field         | Description                                                          |
| :------------ | :------------------------------------------------------------------- |
| client_id     | An ID that was assigned to your company by Central Dispatch.         |
| client_secret | A secret code that was assigned to your company by Central Dispatch. |
| grant_type    | This field should always contain the value client_credentials.       |

#### [Example Request](#example-request)

```bash
curl -X POST https://id.centraldispatch.com/connect/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"
```

## [Response Format](#response-format)

### [Successful Response (200 OK)](#successful-response-200-ok)

```json
{
    "access_token": "eyJhbGciOiJSUzI1...",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "scope1 scope2..."
}
```

## [Using the Access Token](#using-the-access-token)

After obtaining the access token, include it in the Authorization header for all API requests:

```bash
curl -X GET https://api.centraldispatch.com/your-endpoint \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## [Important Notes](#important-notes)

-   Keep your client credentials secure.
-   All requests must use HTTPS.
-   Required header: `Content-Type: application/x-www-form-urlencoded`.
-   Access tokens expire after the time specified in `expires_in` (in seconds).