> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentPhone API reference

> API reference for the AgentPhone plugin in Corsair: every `agentphone.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Agents

### attachNumber

`agents.attachNumber`

Attach an existing phone number to an agent.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.agents.attachNumber({ agentId: '123e4567-e89b-42d3-a456-426614174000', numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `numberId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string \| null` | No | — |
| `number` | `object \| null` | No | — |

> [accordion] number full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   phoneNumber?: string | null,
>   status?: string | null,
>   type?: string | null
> } | null
> ```

***

### create

`agents.create`

Create Agent.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.agents.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `voiceMode` | `webhook \| hosted` | No | — |
| `enableMessaging` | `boolean \| null` | No | When true, hosted-mode agents can send and read SMS/iMessage during calls. Defaults to true. |
| `modelTier` | `turbo \| balanced \| max \| realtime \| live` | No | — |
| `systemPrompt` | `string \| null` | No | — |
| `voicePrompt` | `string \| null` | No | Live only: speaking identity, public call purpose (who you represent and why you call), style, and verbal rules. The voice model only knows what is written here; it delegates everything else. Required with modelTier live. Business instructions stay in systemPrompt. Omit on PATCH to preserve; null or empty clears when Live is inactive. |
| `beginMessage` | `string \| null` | No | — |
| `voice` | `string \| null` | No | — |
| `transferNumber` | `string \| null` | No | — |
| `customTools` | `object[] \| null` | No | Hosted-mode only. User-defined function tools the agent can call during a call (look up a record, save call notes, etc.). Each points at your HTTPS endpoint; the voice provider invokes it and feeds the JSON response back to the agent. Ignored in webhook mode. Maximum 20 tools. |
| `voicemailMessage` | `string \| null` | No | — |
| `callScreeningIdentity` | `string \| null` | No | — |
| `callScreeningPurpose` | `string \| null` | No | — |
| `sttMode` | `fast \| accurate` | No | Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (\~200ms additional latency). |
| `ambientSound` | `none \| office \| coffee-shop \| outdoor` | No | Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. |
| `denoisingMode` | `noise-cancellation \| noise-and-background-speech-cancellation` | No | Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs. |
| `maxSilenceMs` | `number \| null` | No | Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour). |
| `voiceSpeed` | `number \| null` | No | Voice speed multiplier. 1.0 is normal pace; lower values slow speech (0.5 is half speed), higher values speed it up (2.0 is double). Range 0.5 to 2.0. |
| `interruptionSensitivity` | `number \| null` | No | How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0. |
| `enableBackchannel` | `boolean \| null` | No | When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. Defaults to true. |
| `language` | `af-ZA \| ar-SA \| az-AZ \| bg-BG \| bs-BA \| ca-ES \| cs-CZ \| cy-GB \| da-DK \| de-DE \| el-GR \| en-AU \| en-GB \| en-IN \| en-NZ \| en-US \| es-419 \| es-ES \| fa-IR \| fi-FI \| fil-PH \| fr-CA \| fr-FR \| gl-ES \| he-IL \| hi-IN \| hr-HR \| hu-HU \| hy-AM \| id-ID \| is-IS \| it-IT \| ja-JP \| kk-KZ \| kn-IN \| ko-KR \| lt-LT \| lv-LV \| mk-MK \| mr-IN \| ms-MY \| ne-NP \| nl-BE \| nl-NL \| no-NO \| pl-PL \| pt-BR \| pt-PT \| ro-RO \| ru-RU \| sk-SK \| sl-SI \| sr-RS \| sv-SE \| sw-KE \| ta-IN \| th-TH \| tr-TR \| uk-UA \| ur-IN \| vi-VN \| yue-CN \| zh-CN` | No | BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. See the enum for the full set of supported codes. |

> [accordion] customTools full type
>
> ```ts theme={null}
> {
>   name: string,
>   description: string,
>   url: string,
>   method?: GET | POST,
>   headers?: Record<string, string> | null,
>   parameters?: {
>   } | null,
>   timeoutMs?: number | null,
>   speakDuringExecution?: boolean | null,
>   executionMessage?: string | null
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `voiceMode` | `string \| null` | No | — |
| `enableMessaging` | `boolean \| null` | No | — |
| `modelTier` | `string \| null` | No | — |
| `systemPrompt` | `string \| null \| null` | No | — |
| `voicePrompt` | `string \| null \| null` | No | — |
| `beginMessage` | `string \| null \| null` | No | — |
| `voice` | `string \| null` | No | — |
| `transferNumber` | `string \| null \| null` | No | — |
| `customTools` | `object[] \| null` | No | — |
| `voicemailMessage` | `string \| null \| null` | No | — |
| `callScreeningIdentity` | `string \| null \| null` | No | — |
| `callScreeningPurpose` | `string \| null \| null` | No | — |
| `sttMode` | `string \| null` | No | Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (\~200ms additional latency). |
| `ambientSound` | `string \| null` | No | Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. |
| `denoisingMode` | `string \| null` | No | Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs. |
| `maxSilenceMs` | `number \| null` | No | Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). |
| `voiceSpeed` | `number \| null` | No | Voice speed multiplier. Range 0.5 to 2.0. Default 1.0. |
| `interruptionSensitivity` | `number \| null` | No | How easily callers can interrupt the agent. Range 0.0 to 1.0. Default 0.8. |
| `enableBackchannel` | `boolean \| null` | No | When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. |
| `language` | `string \| null` | No | BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. |
| `createdAt` | `string \| null` | No | — |
| `numbers` | `object[] \| null` | No | — |

> [accordion] customTools full type
>
> ```ts theme={null}
> {
> }[] | null | null
> ```

> [accordion] numbers full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   phoneNumber?: string | null,
>   status?: string | null,
>   type?: string | null
> }[] | null | null
> ```

***

### delete

`agents.delete`

Delete Agent.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.agents.delete({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |

***

### detachNumber

`agents.detachNumber`

Detach a phone number from an agent (sets agentId to null).

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.agents.detachNumber({ agentId: '123e4567-e89b-42d3-a456-426614174000', numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### get

`agents.get`

Get a single agent with its attached numbers.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agents.get({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `voiceMode` | `string \| null` | No | — |
| `enableMessaging` | `boolean \| null` | No | — |
| `modelTier` | `string \| null` | No | — |
| `systemPrompt` | `string \| null \| null` | No | — |
| `voicePrompt` | `string \| null \| null` | No | — |
| `beginMessage` | `string \| null \| null` | No | — |
| `voice` | `string \| null` | No | — |
| `transferNumber` | `string \| null \| null` | No | — |
| `customTools` | `object[] \| null` | No | — |
| `voicemailMessage` | `string \| null \| null` | No | — |
| `callScreeningIdentity` | `string \| null \| null` | No | — |
| `callScreeningPurpose` | `string \| null \| null` | No | — |
| `sttMode` | `string \| null` | No | Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (\~200ms additional latency). |
| `ambientSound` | `string \| null` | No | Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. |
| `denoisingMode` | `string \| null` | No | Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs. |
| `maxSilenceMs` | `number \| null` | No | Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). |
| `voiceSpeed` | `number \| null` | No | Voice speed multiplier. Range 0.5 to 2.0. Default 1.0. |
| `interruptionSensitivity` | `number \| null` | No | How easily callers can interrupt the agent. Range 0.0 to 1.0. Default 0.8. |
| `enableBackchannel` | `boolean \| null` | No | When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. |
| `language` | `string \| null` | No | BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. |
| `createdAt` | `string \| null` | No | — |
| `numbers` | `object[] \| null` | No | — |

> [accordion] customTools full type
>
> ```ts theme={null}
> {
> }[] | null | null
> ```

> [accordion] numbers full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   phoneNumber?: string | null,
>   status?: string | null,
>   type?: string | null
> }[] | null | null
> ```

***

### list

`agents.list`

List all agents for this account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agents.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `total` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null | null,
>   voiceMode?: string | null,
>   enableMessaging?: boolean | null,
>   modelTier?: string | null,
>   systemPrompt?: string | null | null,
>   voicePrompt?: string | null | null,
>   beginMessage?: string | null | null,
>   voice?: string | null,
>   transferNumber?: string | null | null,
>   customTools?: {
>   }[] | null | null,
>   voicemailMessage?: string | null | null,
>   callScreeningIdentity?: string | null | null,
>   callScreeningPurpose?: string | null | null,
>   sttMode?: string | null,
>   ambientSound?: string | null,
>   denoisingMode?: string | null,
>   maxSilenceMs?: number | null,
>   voiceSpeed?: number | null,
>   interruptionSensitivity?: number | null,
>   enableBackchannel?: boolean | null,
>   language?: string | null,
>   createdAt?: string | null,
>   numbers?: {
>     id?: string | null,
>     phoneNumber?: string | null,
>     status?: string | null,
>     type?: string | null
>   }[] | null | null
> }[] | null
> ```

***

### listCalls

`agents.listCalls`

List all calls for an agent.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agents.listCalls({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `total` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agentId?: string | null | null,
>   phoneNumberId?: string | null | null,
>   phoneNumber?: string | null | null,
>   fromNumber?: string | null,
>   toNumber?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   startedAt?: string | null,
>   endedAt?: string | null | null,
>   durationSeconds?: number | null | null,
>   lastTranscriptSnippet?: string | null | null
> }[] | null
> ```

***

### listConversations

`agents.listConversations`

List all conversations for an agent.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agents.listConversations({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `total` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agentId?: string | null | null,
>   phoneNumberId?: string | null,
>   phoneNumber?: string | null,
>   participant?: string | null,
>   lastMessageAt?: string | null,
>   lastMessagePreview?: string | null,
>   messageCount?: number | null,
>   createdAt?: string | null
> }[] | null
> ```

***

### listVoices

`agents.listVoices`

Return available voices from the configured voice provider.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agents.listVoices({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### update

`agents.update`

Update an agent's configuration.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.agents.update({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `voiceMode` | `webhook \| hosted` | No | — |
| `enableMessaging` | `boolean \| null` | No | When true, hosted-mode agents can send and read SMS/iMessage during calls. |
| `modelTier` | `turbo \| balanced \| max \| realtime \| live` | No | — |
| `systemPrompt` | `string \| null` | No | — |
| `voicePrompt` | `string \| null` | No | Live only: speaking identity, public call purpose (who you represent and why you call), style, and verbal rules. The voice model only knows what is written here; it delegates everything else. Required with modelTier live. Business instructions stay in systemPrompt. Omit on PATCH to preserve; null or empty clears when Live is inactive. |
| `beginMessage` | `string \| null` | No | — |
| `voice` | `string \| null` | No | — |
| `transferNumber` | `string \| null` | No | — |
| `customTools` | `object[] \| null` | No | Hosted-mode only. User-defined function tools the agent can call during a call. Replaces the full set on each update; send \[] to clear all tools, or omit to leave unchanged. Ignored in webhook mode. Maximum 20 tools. |
| `voicemailMessage` | `string \| null` | No | — |
| `callScreeningIdentity` | `string \| null` | No | — |
| `callScreeningPurpose` | `string \| null` | No | — |
| `sttMode` | `fast \| accurate` | No | Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (\~200ms additional latency). |
| `ambientSound` | `none \| office \| coffee-shop \| outdoor` | No | Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. |
| `denoisingMode` | `noise-cancellation \| noise-and-background-speech-cancellation` | No | Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs. |
| `maxSilenceMs` | `number \| null` | No | Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour). |
| `voiceSpeed` | `number \| null` | No | Voice speed multiplier. 1.0 is normal pace; lower slows speech (0.5 is half speed), higher speeds it up (2.0 is double). Range 0.5 to 2.0. |
| `interruptionSensitivity` | `number \| null` | No | How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0. |
| `enableBackchannel` | `boolean \| null` | No | When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. |
| `language` | `af-ZA \| ar-SA \| az-AZ \| bg-BG \| bs-BA \| ca-ES \| cs-CZ \| cy-GB \| da-DK \| de-DE \| el-GR \| en-AU \| en-GB \| en-IN \| en-NZ \| en-US \| es-419 \| es-ES \| fa-IR \| fi-FI \| fil-PH \| fr-CA \| fr-FR \| gl-ES \| he-IL \| hi-IN \| hr-HR \| hu-HU \| hy-AM \| id-ID \| is-IS \| it-IT \| ja-JP \| kk-KZ \| kn-IN \| ko-KR \| lt-LT \| lv-LV \| mk-MK \| mr-IN \| ms-MY \| ne-NP \| nl-BE \| nl-NL \| no-NO \| pl-PL \| pt-BR \| pt-PT \| ro-RO \| ru-RU \| sk-SK \| sl-SI \| sr-RS \| sv-SE \| sw-KE \| ta-IN \| th-TH \| tr-TR \| uk-UA \| ur-IN \| vi-VN \| yue-CN \| zh-CN` | No | BCP-47 locale that drives the agent's speech recognition and pronunciation. See the enum for the full set of supported codes. |

> [accordion] customTools full type
>
> ```ts theme={null}
> {
>   name: string,
>   description: string,
>   url: string,
>   method?: GET | POST,
>   headers?: Record<string, string> | null,
>   parameters?: {
>   } | null,
>   timeoutMs?: number | null,
>   speakDuringExecution?: boolean | null,
>   executionMessage?: string | null
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `voiceMode` | `string \| null` | No | — |
| `enableMessaging` | `boolean \| null` | No | — |
| `modelTier` | `string \| null` | No | — |
| `systemPrompt` | `string \| null \| null` | No | — |
| `voicePrompt` | `string \| null \| null` | No | — |
| `beginMessage` | `string \| null \| null` | No | — |
| `voice` | `string \| null` | No | — |
| `transferNumber` | `string \| null \| null` | No | — |
| `customTools` | `object[] \| null` | No | — |
| `voicemailMessage` | `string \| null \| null` | No | — |
| `callScreeningIdentity` | `string \| null \| null` | No | — |
| `callScreeningPurpose` | `string \| null \| null` | No | — |
| `sttMode` | `string \| null` | No | Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (\~200ms additional latency). |
| `ambientSound` | `string \| null` | No | Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. |
| `denoisingMode` | `string \| null` | No | Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs. |
| `maxSilenceMs` | `number \| null` | No | Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). |
| `voiceSpeed` | `number \| null` | No | Voice speed multiplier. Range 0.5 to 2.0. Default 1.0. |
| `interruptionSensitivity` | `number \| null` | No | How easily callers can interrupt the agent. Range 0.0 to 1.0. Default 0.8. |
| `enableBackchannel` | `boolean \| null` | No | When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. |
| `language` | `string \| null` | No | BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. |
| `createdAt` | `string \| null` | No | — |
| `numbers` | `object[] \| null` | No | — |

> [accordion] customTools full type
>
> ```ts theme={null}
> {
> }[] | null | null
> ```

> [accordion] numbers full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   phoneNumber?: string | null,
>   status?: string | null,
>   type?: string | null
> }[] | null | null
> ```

***

## Agent Webhooks

### delete

`agentWebhooks.delete`

Remove the webhook for a specific agent.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.agentWebhooks.delete({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### get

`agentWebhooks.get`

Get the webhook configuration for a specific agent.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agentWebhooks.get({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `secret` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `contextLimit` | `number \| null` | No | — |
| `timeout` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***

### listDeliveries

`agentWebhooks.listDeliveries`

Get recent webhook delivery attempts for a specific agent's webhook.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.agentWebhooks.listDeliveries({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   messageId?: string | null | null,
>   eventType?: string | null | null,
>   channel?: string | null | null,
>   status?: string | null,
>   httpStatus?: number | null | null,
>   errorMessage?: string | null | null,
>   responseBody?: string | null | null,
>   attemptCount?: number | null,
>   lastAttemptAt?: string | null | null,
>   nextRetryAt?: string | null | null,
>   createdAt?: string | null
> }[]
> ```

***

### test

`agentWebhooks.test`

Send a test webhook to the agent's webhook endpoint.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.agentWebhooks.test({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `payload` | `object \| null` | No | Optional overrides for the synthetic agent.message a test delivery carries. Everything is optional and defaults to the historical sample values, so a bare POST behaves exactly as before. Overrides let a handler that routes on `to` / `from` (one webhook serving many sub-accounts) exercise its real path without buying a number first. The event only ever goes to the calling account's own configured webhook, so `to` is just a string here. |

> [accordion] payload full type
>
> ```ts theme={null}
> {
>   from?: string | null,
>   to?: string | null,
>   message?: string | null,
>   channel?: sms | imessage | mms | whatsapp | rcs | null
> } | null
> ```

**Output:** `any`

***

### upsert

`agentWebhooks.upsert`

Save the webhook for one agent. Store the signing secret returned by AgentPhone.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.agentWebhooks.upsert({ agentId: '123e4567-e89b-42d3-a456-426614174000', url: 'https://example.com/hooks/agentphone' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `url` | `string` | Yes | — |
| `contextLimit` | `number \| null` | No | — |
| `timeout` | `number \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `secret` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `contextLimit` | `number \| null` | No | — |
| `timeout` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***

## Caller Name

### get

`callerName.get`

The caller name shown when this number calls someone. supported is false for numbers that can't set one.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.callerName.get({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supported` | `boolean \| null` | No | — |
| `name` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `error` | `string \| null \| null` | No | — |
| `updatedAt` | `string \| null \| null` | No | — |
| `monthlyPriceCents` | `number \| null` | No | — |
| `nextBillingAt` | `string \| null \| null` | No | — |

***

### upsert

`callerName.upsert`

Set the caller name (max 15 characters). Starts as "pending" and usually becomes "active" within 1-3 days. Display is up to the receiving carrier; many mobile carriers don't show it.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.callerName.upsert({ numberId: '123e4567-e89b-42d3-a456-426614174000', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supported` | `boolean \| null` | No | — |
| `name` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `error` | `string \| null \| null` | No | — |
| `updatedAt` | `string \| null \| null` | No | — |
| `monthlyPriceCents` | `number \| null` | No | — |
| `nextBillingAt` | `string \| null \| null` | No | — |

***

## Calls

### createOutbound

`calls.createOutbound`

Initiate an outbound call.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.calls.createOutbound({ agentId: '123e4567-e89b-42d3-a456-426614174000', toNumber: '+12025550101' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `agentId` | `string` | Yes | Agent ID to make the call from |
| `toNumber` | `string` | Yes | Phone number to call (E.164 format) |
| `fromNumberId` | `string \| null` | No | Optional phone number ID to use as caller ID. Must belong to the agent. If omitted, the agent's first assigned number is used. |
| `initialGreeting` | `string \| null` | No | Optional initial greeting to speak when recipient answers. Pass an empty string to have the agent stay silent and wait for the recipient to speak first. |
| `voice` | `string \| null` | No | Voice ID override for this call (uses agent's configured voice if omitted) |
| `ringTimeoutSeconds` | `number \| null` | No | Optional ring timeout in whole seconds (5–90) for this call, including transfer ringing. If omitted or null, uses the engine's default of 30 seconds. |
| `systemPrompt` | `string \| null` | No | When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic. |
| `modelTier` | `turbo \| balanced \| max \| realtime \| live` | No | Optional model tier override for this call's built-in conversation. Only applies when `systemPrompt` is provided; defaults to the agent's configured modelTier. |
| `variables` | `Record<string, string> \| null` | No | Optional per-call dynamic variables. Values are substituted into `{{var_name}}` placeholders in the agent's system prompt and initial greeting at call time. Requires either `systemPrompt` or a hosted-mode agent. |
| `callScreeningIdentity` | `string \| null` | No | For outbound calls that hit an automated call screener (e.g. iOS 26 Call Screening or Android Call Screen): the identity the agent gives when asked who is calling. Overrides the agent's stored default for this call. Both identity and purpose are required to enable screening; if only a purpose is set, the agent's name is used. |
| `callScreeningPurpose` | `string \| null` | No | For outbound calls that hit an automated call screener: the purpose the agent gives when asked why it is calling. Overrides the agent's stored default for this call. |
| `disableRecording` | `boolean` | No | When true, no audio recording is stored for this call. The transcript is still captured and available via the transcript endpoints and the agent.call\_ended webhook. Useful for calls where a party has not consented to being recorded (e.g. two-party consent states). |

**Output:** `any`

***

### createWeb

`calls.createWeb`

Create a browser-based web call.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.calls.createWeb({ agentId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `agentId` | `string` | Yes | Agent ID to start the web call with |
| `metadata` | `object \| null` | No | Optional metadata to attach to the call |
| `variables` | `Record<string, string> \| null` | No | Optional per-call dynamic variables. Values are substituted into `{{var_name}}` placeholders in the agent's system prompt and begin message at call time. Requires a hosted-mode agent. |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

**Output:** `any`

***

### end

`calls.end`

Terminate an ongoing call.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.calls.end({ callId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### get

`calls.get`

Get a specific call with its transcripts.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.calls.get({ callId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### getRecording

`calls.getRecording`

Download the recording as a file. Keep recording URLs and audio private.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.calls.getRecording({ callId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

### getTranscript

`calls.getTranscript`

Get the full transcript for a call.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.calls.getTranscript({ callId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### list

`calls.list`

List all calls for this account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.calls.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `status` | `string \| null` | No | Filter by status: completed, in-progress, failed |
| `direction` | `string \| null` | No | Filter by direction: inbound, outbound |
| `type` | `string \| null` | No | Filter by type: pstn, web |
| `search` | `string \| null` | No | Search fromNumber or toNumber (contains) |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### listForNumber

`calls.listForNumber`

List all calls for a specific phone number.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.calls.listForNumber({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### pushTranscript

`calls.pushTranscript`

Push transcript turns for a call (e.g. from a BYO voice stack).

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.calls.pushTranscript({
	callId: '123e4567-e89b-42d3-a456-426614174000',
	turns: [{ role: 'user', content: 'example' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `turns` | `object[]` | Yes | — |

> [accordion] turns full type
>
> ```ts theme={null}
> {
>   role: user | agent,
>   content: string
> }[]
> ```

**Output:** `any`

***

### streamTranscript

`calls.streamTranscript`

Replay a finished call as server-sent event text. This operation checks the call status and returns the complete replay after the ended event. Use calls.getTranscript for a snapshot during a live call.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.calls.streamTranscript({ callId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string` | Yes | The response body as text. |
| `contentType` | `string \| null` | Yes | The content type AgentPhone answered with. |

***

## Contact Cards

### delete

`contactCards.delete`

Remove the iMessage contact card from this number.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.contactCards.delete({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | AgentPhone accepted the call; it answered with no body. |

***

### get

`contactCards.get`

Fetch the iMessage contact card set on this number.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.contactCards.get({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `firstName` | `string \| null \| null` | No | — |
| `lastName` | `string \| null \| null` | No | — |
| `displayName` | `string \| null \| null` | No | — |
| `hasAvatar` | `boolean \| null` | No | — |

***

### upsert

`contactCards.upsert`

Create or replace the iMessage contact card on this number.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.contactCards.upsert({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `firstName` | `string \| null` | No | — |
| `lastName` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `avatarUrl` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `firstName` | `string \| null \| null` | No | — |
| `lastName` | `string \| null \| null` | No | — |
| `displayName` | `string \| null \| null` | No | — |
| `hasAvatar` | `boolean \| null` | No | — |

***

## Contacts

### create

`contacts.create`

Create a new contact.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.contacts.create({ phoneNumber: '+12025550101', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `phoneNumber` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `email` | `string \| null` | No | — |
| `notes` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`contacts.delete`

Delete Contact.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.contacts.delete({ contactId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | AgentPhone accepted the call; it answered with no body. |

***

### get

`contacts.get`

Get a single contact by ID.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.contacts.get({ contactId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### getCapabilities

`contacts.getCapabilities`

Check which messaging channels a phone number supports, without sending a message.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.contacts.getCapabilities({ phone_number: '+12025550101' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number` | `string` | Yes | Phone number in plain E.164 format, for example +12025550101. |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `phoneNumber` | `string \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `checkedAt` | `string \| null` | No | — |

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   imessage?: boolean | null | null,
>   sms?: boolean | null | null,
>   rcs?: boolean | null | null
> } | null
> ```

***

### list

`contacts.list`

List all contacts for this account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.contacts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `search` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `total` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   phoneNumber?: string | null,
>   name?: string | null,
>   email?: string | null | null,
>   notes?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### update

`contacts.update`

Update a contact's fields.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.contacts.update({ contactId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `notes` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Conversations

### get

`conversations.get`

Get a conversation with its recent messages.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.conversations.get({ conversationId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `message_limit` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agentId` | `string \| null \| null` | No | — |
| `phoneNumberId` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `participant` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |
| `isGroup` | `boolean \| null` | No | — |
| `groupId` | `string \| null \| null` | No | — |
| `groupName` | `string \| null \| null` | No | — |
| `groupIconUrl` | `string \| null \| null` | No | — |
| `participants` | `object[] \| null` | No | — |
| `lastMessageAt` | `string \| null` | No | — |
| `messageCount` | `number \| null` | No | — |
| `metadata` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `capabilities` | `object \| null` | No | What the caller can do in this conversation, derived from its number's provider and compliance state. Drives the dashboard composer/reaction UI. |

> [accordion] participants full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   name?: string | null | null
> }[] | null | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   body?: string | null,
>   fromNumber?: string | null,
>   toNumber?: string | null,
>   direction?: string | null,
>   senderIdentifier?: string | null | null,
>   channel?: string | null | null,
>   status?: string | null | null,
>   failureReason?: string | null | null,
>   errorCode?: string | null | null,
>   deliveredAt?: string | null | null,
>   deliveredChannel?: string | null | null,
>   readAt?: string | null | null,
>   mediaUrl?: string | null | null,
>   mediaUrls?: string[] | null,
>   receivedAt?: string | null,
>   content?: {
>   } | null | null,
>   reactions?: {
>     id?: string | null,
>     reactionType?: string | null,
>     fromNumber?: string | null,
>     direction?: string | null,
>     createdAt?: string | null
>   }[] | null,
>   replyTo?: {
>     messageId?: string | null,
>     message?: string | null,
>     mediaUrls?: string[] | null
>   } | null | null
> }[] | null
> ```

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   canSendMessages?: boolean | null,
>   sendDisabledReason?: string | null | null,
>   sendChannel?: string | null | null,
>   availableChannels?: string[] | null,
>   mediaChannels?: string[] | null,
>   whatsappWindowExpiresAt?: string | null | null,
>   media?: boolean | null,
>   reactions?: boolean | null,
>   emojiReactions?: boolean | null
> } | null | null
> ```

***

### list

`conversations.list`

List all conversations for this account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.conversations.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `total` | `number \| null` | No | Total conversations for this account; may be up to a few minutes old (cached per account, default five minutes). Use hasMore for pagination. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agentId?: string | null | null,
>   phoneNumberId?: string | null,
>   phoneNumber?: string | null,
>   participant?: string | null,
>   channel?: string | null,
>   isGroup?: boolean | null,
>   groupId?: string | null | null,
>   groupName?: string | null | null,
>   groupIconUrl?: string | null | null,
>   participants?: {
>     identifier?: string | null,
>     name?: string | null | null
>   }[] | null | null,
>   lastMessageAt?: string | null,
>   lastMessagePreview?: string | null,
>   messageCount?: number | null,
>   metadata?: {
>   } | null | null,
>   createdAt?: string | null
> }[] | null
> ```

***

### listMessages

`conversations.listMessages`

Get paginated messages for a conversation.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.conversations.listMessages({ conversationId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `before` | `string \| null` | No | — |
| `after` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | Opaque cursor from a previous response's nextCursor. Takes precedence over before/after. |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   body?: string | null,
>   fromNumber?: string | null,
>   toNumber?: string | null,
>   direction?: string | null,
>   senderIdentifier?: string | null | null,
>   channel?: string | null | null,
>   status?: string | null | null,
>   failureReason?: string | null | null,
>   errorCode?: string | null | null,
>   deliveredAt?: string | null | null,
>   deliveredChannel?: string | null | null,
>   readAt?: string | null | null,
>   mediaUrl?: string | null | null,
>   mediaUrls?: string[] | null,
>   receivedAt?: string | null,
>   content?: {
>   } | null | null,
>   reactions?: {
>     id?: string | null,
>     reactionType?: string | null,
>     fromNumber?: string | null,
>     direction?: string | null,
>     createdAt?: string | null
>   }[] | null,
>   replyTo?: {
>     messageId?: string | null,
>     message?: string | null,
>     mediaUrls?: string[] | null
>   } | null | null
> }[] | null
> ```

***

### removeBackground

`conversations.removeBackground`

Clear the custom wallpaper for the chat (iMessage only).

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.conversations.removeBackground({ conversationId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | AgentPhone accepted the call; it answered with no body. |

***

### sendTypingIndicator

`conversations.sendTypingIndicator`

Show a typing indicator in the conversation (iMessage only).

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.conversations.sendTypingIndicator({ conversationId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

***

### setBackground

`conversations.setBackground`

Set a custom wallpaper for the chat (iMessage only).

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.conversations.setBackground({ conversationId: '123e4567-e89b-42d3-a456-426614174000', image_url: 'https://example.com/callback' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `image_url` | `string` | Yes | HTTPS URL of the background image. JPEG/PNG/GIF/WebP/HEIC, max 10MB. Recipients on iOS \< 18 see the default background; no error is raised. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |
| `hasBackground` | `boolean \| null` | No | — |
| `backgroundId` | `string \| null \| null` | No | — |
| `backgroundVersion` | `number \| null \| null` | No | — |
| `changed` | `boolean \| null` | No | — |

***

### update

`conversations.update`

Update a conversation.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.conversations.update({ conversationId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `metadata` | `object \| null` | No | — |
| `group_name` | `string \| null` | No | New display name for a group conversation. iMessage groups only; also renames the underlying iMessage thread. Ignored (omit) for 1:1 chats. |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agentId` | `string \| null \| null` | No | — |
| `phoneNumberId` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `participant` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |
| `isGroup` | `boolean \| null` | No | — |
| `groupId` | `string \| null \| null` | No | — |
| `groupName` | `string \| null \| null` | No | — |
| `groupIconUrl` | `string \| null \| null` | No | — |
| `participants` | `object[] \| null` | No | — |
| `lastMessageAt` | `string \| null` | No | — |
| `messageCount` | `number \| null` | No | — |
| `metadata` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `capabilities` | `object \| null` | No | What the caller can do in this conversation, derived from its number's provider and compliance state. Drives the dashboard composer/reaction UI. |

> [accordion] participants full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   name?: string | null | null
> }[] | null | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   body?: string | null,
>   fromNumber?: string | null,
>   toNumber?: string | null,
>   direction?: string | null,
>   senderIdentifier?: string | null | null,
>   channel?: string | null | null,
>   status?: string | null | null,
>   failureReason?: string | null | null,
>   errorCode?: string | null | null,
>   deliveredAt?: string | null | null,
>   deliveredChannel?: string | null | null,
>   readAt?: string | null | null,
>   mediaUrl?: string | null | null,
>   mediaUrls?: string[] | null,
>   receivedAt?: string | null,
>   content?: {
>   } | null | null,
>   reactions?: {
>     id?: string | null,
>     reactionType?: string | null,
>     fromNumber?: string | null,
>     direction?: string | null,
>     createdAt?: string | null
>   }[] | null,
>   replyTo?: {
>     messageId?: string | null,
>     message?: string | null,
>     mediaUrls?: string[] | null
>   } | null | null
> }[] | null
> ```

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   canSendMessages?: boolean | null,
>   sendDisabledReason?: string | null | null,
>   sendChannel?: string | null | null,
>   availableChannels?: string[] | null,
>   mediaChannels?: string[] | null,
>   whatsappWindowExpiresAt?: string | null | null,
>   media?: boolean | null,
>   reactions?: boolean | null,
>   emojiReactions?: boolean | null
> } | null | null
> ```

***

## Feedback

### submit

`feedback.submit`

Report an API issue or documentation mismatch, including the request id of the call it is about when you have one.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.feedback.submit({ category: 'bug', note: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `category` | `bug \| docs_mismatch \| friction \| feature_gap \| quality_degradation \| other` | Yes | Kind of issue: `bug`, `docs_mismatch`, `friction`, `feature_gap`, `quality_degradation` or `other`. |
| `note` | `string` | Yes | What went wrong and what you expected instead. 1 to 4000 characters. |
| `request_id` | `string \| null` | No | The `request_id` of the API call the feedback is about, from the `X-Request-Id` response header or the error body. Feedback is stored once per request id. |
| `url` | `string \| null` | No | The page the feedback is about, such as a docs page. http(s) only, up to 2048 characters. |
| `tags` | `string[] \| null` | No | Labels for filtering, up to 20, each 1 to 50 characters. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `feedback_id` | `string \| null` | No | ID of the stored feedback. |
| `already_submitted` | `boolean \| null` | No | True when feedback for this `request_id` was already recorded; the original `feedback_id` is returned. |
| `request_id` | `string \| null \| null` | No | Unique ID of this request, also in the `X-Request-Id` header. Include it when contacting support. |

***

## Location

### get

`location.get`

Get Location.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.location.get({ phoneNumber: '+12025550101' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phoneNumber` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `phoneNumber` | `string \| null` | No | — |
| `latitude` | `number \| null \| null` | No | — |
| `longitude` | `number \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `lastUpdated` | `number \| null` | No | — |

***

### refresh

`location.refresh`

Refresh Locations.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.location.refresh({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `pollAfterSeconds` | `number \| null` | No | — |

***

## Messages

### send

`messages.send`

Send a message from an existing number. SMS requires outbound carrier activation. Check message history for delivery status before retrying a timed-out send.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.messages.send({ number_id: '123e4567-e89b-42d3-a456-426614174000', to_number: '+12025550101', body: 'Your appointment is confirmed.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `agent_id` | `string \| null` | No | The ID of the agent sending the message. Determines which phone number and provider to use. |
| `to_number` | `string \| null` | No | Recipient phone/address or an existing group identifier. Preserve group identifiers returned by the API. Supply to\_number or recipients, not both. |
| `recipients` | `string[] \| null` | No | Create a new group on a supported number. Use 2–32 distinct recipients on eligible iMessage lines, or 2–10 phone numbers on supported carrier MMS lines. Mutually exclusive with to\_number; response to\_number is the group address for later sends. Group sends accept at most one attachment. WhatsApp and branded RCS groups are unsupported. |
| `body` | `string \| null` | No | Message text. Use an empty string for media-only sends. Text plus media is transport-dependent: voice memos, some iMessage carousels, and branded RCS media messages cannot include body text. |
| `media_url` | `string \| null` | No | Single public HTTPS attachment URL. Prefer media\_urls and do not supply both fields. |
| `media_urls` | `string[] \| null` | No | Public HTTPS attachments, 1–20 on eligible transports. WhatsApp and groups accept one. Some iMessage lines reject text alongside multiple images. Native iMessage voice memos require one audio file and an empty body. Branded RCS media sends accept one file and no body text; see [RCS rich cards](https://docs.corsair.dev/documentation/guides/rcs#rich-cards) for an image with text. |
| `number_id` | `string \| null` | No | Select an attached sending number explicitly. When omitted, an eligible number is chosen automatically; attachment order is not a default-number guarantee. |
| `from_number` | `string \| null` | No | — |
| `channel` | `whatsapp` | No | Optional transport override for numbers connected to multiple channels. Pass "whatsapp" to send via the number's WhatsApp connection instead of its default SMS/iMessage transport. WhatsApp-only numbers use WhatsApp automatically. |
| `send_style` | `celebration \| fireworks \| lasers \| love \| confetti \| balloons \| spotlight \| echo \| invisible \| gentle \| loud \| slam` | No | Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. |
| `reply_to_message_id` | `string \| null` | No | Optional parent message ID (AgentPhone Message.id) to send this message as an inline reply. Supported on iMessage and WhatsApp; the parent must be in the same chat and sent from the same number. |
| `buttons` | `string[] \| null` | No | WhatsApp only: up to 3 tappable reply buttons (each max 20 chars). The tapped button's text arrives as a normal inbound message. Pass media\_urls alongside buttons to render that image, video, or document as a header above the text, in the same bubble as the buttons (audio has no header form and is rejected). |
| `list` | `object \| null` | No | WhatsApp only: a tap-to-open list menu. \{"button": "View options", "options": \["Small", "Medium", "Large"]} (max 10 options, 24 chars each), or full form with sections: \{"button": str, "sections": \[\{"title": str, "rows": \[\{"id": str, "title": str, "description": str}]}]}. |
| `cta` | `object \| null` | No | WhatsApp only: a single tappable link button on an ordinary message. \{"display\_text": "Track order", "url": "[https://example.com/t/123](https://example.com/t/123)", "footer": "Tap to see live status"} — `footer` is optional. The url must be absolute and https. Unlike a URL button on a template this needs no Meta review, but as an ordinary message it only reaches someone inside the 24h window. |
| `template` | `object \| null` | No | WhatsApp only: send a Meta-approved message template. This is the only way to reach someone outside the 24h customer service window. \{"name": "order\_shipped", "language": "en\_US", "variables": \["1234"]} — `variables` fill the template body, and `header_variables` does the same for a text header. Pass an array for a POSITIONAL template (\{\{1}}, \{\{2}}) or an object for a NAMED one, e.g. \{"variables": \{"first\_name": "Pablo"}} for a body reading "Thanks \{\{first\_name}}!". The shape must match how the template was authored. `language` defaults to en\_US. The template must already be APPROVED (see the templates endpoints). `body` is NOT delivered for template sends — WhatsApp renders the approved template content — it is kept only as a fallback label if we can't render the template for your message history. |

> [accordion] list full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] cta full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] template full type
>
> ```ts theme={null}
> {
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |
| `from_number` | `string \| null` | No | — |
| `to_number` | `string \| null` | No | — |
| `conversation_id` | `string \| null \| null` | No | — |
| `media_urls` | `string[] \| null` | No | — |
| `reply_to_message_id` | `string \| null \| null` | No | — |
| `reply_parent_unresolved` | `boolean \| null \| null` | No | — |

***

### sendReaction

`messages.sendReaction`

Send Reaction.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.messages.sendReaction({ messageId: '123e4567-e89b-42d3-a456-426614174000', reaction: 'like' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `messageId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `reaction` | `string` | Yes | iMessage reaction to send. Classic tapbacks (love, like, dislike, laugh, emphasize, question) are supported on every iMessage line. Custom emoji reactions (e.g. "🔥", "😂", "👍") are supported on newer lines only; lines that don't support them return a 400 with upgrade instructions. Custom emoji also require the recipient to be on macOS 14 / iOS 17 or later. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `reaction_type` | `string \| null` | No | — |
| `message_id` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |

***

## Numbers

### create

`numbers.create`

Provision an AgentPhone number. AgentPhone charges the first month when it provisions the number.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.numbers.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `country` | `string` | No | — |
| `areaCode` | `string \| null` | No | — |
| `agentId` | `string \| null` | No | — |
| `externalId` | `string \| null` | No | — |
| `type` | `sms \| imessage \| null` | No | — |
| `imessageType` | `inbound \| outbound \| null` | No | — |
| `expiresAt` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `agentId` | `string \| null \| null` | No | — |
| `outboundSms` | `string \| null` | No | Outbound SMS readiness for this exact number: activating means campaign attachment is in progress; enabled means confirmed; registration\_required means registration or attachment is still needed. Check the number and registration in the same account/sub-account scope. See /sms-registration. |
| `voiceRouting` | `object \| null` | No | Where this number's inbound calls go. Set it with PATCH /v1/numbers/\{number\_id}/voice-routing. |
| `sipTrunkingEligible` | `boolean \| null` | No | True when this number can be routed to a SIP trunk via PATCH /v1/numbers/\{number\_id}/voice-routing. |
| `inboundCallsEnabled` | `boolean \| null` | No | — |
| `readReceiptsEnabled` | `boolean \| null` | No | — |
| `whatsappEnabled` | `boolean \| null` | No | — |
| `dailyNewContacts` | `object \| null` | No | — |
| `externalId` | `string \| null \| null` | No | — |
| `rcsFallbackForAlias` | `string \| null \| null` | No | — |
| `expiresAt` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `purchasedAt` | `string \| null \| null` | No | — |
| `renewsAt` | `string \| null \| null` | No | Scheduled renewal of this number's monthly fee, ISO 8601 UTC. Null when no renewal is scheduled or its date is not known. |

> [accordion] voiceRouting full type
>
> ```ts theme={null}
> {
>   method?: string | null,
>   sipTrunkId?: string | null,
>   sipTrunkName?: string | null | null,
>   routingState?: string | null,
>   routingError?: string | null | null
> } | null | null
> ```

> [accordion] dailyNewContacts full type
>
> ```ts theme={null}
> {
>   used?: number | null,
>   limit?: number | null | null
> } | null | null
> ```

***

### get

`numbers.get`

Get a single phone number owned by this account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.numbers.get({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `agentId` | `string \| null \| null` | No | — |
| `outboundSms` | `string \| null` | No | Outbound SMS readiness for this exact number: activating means campaign attachment is in progress; enabled means confirmed; registration\_required means registration or attachment is still needed. Check the number and registration in the same account/sub-account scope. See /sms-registration. |
| `voiceRouting` | `object \| null` | No | Where this number's inbound calls go. Set it with PATCH /v1/numbers/\{number\_id}/voice-routing. |
| `sipTrunkingEligible` | `boolean \| null` | No | True when this number can be routed to a SIP trunk via PATCH /v1/numbers/\{number\_id}/voice-routing. |
| `inboundCallsEnabled` | `boolean \| null` | No | — |
| `readReceiptsEnabled` | `boolean \| null` | No | — |
| `whatsappEnabled` | `boolean \| null` | No | — |
| `dailyNewContacts` | `object \| null` | No | — |
| `externalId` | `string \| null \| null` | No | — |
| `rcsFallbackForAlias` | `string \| null \| null` | No | — |
| `expiresAt` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `purchasedAt` | `string \| null \| null` | No | — |
| `renewsAt` | `string \| null \| null` | No | Scheduled renewal of this number's monthly fee, ISO 8601 UTC. Null when no renewal is scheduled or its date is not known. |

> [accordion] voiceRouting full type
>
> ```ts theme={null}
> {
>   method?: string | null,
>   sipTrunkId?: string | null,
>   sipTrunkName?: string | null | null,
>   routingState?: string | null,
>   routingError?: string | null | null
> } | null | null
> ```

> [accordion] dailyNewContacts full type
>
> ```ts theme={null}
> {
>   used?: number | null,
>   limit?: number | null | null
> } | null | null
> ```

***

### list

`numbers.list`

List the phone numbers already assigned to the account. Use the returned id to fetch message history or calls.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.numbers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `externalId` | `string \| null` | No | Only the number tagged with this externalId |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `total` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   phoneNumber?: string | null,
>   country?: string | null,
>   status?: string | null,
>   type?: string | null,
>   agentId?: string | null | null,
>   outboundSms?: string | null,
>   voiceRouting?: {
>     method?: string | null,
>     sipTrunkId?: string | null,
>     sipTrunkName?: string | null | null,
>     routingState?: string | null,
>     routingError?: string | null | null
>   } | null | null,
>   sipTrunkingEligible?: boolean | null,
>   inboundCallsEnabled?: boolean | null,
>   readReceiptsEnabled?: boolean | null,
>   whatsappEnabled?: boolean | null,
>   dailyNewContacts?: {
>     used?: number | null,
>     limit?: number | null | null
>   } | null | null,
>   externalId?: string | null | null,
>   rcsFallbackForAlias?: string | null | null,
>   expiresAt?: string | null | null,
>   createdAt?: string | null,
>   purchasedAt?: string | null | null,
>   renewsAt?: string | null | null
> }[] | null
> ```

***

### listAvailable

`numbers.listAvailable`

Search purchasable phone numbers before buying one.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.numbers.listAvailable({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `areaCode` | `string \| null` | No | 3-digit area code, e.g. "415". The most broadly supported filter. |
| `city` | `string \| null` | No | City name. Pair with state. Support varies by account. |
| `state` | `string \| null` | No | 2-letter state code, e.g. "CA". Pair with city for consistent results; standalone support varies by account. |
| `zip` | `string \| null` | No | 5-digit ZIP. Support varies by account. |
| `country` | `string` | No | "US", "CA", or "UK" ("GB" is accepted as an alias). United Kingdom availability varies by account. |
| `limit` | `number` | No | Max results, 1-30. |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `widened` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   phoneNumber?: string | null,
>   city?: string | null | null,
>   state?: string | null | null,
>   rateCenter?: string | null | null,
>   areaCode?: string | null | null
> }[] | null
> ```

***

### listMessages

`numbers.listMessages`

Read message history for a number, including inbound SMS. Use the number id from numbers.list and follow nextCursor for older or newer messages.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.numbers.listMessages({ numberId: '123e4567-e89b-42d3-a456-426614174000', limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `before` | `string \| null` | No | — |
| `after` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | Opaque cursor from a previous response's nextCursor. Takes precedence over before/after. |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `hasMore` | `boolean \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   from_?: string | null,
>   to?: string | null,
>   body?: string | null,
>   direction?: string | null,
>   channel?: string | null | null,
>   status?: string | null | null,
>   failureReason?: string | null | null,
>   receivedAt?: string | null
> }[] | null
> ```

***

### lookup

`numbers.lookup`

Look up line type, country, and RCS support. Replace the example with the E.164 number to look up. AgentPhone bills each number looked up.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.numbers.lookup({ phoneNumbers: '+12025550101' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phoneNumbers` | `string` | Yes | Comma-separated E.164 numbers, up to 25 |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   phoneNumber?: string | null,
>   lineType?: string | null | null,
>   country?: string | null | null,
>   rcsEnabled?: boolean | null | null
> }[] | null
> ```

***

### release

`numbers.release`

Permanently release a phone number and stop renewals.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.numbers.release({ numberId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### update

`numbers.update`

Update an existing number. Use an externalId unique to your account.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.numbers.update({ numberId: '123e4567-e89b-42d3-a456-426614174000', externalId: 'northstar-support' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `externalId` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `phoneNumber` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `agentId` | `string \| null \| null` | No | — |
| `outboundSms` | `string \| null` | No | Outbound SMS readiness for this exact number: activating means campaign attachment is in progress; enabled means confirmed; registration\_required means registration or attachment is still needed. Check the number and registration in the same account/sub-account scope. See /sms-registration. |
| `voiceRouting` | `object \| null` | No | Where this number's inbound calls go. Set it with PATCH /v1/numbers/\{number\_id}/voice-routing. |
| `sipTrunkingEligible` | `boolean \| null` | No | True when this number can be routed to a SIP trunk via PATCH /v1/numbers/\{number\_id}/voice-routing. |
| `inboundCallsEnabled` | `boolean \| null` | No | — |
| `readReceiptsEnabled` | `boolean \| null` | No | — |
| `whatsappEnabled` | `boolean \| null` | No | — |
| `dailyNewContacts` | `object \| null` | No | — |
| `externalId` | `string \| null \| null` | No | — |
| `rcsFallbackForAlias` | `string \| null \| null` | No | — |
| `expiresAt` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `purchasedAt` | `string \| null \| null` | No | — |
| `renewsAt` | `string \| null \| null` | No | Scheduled renewal of this number's monthly fee, ISO 8601 UTC. Null when no renewal is scheduled or its date is not known. |

> [accordion] voiceRouting full type
>
> ```ts theme={null}
> {
>   method?: string | null,
>   sipTrunkId?: string | null,
>   sipTrunkName?: string | null | null,
>   routingState?: string | null,
>   routingError?: string | null | null
> } | null | null
> ```

> [accordion] dailyNewContacts full type
>
> ```ts theme={null}
> {
>   used?: number | null,
>   limit?: number | null | null
> } | null | null
> ```

***

### updateInboundCalls

`numbers.updateInboundCalls`

Turn inbound calls on or off for one number.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.numbers.updateInboundCalls({ numberId: '123e4567-e89b-42d3-a456-426614174000', enabled: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `enabled` | `boolean` | Yes | false rejects inbound calls on this number; true answers them again. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `inboundCallsEnabled` | `boolean \| null` | No | — |

***

### updateVoiceRouting

`numbers.updateVoiceRouting`

Route a number's inbound calls.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.numbers.updateVoiceRouting({ numberId: '123e4567-e89b-42d3-a456-426614174000', method: 'sip_trunk', sipTrunkId: '123e4567-e89b-42d3-a456-426614174001' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `numberId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `method` | `sip_trunk \| agent \| ignore` | Yes | Where inbound calls to this number go. |
| `sipTrunkId` | `string` | No | Trunk to deliver calls to; required when method is "sip\_trunk". |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `voiceRouting` | `object \| null` | No | — |

> [accordion] voiceRouting full type
>
> ```ts theme={null}
> {
>   method?: string | null,
>   sipTrunkId?: string | null | null,
>   sipTrunkName?: string | null | null,
>   routingState?: string | null | null,
>   routingError?: string | null | null
> } | null
> ```

***

## Registration

### getDetails

`registration.getDetails`

Retrieve the content of your submitted A2P 10DLC registration.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.registration.getDetails({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `campaign_status` | `string \| null` | No | — |
| `stage` | `string \| null \| null` | No | — |
| `issue` | `object \| null` | No | Set when `stage` is `action_required`: the reason and what to change. |
| `sub_account_id` | `string \| null \| null` | No | Set when the registration lives on a sub-account of the calling account. |
| `brand` | `object \| null` | No | — |
| `campaign` | `object \| null` | No | — |

> [accordion] issue full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   message?: string | null,
>   since?: string | null | null
> } | null | null
> ```

> [accordion] brand full type
>
> ```ts theme={null}
> {
>   business_name?: string | null | null,
>   website_url?: string | null | null,
>   industry?: string | null | null,
>   entity_type?: string | null | null,
>   ein?: string | null | null,
>   email?: string | null | null,
>   phone?: string | null | null,
>   contact_name?: string | null | null,
>   street_address?: string | null | null,
>   street_address_2?: string | null | null,
>   city?: string | null | null,
>   state?: string | null | null,
>   zip_code?: string | null | null,
>   country?: string | null | null
> } | null | null
> ```

> [accordion] campaign full type
>
> ```ts theme={null}
> {
>   use_case?: string | null | null,
>   description?: string | null | null,
>   message_samples?: string[] | null,
>   consent_flow?: string | null | null,
>   opt_in_image_url?: string | null | null,
>   includes?: string[] | null
> } | null | null
> ```

***

### getStatus

`registration.getStatus`

Get Registration Status.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.registration.getStatus({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `campaign_status` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `stage` | `string \| null \| null` | No | — |
| `issue` | `object \| null` | No | Set when `stage` is `action_required`: the reason and what to change. For a registration under review, resubmitting with PATCH /v1/register clears it. A registration that failed carrier review (`campaign_status` back to `none`) is resubmitted with POST /v1/register; a suspended one needs support. |
| `sub_account_id` | `string \| null \| null` | No | Set when the registration lives on a sub-account of the calling account (the default for POST /v1/register). Pass it as the X-Sub-Account-Id header to address that sub-account directly. |

> [accordion] issue full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   message?: string | null,
>   since?: string | null | null
> } | null | null
> ```

***

### register

`registration.register`

Submit an A2P registration. Adapt the sample messages, consent flow, and business details for your campaign.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.registration.register({
	registration_type: 'sole_proprietor',
	first_name: 'example',
	last_name: 'example',
	email: 'ada@example.com',
	phone_number: '+12025550101',
	street_address: 'example',
	city: 'example',
	state: 'example',
	zip_code: 'example',
	description: 'Appointment reminders and schedule changes for patients who opt in to texts from Northstar Dental.',
	use_cases: ['account_notification'],
	message_samples: ['Northstar Dental: Your appointment is tomorrow at 2 PM. Reply STOP to opt out.', 'Northstar Dental: Your appointment moved to 3 PM. Call the office if you need to reschedule.'],
	consent_flow: 'Patients opt in by checking an optional SMS consent box on the appointment booking form.',
	opt_in_image_url: 'https://example.com/callback',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `registration_type` | `sole_proprietor \| standard_brand \| high_volume` | Yes | `sole_proprietor` (\\$25) for individuals without an EIN, `standard_brand` (\\$25) for EIN businesses with lighter volume, or `high_volume` (\\\$70) for EIN businesses sending at scale with third-party brand vetting. |
| `first_name` | `string` | Yes | Your first name (or business contact's first name). |
| `last_name` | `string` | Yes | Your last name (or business contact's last name). |
| `email` | `string` | Yes | Contact email address. |
| `phone_number` | `string` | Yes | Contact phone number in E.164 format (e.g. `+15551234567`). |
| `business_name` | `string \| null` | No | Legal/registered business name. Required for `standard_brand` and `high_volume`. |
| `brand_name` | `string \| null` | No | Public-facing brand name if different from `business_name`. |
| `organization_type` | `sole_proprietor \| private_corporation \| public_corporation \| llc \| partnership \| non_profit \| co_op \| government \| null` | No | Business structure: `sole_proprietor`, `private_corporation`, `public_corporation`, `llc`, `partnership`, `non_profit`, `co_op`, `government`. Required for `standard_brand` and `high_volume`. |
| `contact_title` | `ceo \| cfo \| cto \| coo \| vp \| gm \| director \| other \| null` | No | Your role: `ceo`, `cfo`, `cto`, `coo`, `vp`, `gm`, `director`, `other`. Required for `standard_brand` and `high_volume`. |
| `contact_title_other` | `string \| null` | No | Custom title when `contact_title` is `other`. |
| `ein` | `string \| null` | No | EIN / Tax ID number. Required for `standard_brand` and `high_volume`. |
| `website_url` | `string \| null` | No | Business website URL. |
| `industry` | `string \| null` | No | Industry category (e.g. `technology`, `real_estate`, `retail`, `healthcare`). |
| `business_regions` | `string[]` | No | Regions where the business operates. Defaults to `["usa_and_canada"]`. |
| `street_address` | `string` | Yes | Street address of the individual or business. |
| `street_address_2` | `string \| null` | No | — |
| `city` | `string` | Yes | City of the individual or business. |
| `state` | `string` | Yes | US state abbreviation (e.g. `CA`, `NY`). |
| `zip_code` | `string` | Yes | ZIP code (e.g. `94105`). |
| `country` | `string` | No | Country code for the registration address. See the request schema and registration form for accepted values. |
| `planned_numbers` | `number` | No | Number of phone numbers you plan to use. Defaults to `1`. `sole_proprietor` campaigns are limited to 1 number. |
| `description` | `string` | Yes | What your business does, who you message, and what types of messages you send. 40-4096 characters. |
| `use_cases` | `(account_notification \| customer_care \| delivery_notification \| fraud_alert \| higher_education \| marketing \| polling_voting \| public_service_announcement \| security_alert \| two_factor_authentication)[]` | Yes | 1-5 specific use cases: `customer_care`, `account_notification`, `delivery_notification`, `fraud_alert`, `higher_education`, `marketing`, `polling_voting`, `public_service_announcement`, `security_alert`, `two_factor_authentication`. |
| `volume` | `low \| high` | No | — |
| `message_samples` | `string[]` | Yes | 2-5 example messages you would send. Each 20-1024 chars, include your brand name. Include opt-out language like 'Reply STOP to unsubscribe' in at least one. |
| `consent_flow` | `string` | Yes | How users opt in to receive messages. 40-4096 characters. |
| `privacy_policy_url` | `string \| null` | No | URL to your privacy policy. Required for `standard_brand` and `high_volume`. |
| `terms_of_service_url` | `string \| null` | No | URL to your terms of service. Required for `standard_brand` and `high_volume`. |
| `opt_in_image_url` | `string` | Yes | Publicly accessible HTTPS URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB). Google Drive sharing links are supported. |
| `includes` | `(links \| phone_numbers \| age_gated \| direct_lending)[]` | No | Content types in messages: `links`, `phone_numbers`, `age_gated`, `direct_lending`. Defaults to `[]`. |
| `link_sample` | `string \| null` | No | Example URL if messages contain links. Max 255 characters. |
| `create_sub_account` | `boolean` | No | Create a dedicated sub-account for this campaign. Defaults to `true`. Set `false` to register on your main account. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `message` | `string \| null` | No | — |
| `campaign_status` | `string \| null` | No | — |
| `sub_account_id` | `string \| null \| null` | No | — |
| `fee_cents` | `number \| null` | No | — |

***

### update

`registration.update`

Update an existing A2P 10DLC registration.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.registration.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `first_name` | `string \| null` | No | Contact first name. |
| `last_name` | `string \| null` | No | Contact last name. |
| `email` | `string \| null` | No | Contact email address. |
| `phone_number` | `string \| null` | No | E.164 format, e.g. +15551234567 |
| `business_name` | `string \| null` | No | Legal/registered business name. |
| `brand_name` | `string \| null` | No | Public-facing brand name if different from business\_name. |
| `organization_type` | `sole_proprietor \| private_corporation \| public_corporation \| llc \| partnership \| non_profit \| co_op \| government \| null` | No | Organization type. |
| `contact_title` | `ceo \| cfo \| cto \| coo \| vp \| gm \| director \| other \| null` | No | Your role. |
| `contact_title_other` | `string \| null` | No | Custom title when contact\_title is 'other'. |
| `ein` | `string \| null` | No | EIN / Tax ID. |
| `website_url` | `string \| null` | No | — |
| `industry` | `string \| null` | No | e.g. technology, real\_estate, retail, healthcare |
| `business_regions` | `string[] \| null` | No | e.g. \['usa\_and\_canada'] |
| `street_address` | `string \| null` | No | Street address line 1. |
| `street_address_2` | `string \| null` | No | Street address line 2 (suite, unit, etc.). |
| `city` | `string \| null` | No | City. |
| `state` | `string \| null` | No | State/region code. |
| `zip_code` | `string \| null` | No | Postal/ZIP code. |
| `country` | `string \| null` | No | Country code, e.g. US. |
| `description` | `string \| null` | No | What your business does, who you message, and what types of messages you send. Min 40 chars. |
| `use_cases` | `(account_notification \| customer_care \| delivery_notification \| fraud_alert \| higher_education \| marketing \| polling_voting \| public_service_announcement \| security_alert \| two_factor_authentication)[] \| null` | No | 1-5 specific use cases for your SMS campaign. |
| `volume` | `low \| high \| null` | No | Expected message volume. |
| `message_samples` | `string[] \| null` | No | 2-5 example messages. Each must be 20-1024 chars and include your brand name. |
| `consent_flow` | `string \| null` | No | How users opt in to receive messages. Min 40 chars. |
| `privacy_policy_url` | `string \| null` | No | — |
| `terms_of_service_url` | `string \| null` | No | — |
| `opt_in_image_url` | `string \| null` | No | Publicly accessible URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB) |
| `includes` | `(links \| phone_numbers \| age_gated \| direct_lending)[] \| null` | No | Content types included in messages. |
| `link_sample` | `string \| null` | No | Example URL if messages contain links. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `message` | `string \| null` | No | — |
| `campaign_status` | `string \| null` | No | — |
| `updated_fields` | `string[] \| null` | No | — |
| `sub_account_id` | `string \| null \| null` | No | Set when the update was applied to a registration on a sub-account of the calling account (the default for POST /v1/register). |

***

## Sip Trunks

### create

`sipTrunks.create`

Create a SIP trunk for routing your numbers' calls to your own SIP infrastructure.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.sipTrunks.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `name` | `string` | Yes | Display name. |
| `provider` | `string` | No | Omit for a standard trunk; the account's telephony configuration determines the backing carrier. Send "imessage" to create a trunk for iMessage numbers instead (requires enablement). |
| `encrypted` | `boolean` | No | TLS signaling + SRTP media. Disabling it is supported only on some account configurations; iMessage-number trunks are always encrypted. |
| `transfers` | `all \| sip \| none` | No | Which transfers the trunk allows. |
| `transfer_caller_id` | `transferee \| transferor` | No | Alias of "transfer\_caller\_id"; send one or the other. |
| `transferCallerId` | `transferee \| transferor` | No | Alias of "transfer\_caller\_id"; send one or the other. |
| `origination` | `object \| null` | No | Where inbound calls to this trunk are delivered. Can also be set later via PATCH. iMessage-number trunks accept at most one URI. |

> [accordion] origination full type
>
> ```ts theme={null}
> {
>   uris?: {
>     name: string,
>     sip_uri: string,
>     priority?: number | null,
>     weight?: number | null
>   }[] | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `encrypted` | `boolean \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `mediaEncryption` | `string \| null` | No | — |
| `transfers` | `string \| null` | No | — |
| `transferCallerId` | `string \| null` | No | — |
| `terminationSipUri` | `string \| null` | No | — |
| `originationUris` | `object[] \| null` | No | — |
| `allowedIps` | `object[] \| null` | No | — |
| `proxyIps` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `credentials` | `object[] \| null` | No | — |

> [accordion] originationUris full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   sip_uri?: string | null,
>   priority?: number | null,
>   weight?: number | null
> }[] | null
> ```

> [accordion] allowedIps full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   cidr?: string | null
> }[] | null
> ```

> [accordion] credentials full type
>
> ```ts theme={null}
> {
>   username?: string | null,
>   password?: string | null | null,
>   passwordLast4?: string | null | null,
>   credentialListName?: string | null | null
> }[] | null | null
> ```

***

### delete

`sipTrunks.delete`

Delete a SIP trunk (removes upstream and soft-deletes locally).

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.sipTrunks.delete({ trunkId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `trunkId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |

***

### get

`sipTrunks.get`

Get a single SIP trunk.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.sipTrunks.get({ trunkId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `trunkId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `encrypted` | `boolean \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `mediaEncryption` | `string \| null` | No | — |
| `transfers` | `string \| null` | No | — |
| `transferCallerId` | `string \| null` | No | — |
| `terminationSipUri` | `string \| null` | No | — |
| `originationUris` | `object[] \| null` | No | — |
| `allowedIps` | `object[] \| null` | No | — |
| `proxyIps` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `credentials` | `object[] \| null` | No | — |

> [accordion] originationUris full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   sip_uri?: string | null,
>   priority?: number | null,
>   weight?: number | null
> }[] | null
> ```

> [accordion] allowedIps full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   cidr?: string | null
> }[] | null
> ```

> [accordion] credentials full type
>
> ```ts theme={null}
> {
>   username?: string | null,
>   password?: string | null | null,
>   passwordLast4?: string | null | null,
>   credentialListName?: string | null | null
> }[] | null | null
> ```

***

### list

`sipTrunks.list`

List SIP trunks for the current account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.sipTrunks.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   provider?: string | null,
>   encrypted?: boolean | null,
>   transport?: string | null,
>   mediaEncryption?: string | null,
>   transfers?: string | null,
>   transferCallerId?: string | null,
>   terminationSipUri?: string | null,
>   originationUris?: {
>     name?: string | null,
>     sip_uri?: string | null,
>     priority?: number | null,
>     weight?: number | null
>   }[] | null,
>   allowedIps?: {
>     name?: string | null,
>     cidr?: string | null
>   }[] | null,
>   proxyIps?: string[] | null,
>   createdAt?: string | null,
>   credentials?: {
>     username?: string | null,
>     password?: string | null | null,
>     passwordLast4?: string | null | null,
>     credentialListName?: string | null | null
>   }[] | null | null
> }[] | null
> ```

***

### update

`sipTrunks.update`

Update a SIP trunk (name, transfers, origination URIs).

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.sipTrunks.update({ trunkId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `trunkId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `name` | `string` | No | Display name. |
| `transfers` | `all \| sip \| none` | No | Which transfers the trunk allows. |
| `transfer_caller_id` | `transferee \| transferor` | No | Alias of "transfer\_caller\_id"; send one or the other. |
| `transferCallerId` | `transferee \| transferor` | No | Alias of "transfer\_caller\_id"; send one or the other. |
| `origination` | `object` | No | Where inbound calls to this trunk are delivered. |
| `originationUris` | `object[]` | No | Alias of "origination.uris" matching the shape responses use, so the list a GET returns can be sent back as-is. Send either this or "origination", not both. iMessage-number trunks accept at most one URI. |

> [accordion] origination full type
>
> ```ts theme={null}
> {
>   uris?: {
>     sip_uri: string,
>     name?: string,
>     priority?: number | null,
>     weight?: number | null
>   }[]
> }
> ```

> [accordion] originationUris full type
>
> ```ts theme={null}
> {
>   sip_uri: string,
>   name?: string,
>   priority?: number | null,
>   weight?: number | null
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `encrypted` | `boolean \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `mediaEncryption` | `string \| null` | No | — |
| `transfers` | `string \| null` | No | — |
| `transferCallerId` | `string \| null` | No | — |
| `terminationSipUri` | `string \| null` | No | — |
| `originationUris` | `object[] \| null` | No | — |
| `allowedIps` | `object[] \| null` | No | — |
| `proxyIps` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `credentials` | `object[] \| null` | No | — |

> [accordion] originationUris full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   sip_uri?: string | null,
>   priority?: number | null,
>   weight?: number | null
> }[] | null
> ```

> [accordion] allowedIps full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   cidr?: string | null
> }[] | null
> ```

> [accordion] credentials full type
>
> ```ts theme={null}
> {
>   username?: string | null,
>   password?: string | null | null,
>   passwordLast4?: string | null | null,
>   credentialListName?: string | null | null
> }[] | null | null
> ```

***

## Sub Accounts

### create

`subAccounts.create`

Create Sub Account.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.subAccounts.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `name` | `string` | Yes | — |

**Output:** `any`

***

### delete

`subAccounts.delete`

Delete Sub Account.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.subAccounts.delete({ sub_account_id: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sub_account_id` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### list

`subAccounts.list`

List Sub Accounts.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.subAccounts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number \| null` | No | — |
| `offset` | `number` | No | — |
| `stats_days` | `number \| null` | No | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### update

`subAccounts.update`

Update Sub Account.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.subAccounts.update({ sub_account_id: '123e4567-e89b-42d3-a456-426614174000', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sub_account_id` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `name` | `string` | Yes | — |

**Output:** `any`

***

## Usage

### get

`usage.get`

Get usage statistics for the current account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.usage.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reportGeneratedAt` | `string \| null` | No | — |
| `numbers` | `object \| null` | No | — |
| `stats` | `object \| null` | No | — |
| `periodStart` | `string \| null` | No | — |
| `periodEnd` | `string \| null` | No | — |

> [accordion] numbers full type
>
> ```ts theme={null}
> {
>   used?: number | null,
>   limit?: number | null,
>   remaining?: number | null
> } | null
> ```

> [accordion] stats full type
>
> ```ts theme={null}
> {
>   totalMessages?: number | null,
>   messagesLast24h?: number | null,
>   messagesLast7d?: number | null,
>   messagesLast30d?: number | null,
>   smsSegmentsLast30d?: number | null,
>   totalCalls?: number | null,
>   callsLast24h?: number | null,
>   callsLast7d?: number | null,
>   callsLast30d?: number | null,
>   totalWebhookDeliveries?: number | null,
>   successfulWebhookDeliveries?: number | null,
>   failedWebhookDeliveries?: number | null
> } | null
> ```

***

### getByAgent

`usage.getByAgent`

Get Usage By Agent.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.usage.getByAgent({ period: 'week' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `period` | `week \| month \| year` | Yes | — |
| `tz` | `string \| null` | No | IANA timezone, e.g. America/New\_York |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reportGeneratedAt` | `string \| null` | No | — |
| `data` | `object[] \| null` | No | — |
| `period` | `string \| null` | No | — |
| `periodStart` | `string \| null` | No | — |
| `periodEnd` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   agentId?: string | null | null,
>   agentName?: string | null,
>   messages?: number | null,
>   calls?: number | null,
>   totalSeconds?: number | null,
>   isOrphan?: boolean | null
> }[] | null
> ```

***

### getByNumber

`usage.getByNumber`

Get usage statistics broken down by phone number, with linked agent info.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.usage.getByNumber({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reportGeneratedAt` | `string \| null` | No | — |
| `data` | `object[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   numberId?: string | null,
>   phoneNumber?: string | null,
>   country?: string | null,
>   status?: string | null,
>   agentId?: string | null | null,
>   agentName?: string | null | null,
>   messages?: number | null,
>   calls?: number | null
> }[] | null
> ```

***

### getDaily

`usage.getDaily`

Get daily usage breakdown for the last N days (up to 365). Returns per-day counts of messages, calls, and webhook deliveries.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.usage.getDaily({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `days` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reportGeneratedAt` | `string \| null` | No | — |
| `data` | `object[] \| null` | No | — |
| `days` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   messages?: number | null,
>   calls?: number | null,
>   webhooks?: number | null
> }[] | null
> ```

***

### getMonthly

`usage.getMonthly`

Get monthly usage aggregation for the last N months. Returns per-month totals of messages, calls, and webhook deliveries.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.usage.getMonthly({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `months` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reportGeneratedAt` | `string \| null` | No | — |
| `data` | `object[] \| null` | No | — |
| `months` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   month?: string | null,
>   messages?: number | null,
>   calls?: number | null,
>   webhooks?: number | null
> }[] | null
> ```

***

## Verification

### check

`verification.check`

Check a code for a challenge created with verification.send.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.verification.check({ verification_id: 'example', code: '123456' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `verification_id` | `string` | Yes | Verification ID returned from /v1/verify/send |
| `code` | `string` | Yes | 6-digit verification code |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `result` | `string \| null` | No | One of `ok`, `incorrect`, `exhausted`, `expired`, or `already_verified`. |
| `attempts_remaining` | `number \| null \| null` | No | Checks left before the verification is exhausted. 0 once it reaches a final state. |

***

### send

`verification.send`

Start an AgentPhone Verify challenge for a recipient who has requested verification.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.verification.send({ phone_number: '+12025550101' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `phone_number` | `string` | Yes | Phone number in E.164 format (e.g. +639277372243) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `verification_id` | `string \| null` | No | Pass this to POST /v1/verify/check along with the code the user entered. |
| `status` | `string \| null` | No | Verification status. `pending` until the code is checked. |

***

## Webhooks

### delete

`webhooks.delete`

Remove the master webhook for this account.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.webhooks.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### get

`webhooks.get`

Get the master webhook configuration for this account.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.webhooks.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `secret` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `contextLimit` | `number \| null` | No | — |
| `timeout` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***

### getAllTimeStats

`webhooks.getAllTimeStats`

Lightweight all-time delivery counts using indexed COUNT queries.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.webhooks.getAllTimeStats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `total` | `number \| null` | No | — |
| `success` | `number \| null` | No | — |
| `failed` | `number \| null` | No | — |
| `successRate` | `number \| null` | No | — |

***

### getDeliveryStats

`webhooks.getDeliveryStats`

Aggregated delivery stats for the account's webhooks over the last N hours.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.webhooks.getDeliveryStats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `hours` | `number` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `total` | `number \| null` | No | — |
| `success` | `number \| null` | No | — |
| `failed` | `number \| null` | No | — |
| `pending` | `number \| null` | No | — |
| `successRate` | `number \| null` | No | — |
| `byEventType` | `Record<string, Record<string, number>> \| null` | No | — |
| `byHour` | `object[] \| null` | No | — |

> [accordion] byHour full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### listDeliveries

`webhooks.listDeliveries`

Get paginated webhook delivery attempts for all account webhooks.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.webhooks.listDeliveries({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `hours` | `number \| null` | No | — |
| `subAccountId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `total` | `number \| null` | No | — |
| `offset` | `number \| null` | No | — |
| `limit` | `number \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   messageId?: string | null | null,
>   eventType?: string | null | null,
>   channel?: string | null | null,
>   status?: string | null,
>   httpStatus?: number | null | null,
>   errorMessage?: string | null | null,
>   responseBody?: string | null | null,
>   attemptCount?: number | null,
>   lastAttemptAt?: string | null | null,
>   nextRetryAt?: string | null | null,
>   createdAt?: string | null
> }[] | null
> ```

***

### test

`webhooks.test`

Send a test webhook to verify the endpoint is working.

**Risk:** `destructive`

```ts theme={null}
await corsair.agentphone.api.webhooks.test({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string \| null` | No | Agent ID to include in the test payload |
| `subAccountId` | `string` | No | — |
| `payload` | `object \| null` | No | Optional overrides for the synthetic agent.message a test delivery carries. Everything is optional and defaults to the historical sample values, so a bare POST behaves exactly as before. Overrides let a handler that routes on `to` / `from` (one webhook serving many sub-accounts) exercise its real path without buying a number first. The event only ever goes to the calling account's own configured webhook, so `to` is just a string here. |

> [accordion] payload full type
>
> ```ts theme={null}
> {
>   from?: string | null,
>   to?: string | null,
>   message?: string | null,
>   channel?: sms | imessage | mms | whatsapp | rcs | null
> } | null
> ```

**Output:** `any`

***

### upsert

`webhooks.upsert`

Save the account-level webhook. Store the signing secret returned by AgentPhone and update the webhook handler whenever the secret changes.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.webhooks.upsert({ url: 'https://example.com/hooks/agentphone' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `url` | `string` | Yes | — |
| `contextLimit` | `number \| null` | No | — |
| `timeout` | `number \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `secret` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `contextLimit` | `number \| null` | No | — |
| `timeout` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***

## Whatsapp

### connect

`whatsapp.connect`

Complete Embedded Signup: exchange the code, store the connection, and onboard the phone number (register + subscribe webhooks).

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.whatsapp.connect({ code: '123456' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |
| `code` | `string` | Yes | Exchangeable token code from Embedded Signup |
| `waba_id` | `string \| null` | No | Customer WABA ID from the ES message event. Optional: when the browser handoff is blocked we discover it from the exchanged token. |
| `phone_number_id` | `string \| null` | No | Customer business phone number ID (absent for WABA-only signups) |
| `business_id` | `string \| null` | No | Customer business portfolio ID |
| `agent_id` | `string \| null` | No | Optional agent to attach the number to |

**Output:** `any`

***

### connectNumber

`whatsapp.connectNumber`

Connect an additional number from an already-connected WABA: validates the number belongs to the WABA, registers it for Cloud API use, and binds it (dual-channel when the E.164 already exists on this account).

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.whatsapp.connectNumber({ connectionId: '123e4567-e89b-42d3-a456-426614174000', phone_number_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `phone_number_id` | `string` | Yes | Meta phone\_number\_id of a number on this WABA |
| `agentId` | `string \| null` | No | Optional agent to attach the number to |

**Output:** `any`

***

### createTemplate

`whatsapp.createTemplate`

Submit a template, authored or from Meta's Template Library.

**Risk:** `write`

```ts theme={null}
await corsair.agentphone.api.whatsapp.createTemplate({
	connectionId: '123e4567-e89b-42d3-a456-426614174000',
	name: 'order_status_update',
	category: 'UTILITY',
	components: [{
		type: 'BODY',
		text: 'Your order {{1}} is ready for pickup.',
		example: {
			body_text: [['1042']],
		},
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |
| `name` | `string` | Yes | Template name. Meta requires lowercase letters, digits and underscores, and it must be unique on the WABA. |
| `language` | `string` | No | Meta language code, e.g. en\_US or es\_MX. |
| `category` | `string` | Yes | MARKETING, UTILITY, or AUTHENTICATION. Meta may recategorize based on the content. |
| `parameter_format` | `string \| null` | No | How the body's placeholders are written: POSITIONAL for \{\{1}}, \{\{2}} or NAMED for \{\{first\_name}}. Omit for Meta's default, POSITIONAL. A template's format also dictates the shape you must send: positional templates take an array of variables, named templates take an object keyed by parameter name. |
| `components` | `object[] \| null` | No | Meta's component array, passed through as given. Must include a BODY. Required unless `library_template_name` is set, which supplies its own. Positional: \[\{"type": "BODY", "text": "Your order \{\{1}} has shipped.", "example": \{"body\_text": \[\["1234"]]}}]. Named: \[\{"type": "BODY", "text": "Thanks \{\{first\_name}}!", "example": \{"body\_text\_named\_params": \[\{"param\_name": "first\_name", "example": "Pablo"}]}}]. Components containing variables require an `example` or Meta rejects the submission. |
| `library_template_name` | `string \| null` | No | Build from Meta's Template Library instead of authoring one. Use the library entry's slug, e.g. "appointment\_confirmation\_1" (visible under each card in WhatsApp Manager > Template library). A library template used unchanged skips Meta's review and is usable immediately, so this is the fastest route to a sendable template. Omit `components` when using it. |
| `library_template_button_inputs` | `object[] \| null` | No | Library templates only: fills in the buttons the library entry ships with. Each entry takes \{"type", "phone\_number", "url", "otp\_type", "zero\_tap\_terms\_accepted", "supported\_apps"} as the button requires — a URL button needs your url, a CALL button your phone number. |
| `library_template_body_inputs` | `object \| null` | No | Library templates only: toggles the optional body lines a library entry offers. \{"add\_contact\_number", "add\_learn\_more\_link", "add\_security\_recommendation", "add\_track\_package\_link", "code\_expiration\_minutes"}. |

> [accordion] components full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] library\_template\_button\_inputs full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] library\_template\_body\_inputs full type
>
> ```ts theme={null}
> {
> } | null
> ```

**Output:** `any`

***

### deleteTemplate

`whatsapp.deleteTemplate`

Delete a template by name.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.whatsapp.deleteTemplate({ connectionId: '123e4567-e89b-42d3-a456-426614174000', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `name` | `string` | Yes | Template name to delete. |
| `hsm_id` | `string \| null` | No | Optional template id. Narrows the delete to that single language version instead of every variant under the name. Meta requires `name` alongside it. |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### disconnect

`whatsapp.disconnect`

Disconnect a WABA: mark the connection disconnected and release its numbers.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.agentphone.api.whatsapp.disconnect({ connectionId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### getStatus

`whatsapp.getStatus`

Whatsapp Status.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.whatsapp.getStatus({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### listAvailableNumbers

`whatsapp.listAvailableNumbers`

Whatsapp Available Numbers.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.whatsapp.listAvailableNumbers({ connectionId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***

### listTemplates

`whatsapp.listTemplates`

List the WABA's message templates and their approval status.

**Risk:** `read`

```ts theme={null}
await corsair.agentphone.api.whatsapp.listTemplates({ connectionId: '123e4567-e89b-42d3-a456-426614174000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `name` | `string \| null` | No | Filter to one template name (all of its language variants). |
| `status` | `string \| null` | No | Filter by approval status, e.g. APPROVED or PENDING. |
| `category` | `string \| null` | No | Filter by category: MARKETING, UTILITY, or AUTHENTICATION. |
| `language` | `string \| null` | No | Filter by language code, e.g. en\_US. |
| `subAccountId` | `string` | No | — |

**Output:** `any`

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.