---
title: "Search available US phone numbers"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Twilio

`POST /api/twilio/available-numbers`

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Header parameters

- `x-workspace-id` (`post/api/twilio/available-numbers.header.x-workspace-id`; string, required)

## Request body

_Required._

- `workspaceId` (`post/api/twilio/available-numbers.workspaceId`; string, required)
- `areaCode` (`post/api/twilio/available-numbers.areaCode`; string, optional)
  - pattern `^\\d{3}$`
- `limit` (`post/api/twilio/available-numbers.limit`; integer, optional)
  - min 1; max 20; default `20`

## Example request

```json
{
  "workspaceId": "string",
  "areaCode": "string",
  "limit": 20
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/twilio/available-numbers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: string' \
  --data '
{
  "workspaceId": "string",
  "areaCode": "string",
  "limit": 20
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/twilio/available-numbers';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-workspace-id': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({workspaceId: 'string', areaCode: 'string', limit: 20})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/twilio/available-numbers"

payload = {
    "workspaceId": "string",
    "areaCode": "string",
    "limit": 20
}
headers = {
    "Content-Type": "application/json",
    "x-workspace-id": "string",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Matching available numbers

### 400

Invalid search controls

### 401

Authentication required

### 403

Workspace mismatch

### 404

Configuration missing

### 500

Search failed


Source: https://developer.channelautomations.com/api/post-api-twilio-available-numbers/index.md
