> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://travelers.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://travelers.ferndocs.com/_mcp/server.

# Authentication

Travelers APIs authenticate with an OAuth 2.0 **client credentials** grant. You exchange the
client id and secret issued for your integration for a short-lived access token, then send that
token as a bearer token on every request.

## 1. Request an access token

#### Token request

```bash
curl -X POST https://api.travelers.com/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=$TRAVELERS_CLIENT_ID" \
  -d "client_secret=$TRAVELERS_CLIENT_SECRET" \
  -d "scope=surety claims payments"
```

## 2. Call an API with the token

#### Authenticated request

```bash
curl https://api.travelers.com/suretyb2b/api/healthCheck \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

## With the SDK

The SDK handles the bearer token for you — pass it once at construction:

**`TypeScript`**

```typescript title="TypeScript"
import { TravelersClient } from "@travelers/sdk";

const client = new TravelersClient({ token: process.env.TRAVELERS_TOKEN });
```

**`Python`**

```python title="Python"
from travelers import TravelersApi

client = TravelersApi(token=os.environ["TRAVELERS_TOKEN"])
```

> **Warn**
>
> Client secrets are confidential. Store them in a secrets manager, never in source control, and
> rotate them on the schedule agreed with your program manager.