> ## 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.

# Callingly API reference

> API reference for the Callingly plugin in Corsair: every `callingly.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

### create

`agents.create`

Register a new agent in Callingly

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.agents.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `fname` | `string` | Yes | — |
| `lname` | `string` | Yes | — |
| `phone_number` | `string` | Yes | — |
| `ext` | `string` | No | — |
| `timezone` | `string` | No | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | No | — |
| `fname` | `string` | No | — |
| `lname` | `string` | No | — |
| `email` | `string \| null` | No | — |
| `phone_number` | `string` | No | — |
| `ext` | `string \| null` | No | — |
| `on_call_id` | `string \| number \| null` | No | — |
| `custom_id` | `string \| number \| null` | No | — |
| `fub_id` | `string \| number \| null` | No | — |
| `hubspot_id` | `string \| number \| null` | No | — |
| `donotdisturb` | `boolean \| number` | No | — |
| `donotdisturb_until` | `string \| null` | No | — |
| `priority` | `number` | No | — |
| `timezone` | `string` | No | — |
| `is_available` | `boolean` | No | — |

***

### delete

`agents.delete`

Permanently delete an agent from a Callingly account

**Risk:** `destructive`

```ts theme={null}
await corsair.callingly.api.agents.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | No | — |
| `message` | `string` | No | — |

***

### getSchedule

`agents.getSchedule`

Retrieve the availability schedule for a specific agent

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.agents.getSchedule({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   label?: string,
>   day: number,
>   is_available: boolean,
>   times: {
>     start: string,
>     end: string
>   }[]
> }[]
> ```

***

### list

`agents.list`

List all agents and users under the account

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `count` | `number` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   account_id?: string | number,
>   name?: string,
>   fname?: string,
>   lname?: string,
>   email?: string | null,
>   phone_number?: string,
>   ext?: string | null,
>   on_call_id?: string | number | null,
>   custom_id?: string | number | null,
>   fub_id?: string | number | null,
>   hubspot_id?: string | number | null,
>   donotdisturb?: boolean | number,
>   donotdisturb_until?: string | null,
>   priority?: number,
>   timezone?: string,
>   is_available?: boolean
> }[]
> ```

***

### update

`agents.update`

Update agent information

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.agents.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string \| number` | Yes | — |
| `fname` | `string` | No | — |
| `lname` | `string` | No | — |
| `phone_number` | `string` | No | — |
| `ext` | `string` | No | — |
| `timezone` | `string` | No | — |
| `donotdisturb` | `0 \| 1` | No | — |
| `donotdisturb_until` | `string` | No | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | No | — |
| `fname` | `string` | No | — |
| `lname` | `string` | No | — |
| `email` | `string \| null` | No | — |
| `phone_number` | `string` | No | — |
| `ext` | `string \| null` | No | — |
| `on_call_id` | `string \| number \| null` | No | — |
| `custom_id` | `string \| number \| null` | No | — |
| `fub_id` | `string \| number \| null` | No | — |
| `hubspot_id` | `string \| number \| null` | No | — |
| `donotdisturb` | `boolean \| number` | No | — |
| `donotdisturb_until` | `string \| null` | No | — |
| `priority` | `number` | No | — |
| `timezone` | `string` | No | — |
| `is_available` | `boolean` | No | — |

***

### updateSchedule

`agents.updateSchedule`

Update an agent availability schedule

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.agents.updateSchedule({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string \| number` | Yes | — |
| `days` | `object[]` | Yes | — |
| `account_id` | `string \| number` | No | — |

> [accordion] days full type
>
> ```ts theme={null}
> {
>   label?: string,
>   day: number,
>   is_available: boolean,
>   times: {
>     start: string,
>     end: string
>   }[]
> }[]
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   label?: string,
>   day: number,
>   is_available: boolean,
>   times: {
>     start: string,
>     end: string
>   }[]
> }[]
> ```

***

## Calls

### create

`calls.create`

Initiate or trigger a new call to a lead

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.calls.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `team_id` | `string \| number` | Yes | — |
| `phone_number` | `string` | Yes | — |
| `first_name` | `string` | No | — |
| `last_name` | `string` | No | — |
| `email` | `string` | No | — |
| `company` | `string` | No | — |
| `category` | `string` | No | — |
| `source` | `string` | No | — |
| `crm_id` | `string \| number` | No | — |
| `scheduled_at` | `string` | No | Schedule the call instead of dialing now (YYYY-MM-DD HH:MM:SS) |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | No | — |
| `started_at` | `string` | No | — |
| `direction` | `string` | No | — |
| `status` | `string \| null` | No | — |
| `status_formatted` | `string` | No | — |
| `lead_status` | `string \| null` | No | — |
| `lead_status_formatted` | `string` | No | — |
| `ring_status` | `string` | No | — |
| `seconds` | `number` | No | — |
| `duration` | `string` | No | — |
| `retry` | `number` | No | — |
| `lead_retry` | `number` | No | — |
| `time_formatted` | `string` | No | — |
| `from_formatted` | `string` | No | — |
| `source` | `string \| null` | No | — |
| `recording_url` | `string \| null` | No | — |
| `waveform_url` | `string \| null` | No | — |
| `error_message` | `string \| null` | No | — |
| `phone_number_formatted` | `string` | No | — |
| `human_result` | `string \| null` | No | — |
| `user` | `object \| never[] \| null` | No | — |
| `member` | `object \| never[] \| null` | No | — |
| `lead` | `object \| never[] \| null` | No | — |
| `profile` | `object \| never[] \| null` | No | — |
| `is_voicemail` | `number` | No | — |
| `is_queue` | `number` | No | — |
| `is_team_offline` | `number` | No | — |
| `scheduled_call_type` | `string \| null` | No | — |
| `old_lead_owner_id` | `string \| number \| null` | No | — |
| `transcript` | `string \| null` | No | — |
| `is_error` | `number` | No | — |
| `error_code` | `string` | No | — |
| `call_id` | `string \| number` | No | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string,
>   fname?: string,
>   lname?: string,
>   email?: string,
>   phone_number?: string
> } | never[] | null
> ```

> [accordion] member full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string,
>   fname?: string,
>   lname?: string,
>   email?: string,
>   phone_number?: string
> } | never[] | null
> ```

> [accordion] lead full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string | null,
>   label?: string | null,
>   fname?: string | null,
>   lname?: string | null,
>   email?: string | null,
>   phone_number?: string | null,
>   phone_number_formatted?: string | null,
>   source?: string | null,
>   crm?: string | null,
>   source_id?: string | number | null,
>   deleted_at?: string | null
> } | never[] | null
> ```

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

***

### get

`calls.get`

Retrieve call details, duration, and recording by ID

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.calls.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `callId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `started_at` | `string` | No | — |
| `direction` | `string` | No | — |
| `status` | `string \| null` | No | — |
| `status_formatted` | `string` | No | — |
| `lead_status` | `string \| null` | No | — |
| `lead_status_formatted` | `string` | No | — |
| `ring_status` | `string` | No | — |
| `seconds` | `number` | No | — |
| `duration` | `string` | No | — |
| `retry` | `number` | No | — |
| `lead_retry` | `number` | No | — |
| `time_formatted` | `string` | No | — |
| `from_formatted` | `string` | No | — |
| `source` | `string \| null` | No | — |
| `recording_url` | `string \| null` | No | — |
| `waveform_url` | `string \| null` | No | — |
| `error_message` | `string \| null` | No | — |
| `phone_number_formatted` | `string` | No | — |
| `human_result` | `string \| null` | No | — |
| `user` | `object \| never[] \| null` | No | — |
| `member` | `object \| never[] \| null` | No | — |
| `lead` | `object \| never[] \| null` | No | — |
| `profile` | `object \| never[] \| null` | No | — |
| `is_voicemail` | `number` | No | — |
| `is_queue` | `number` | No | — |
| `is_team_offline` | `number` | No | — |
| `scheduled_call_type` | `string \| null` | No | — |
| `old_lead_owner_id` | `string \| number \| null` | No | — |
| `transcript` | `string \| null` | No | — |
| `is_error` | `number` | No | — |
| `error_code` | `string` | No | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string,
>   fname?: string,
>   lname?: string,
>   email?: string,
>   phone_number?: string
> } | never[] | null
> ```

> [accordion] member full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string,
>   fname?: string,
>   lname?: string,
>   email?: string,
>   phone_number?: string
> } | never[] | null
> ```

> [accordion] lead full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string | null,
>   label?: string | null,
>   fname?: string | null,
>   lname?: string | null,
>   email?: string | null,
>   phone_number?: string | null,
>   phone_number_formatted?: string | null,
>   source?: string | null,
>   crm?: string | null,
>   source_id?: string | number | null,
>   deleted_at?: string | null
> } | never[] | null
> ```

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

***

### list

`calls.list`

List call history with optional date range, team, and paging filters

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start` | `string` | No | — |
| `end` | `string` | No | — |
| `team_id` | `string \| number` | No | — |
| `limit` | `number` | No | — |
| `page` | `number` | No | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   started_at?: string,
>   direction?: string,
>   status?: string | null,
>   status_formatted?: string,
>   lead_status?: string | null,
>   lead_status_formatted?: string,
>   ring_status?: string,
>   seconds?: number,
>   duration?: string,
>   retry?: number,
>   lead_retry?: number,
>   time_formatted?: string,
>   from_formatted?: string,
>   source?: string | null,
>   recording_url?: string | null,
>   waveform_url?: string | null,
>   error_message?: string | null,
>   phone_number_formatted?: string,
>   human_result?: string | null,
>   user?: {
>     id: string | number,
>     name?: string,
>     fname?: string,
>     lname?: string,
>     email?: string,
>     phone_number?: string
>   } | never[] | null,
>   member?: {
>     id: string | number,
>     name?: string,
>     fname?: string,
>     lname?: string,
>     email?: string,
>     phone_number?: string
>   } | never[] | null,
>   lead?: {
>     id: string | number,
>     name?: string | null,
>     label?: string | null,
>     fname?: string | null,
>     lname?: string | null,
>     email?: string | null,
>     phone_number?: string | null,
>     phone_number_formatted?: string | null,
>     source?: string | null,
>     crm?: string | null,
>     source_id?: string | number | null,
>     deleted_at?: string | null
>   } | never[] | null,
>   profile?: {
>     id?: string | number,
>     name?: string
>   } | never[] | null,
>   is_voicemail?: number,
>   is_queue?: number,
>   is_team_offline?: number,
>   scheduled_call_type?: string | null,
>   old_lead_owner_id?: string | number | null,
>   transcript?: string | null,
>   is_error?: number,
>   error_code?: string
> }[]
> ```

***

## Clients

### activateDeactivate

`clients.activateDeactivate`

Activate or deactivate a client account

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.clients.activateDeactivate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `clientId` | `string \| number` | Yes | — |
| `is_active` | `0 \| 1` | Yes | 1 activates calling for the client, 0 deactivates it |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | No | — |
| `message` | `string` | No | — |

***

### create

`clients.create`

Create a new agency client account

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.clients.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `fname` | `string` | Yes | — |
| `lname` | `string` | Yes | — |
| `company` | `string` | Yes | — |
| `email` | `string` | Yes | — |
| `phone_number` | `string` | Yes | — |
| `password` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `name` | `string` | No | — |
| `email` | `string` | No | — |
| `billing_email` | `string` | No | — |
| `is_active` | `boolean \| number` | No | — |
| `billed_users` | `number` | No | — |
| `billed_numbers` | `number` | No | — |

***

### delete

`clients.delete`

Delete an agency client account by ID

**Risk:** `destructive`

```ts theme={null}
await corsair.callingly.api.clients.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `clientId` | `string \| number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | No | — |
| `message` | `string` | No | — |

***

### list

`clients.list`

List agency client accounts

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.clients.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string,
>   email?: string,
>   billing_email?: string,
>   is_active?: boolean | number,
>   billed_users?: number,
>   billed_numbers?: number
> }[]
> ```

***

## Leads

### delete

`leads.delete`

Delete a lead by ID

**Risk:** `destructive`

```ts theme={null}
await corsair.callingly.api.leads.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `leadId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | No | — |
| `message` | `string` | No | — |

***

### get

`leads.get`

Retrieve lead details by ID

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.leads.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `leadId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `lead_owner_id` | `string \| number \| null` | No | — |
| `fname` | `string \| null` | No | — |
| `lname` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `phone_number` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `source_id` | `string \| number \| null` | No | — |
| `created_at` | `string` | No | — |
| `company` | `string \| null` | No | — |
| `category` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `result` | `string \| null` | No | — |
| `team` | `object \| null` | No | — |
| `tags` | `object[]` | No | — |
| `stage` | `string \| null` | No | — |
| `calls` | `object[]` | No | — |
| `scheduled_call_at` | `string \| null` | No | — |
| `lead_owner` | `object \| null` | No | — |
| `is_stopped` | `number` | No | — |
| `is_blocked` | `number` | No | — |

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

> [accordion] tags full type
>
> ```ts theme={null}
> (string | {
>   id?: string | number,
>   name?: string
> })[]
> ```

> [accordion] calls full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   source?: string | null,
>   seconds?: number,
>   direction?: string,
>   status?: string | null,
>   result?: string | null,
>   agent_retry?: number,
>   lead_retry?: number,
>   started_at?: string,
>   recording_url?: string | null
> }[]
> ```

> [accordion] lead\_owner full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   phone_number?: string | null,
>   custom_id?: string | number | null
> } | null
> ```

***

### list

`leads.list`

List leads with optional date range and phone number filters

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.leads.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start` | `string` | No | — |
| `end` | `string` | No | — |
| `phone_number` | `string` | No | — |
| `account_id` | `string \| number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   account_id?: string | number,
>   lead_owner_id?: string | number | null,
>   fname?: string | null,
>   lname?: string | null,
>   email?: string | null,
>   phone_number?: string | null,
>   source?: string | null,
>   source_id?: string | number | null,
>   created_at?: string,
>   company?: string | null,
>   category?: string | null,
>   status?: string | null,
>   result?: string | null,
>   team?: {
>     id?: string | number,
>     name?: string
>   } | null,
>   tags?: (string | {
>     id?: string | number,
>     name?: string
>   })[],
>   stage?: string | null,
>   calls?: {
>     id: string | number,
>     source?: string | null,
>     seconds?: number,
>     direction?: string,
>     status?: string | null,
>     result?: string | null,
>     agent_retry?: number,
>     lead_retry?: number,
>     started_at?: string,
>     recording_url?: string | null
>   }[],
>   scheduled_call_at?: string | null,
>   lead_owner?: {
>     name?: string | null,
>     phone_number?: string | null,
>     custom_id?: string | number | null
>   } | null,
>   is_stopped?: number,
>   is_blocked?: number
> }[]
> ```

***

### update

`leads.update`

Update lead contact details and assignments

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.leads.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `leadId` | `string \| number` | Yes | — |
| `fname` | `string` | No | — |
| `lname` | `string` | No | — |
| `email` | `string` | No | — |
| `phone_number` | `string` | No | — |
| `source` | `string` | No | — |
| `company` | `string` | No | — |
| `status` | `string` | No | — |
| `result` | `string \| null` | No | — |
| `stage` | `string \| null` | No | — |
| `is_stopped` | `0 \| 1` | No | — |
| `is_blocked` | `0 \| 1` | No | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `lead_owner_id` | `string \| number \| null` | No | — |
| `fname` | `string \| null` | No | — |
| `lname` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `phone_number` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `source_id` | `string \| number \| null` | No | — |
| `created_at` | `string` | No | — |
| `company` | `string \| null` | No | — |
| `category` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `result` | `string \| null` | No | — |
| `team` | `object \| null` | No | — |
| `tags` | `object[]` | No | — |
| `stage` | `string \| null` | No | — |
| `calls` | `object[]` | No | — |
| `scheduled_call_at` | `string \| null` | No | — |
| `lead_owner` | `object \| null` | No | — |
| `is_stopped` | `number` | No | — |
| `is_blocked` | `number` | No | — |

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

> [accordion] tags full type
>
> ```ts theme={null}
> (string | {
>   id?: string | number,
>   name?: string
> })[]
> ```

> [accordion] calls full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   source?: string | null,
>   seconds?: number,
>   direction?: string,
>   status?: string | null,
>   result?: string | null,
>   agent_retry?: number,
>   lead_retry?: number,
>   started_at?: string,
>   recording_url?: string | null
> }[]
> ```

> [accordion] lead\_owner full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   phone_number?: string | null,
>   custom_id?: string | number | null
> } | null
> ```

***

## Teams

### create

`teams.create`

Create a new team in Callingly

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.teams.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `is_record` | `0 \| 1` | No | — |
| `call_mode` | `string` | No | — |
| `whispertext` | `string` | No | — |
| `language` | `string` | No | — |
| `delay` | `number` | No | — |
| `is_retry` | `0 \| 1` | No | — |
| `retries` | `number` | No | — |
| `retry_schedule` | `number[]` | No | — |
| `is_reschedule` | `0 \| 1` | No | — |
| `is_retry_lead` | `0 \| 1` | No | — |
| `lead_retries` | `number` | No | — |
| `lead_retry_schedule` | `number[]` | No | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | Yes | — |
| `is_record` | `boolean \| number` | No | — |
| `call_mode` | `string` | No | — |
| `whispertext` | `string` | No | — |
| `post_whispertext` | `string` | No | — |
| `language` | `string` | No | — |
| `delay` | `number` | No | — |
| `is_retry` | `boolean \| number` | No | — |
| `retries` | `number` | No | — |
| `retry_schedule` | `object[]` | No | — |
| `is_reschedule` | `boolean \| number` | No | — |
| `is_retry_lead` | `boolean \| number` | No | — |
| `lead_retries` | `number` | No | — |
| `lead_retry_schedule` | `object[]` | No | — |
| `is_sms` | `boolean \| number` | No | — |
| `sms_body` | `string` | No | — |
| `whispertext_voice` | `string` | No | — |
| `is_users_available_for_call` | `boolean` | No | — |

> [accordion] retry\_schedule full type
>
> ```ts theme={null}
> (number | {
>   unit: string,
>   value: number
> })[]
> ```

> [accordion] lead\_retry\_schedule full type
>
> ```ts theme={null}
> (number | {
>   unit: string,
>   value: number
> })[]
> ```

***

### get

`teams.get`

Retrieve team details by ID

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.teams.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | Yes | — |
| `is_record` | `boolean \| number` | No | — |
| `call_mode` | `string` | No | — |
| `whispertext` | `string` | No | — |
| `post_whispertext` | `string` | No | — |
| `language` | `string` | No | — |
| `delay` | `number` | No | — |
| `is_retry` | `boolean \| number` | No | — |
| `retries` | `number` | No | — |
| `retry_schedule` | `object[]` | No | — |
| `is_reschedule` | `boolean \| number` | No | — |
| `is_retry_lead` | `boolean \| number` | No | — |
| `lead_retries` | `number` | No | — |
| `lead_retry_schedule` | `object[]` | No | — |
| `is_sms` | `boolean \| number` | No | — |
| `sms_body` | `string` | No | — |
| `whispertext_voice` | `string` | No | — |
| `is_users_available_for_call` | `boolean` | No | — |

> [accordion] retry\_schedule full type
>
> ```ts theme={null}
> (number | {
>   unit: string,
>   value: number
> })[]
> ```

> [accordion] lead\_retry\_schedule full type
>
> ```ts theme={null}
> (number | {
>   unit: string,
>   value: number
> })[]
> ```

***

### list

`teams.list`

List teams in the Callingly account

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.teams.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   account_id?: string | number,
>   name: string,
>   is_record?: boolean | number,
>   call_mode?: string,
>   whispertext?: string,
>   post_whispertext?: string,
>   language?: string,
>   delay?: number,
>   is_retry?: boolean | number,
>   retries?: number,
>   retry_schedule?: (number | {
>     unit: string,
>     value: number
>   })[],
>   is_reschedule?: boolean | number,
>   is_retry_lead?: boolean | number,
>   lead_retries?: number,
>   lead_retry_schedule?: (number | {
>     unit: string,
>     value: number
>   })[],
>   is_sms?: boolean | number,
>   sms_body?: string,
>   whispertext_voice?: string,
>   is_users_available_for_call?: boolean
> }[]
> ```

***

### listUsers

`teams.listUsers`

Retrieve all agents assigned to a specific team

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.teams.listUsers({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agents` | `object[]` | Yes | — |

> [accordion] agents full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   team_id?: string | number,
>   name?: string,
>   custom_id?: string | number | null,
>   fub_id?: string | number | null,
>   priority?: number,
>   cap?: number | null
> }[]
> ```

***

### removeAgent

`teams.removeAgent`

Remove a specific agent from a team

**Risk:** `destructive`

```ts theme={null}
await corsair.callingly.api.teams.removeAgent({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string \| number` | Yes | — |
| `agentId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | No | — |
| `message` | `string` | No | — |

***

### updateAgentSettings

`teams.updateAgentSettings`

Update priority and capacity settings for a team agent

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.teams.updateAgentSettings({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string \| number` | Yes | — |
| `agentId` | `string \| number` | Yes | — |
| `priority` | `number` | No | — |
| `cap` | `number \| null` | No | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `team_id` | `string \| number` | No | — |
| `name` | `string` | No | — |
| `custom_id` | `string \| number \| null` | No | — |
| `fub_id` | `string \| number \| null` | No | — |
| `priority` | `number` | No | — |
| `cap` | `number \| null` | No | — |

***

### updateUsers

`teams.updateUsers`

Update the list of agents assigned to a team

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.teams.updateUsers({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string \| number` | Yes | — |
| `agents` | `(string \| number)[]` | Yes | Agent ids that replace every current team assignment |
| `account_id` | `string \| number` | No | — |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   agents: {
>     id: string | number,
>     team_id?: string | number,
>     name?: string,
>     custom_id?: string | number | null,
>     fub_id?: string | number | null,
>     priority?: number,
>     cap?: number | null
>   }[]
> } | {
>   success?: boolean,
>   message?: string
> }
> ```

***

## Webhooks

### create

`webhooks.create`

Create a new webhook for call or lead events

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.webhooks.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `event` | `call_completed \| lead_created \| lead_updated` | Yes | — |
| `target_url` | `string` | Yes | — |
| `call_direction` | `outbound \| inbound \| null` | No | call\_completed only |
| `call_status` | `completed \| missed \| offline \| null` | No | call\_completed only |
| `call_lead_status` | `contacted \| missed \| removed \| voicemail \| null` | No | call\_completed only |
| `team_id` | `string \| number \| null` | No | Outbound call\_completed only |
| `number_id` | `string \| number \| null` | No | Inbound call\_completed only |
| `field` | `lead_owner \| result \| stage \| status \| tags \| null` | No | lead\_created / lead\_updated only: trigger when this field changes |
| `filter` | `string \| null` | No | lead\_created / lead\_updated only: required value of `field` |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | No | — |
| `event` | `string` | No | — |
| `target_url` | `string` | No | — |
| `direction` | `string \| null` | No | — |
| `call_direction` | `string \| null` | No | — |
| `call_status` | `string \| null` | No | — |
| `call_lead_status` | `string \| null` | No | — |
| `team_id` | `string \| number \| null` | No | — |
| `number_id` | `string \| number \| null` | No | — |
| `field` | `string \| null` | No | — |
| `filter` | `string \| null` | No | — |
| `is_active` | `boolean \| number` | No | — |
| `consecutive_failures` | `number` | No | — |
| `last_failed_at` | `string \| null` | No | — |
| `is_auto_disabled` | `boolean \| number` | No | — |

***

### delete

`webhooks.delete`

Delete a webhook by ID

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | No | — |
| `message` | `string` | No | — |

***

### get

`webhooks.get`

Retrieve details of a specific webhook by ID

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | No | — |
| `event` | `string` | No | — |
| `target_url` | `string` | No | — |
| `direction` | `string \| null` | No | — |
| `call_direction` | `string \| null` | No | — |
| `call_status` | `string \| null` | No | — |
| `call_lead_status` | `string \| null` | No | — |
| `team_id` | `string \| number \| null` | No | — |
| `number_id` | `string \| number \| null` | No | — |
| `field` | `string \| null` | No | — |
| `filter` | `string \| null` | No | — |
| `is_active` | `boolean \| number` | No | — |
| `consecutive_failures` | `number` | No | — |
| `last_failed_at` | `string \| null` | No | — |
| `is_auto_disabled` | `boolean \| number` | No | — |

***

### list

`webhooks.list`

List configured webhooks

**Risk:** `read`

```ts theme={null}
await corsair.callingly.api.webhooks.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string \| number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   account_id?: string | number,
>   name?: string,
>   event?: string,
>   target_url?: string,
>   direction?: string | null,
>   call_direction?: string | null,
>   call_status?: string | null,
>   call_lead_status?: string | null,
>   team_id?: string | number | null,
>   number_id?: string | number | null,
>   field?: string | null,
>   filter?: string | null,
>   is_active?: boolean | number,
>   consecutive_failures?: number,
>   last_failed_at?: string | null,
>   is_auto_disabled?: boolean | number
> }[]
> ```

***

### update

`webhooks.update`

Update an existing webhook configuration by ID

**Risk:** `write`

```ts theme={null}
await corsair.callingly.api.webhooks.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string \| number` | Yes | — |
| `name` | `string` | No | — |
| `event` | `call_completed \| lead_created \| lead_updated` | No | — |
| `target_url` | `string` | No | — |
| `call_direction` | `outbound \| inbound \| null` | No | call\_completed only |
| `call_status` | `completed \| missed \| offline \| null` | No | call\_completed only |
| `call_lead_status` | `contacted \| missed \| removed \| voicemail \| null` | No | call\_completed only |
| `team_id` | `string \| number \| null` | No | Outbound call\_completed only |
| `number_id` | `string \| number \| null` | No | Inbound call\_completed only |
| `field` | `lead_owner \| result \| stage \| status \| tags \| null` | No | lead\_created / lead\_updated only: trigger when this field changes |
| `filter` | `string \| null` | No | lead\_created / lead\_updated only: required value of `field` |
| `account_id` | `string \| number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number` | No | — |
| `name` | `string` | No | — |
| `event` | `string` | No | — |
| `target_url` | `string` | No | — |
| `direction` | `string \| null` | No | — |
| `call_direction` | `string \| null` | No | — |
| `call_status` | `string \| null` | No | — |
| `call_lead_status` | `string \| null` | No | — |
| `team_id` | `string \| number \| null` | No | — |
| `number_id` | `string \| number \| null` | No | — |
| `field` | `string \| null` | No | — |
| `filter` | `string \| null` | No | — |
| `is_active` | `boolean \| number` | No | — |
| `consecutive_failures` | `number` | No | — |
| `last_failed_at` | `string \| null` | No | — |
| `is_auto_disabled` | `boolean \| number` | No | — |

***


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