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

# Inkbox API reference

> API reference for the Inkbox plugin in Corsair: every `inkbox.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).

## A2a

### contactRules.create

`a2a.contactRules.create`

Creates an allow or block rule (`action`) controlling which agent (`match_target`) can exchange A2A tasks with this identity, optionally per `direction`. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.a2a.contactRules.create({ agent_handle: 'support-agent', action: 'allow', match_target: 'example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block` | Yes | — |
| `match_type` | `handle` | No | — |
| `match_target` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### contactRules.delete

`a2a.contactRules.delete`

Deletes one A2A contact rule (`rule_id`) from an identity. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.a2a.contactRules.delete({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### contactRules.list

`a2a.contactRules.list`

Lists the A2A allow and block rules for one identity (`agent_handle`).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.contactRules.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### contactRules.listForOrg

`a2a.contactRules.listForOrg`

Lists active A2A contact rules across every identity in the organization, filterable by `agent_identity_id`, `action` and `direction`. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.contactRules.listForOrg({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `action` | `allow \| block \| null` | No | — |
| `direction` | `inbound \| outbound \| both \| null` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   agent_identity_id?: string | null
> }[]
> ```

***

### contactRules.update

`a2a.contactRules.update`

Changes an A2A contact rule's `action` and/or `direction`; to change the match target, delete and recreate the rule. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.a2a.contactRules.update({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | — |
| `direction` | `inbound \| outbound \| both \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### contexts.get

`a2a.contexts.get`

Returns one A2A context (a conversation session) that another agent opened toward this identity, with its tasks in both directions.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.contexts.get({ context_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `context_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `caller` | `object \| null` | No | — |
| `target` | `object \| null` | No | — |
| `tasks` | `object[] \| null` | No | — |
| `tasks_truncated` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `last_activity_at` | `string \| null` | No | — |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   trust_tier?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] target full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] tasks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   context_id?: string | null,
>   state?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   messages?: {
>     id?: string | null,
>     message_id?: string | null,
>     role?: string | null,
>     parts?: {
>     }[] | null,
>     metadata?: {
>     } | null | null,
>     extensions?: string[] | null | null,
>     reference_task_ids?: string[] | null | null,
>     created_at?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   }[] | null,
>   history_truncated?: boolean | null,
>   completed_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### contexts.list

`a2a.contexts.list`

Lists A2A contexts visible to an identity, most recently active first, optionally filtered by `direction`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.contexts.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   tasks?: {
>     id?: string | null,
>     context_id?: string | null,
>     state?: string | null,
>     caller?: {
>       identity_id?: string | null,
>       organization_id?: string | null,
>       handle?: string | null | null,
>       trust_tier?: string | null,
>       affiliation?: {
>         domain?: string | null,
>         verifier?: string | null,
>         last_success_at?: string | null,
>         valid_until?: string | null
>       } | null | null
>     } | null,
>     target?: {
>       identity_id?: string | null,
>       organization_id?: string | null,
>       handle?: string | null | null,
>       affiliation?: {
>         domain?: string | null,
>         verifier?: string | null,
>         last_success_at?: string | null,
>         valid_until?: string | null
>       } | null | null
>     } | null,
>     messages?: {
>       id?: string | null,
>       message_id?: string | null,
>       role?: string | null,
>       parts?: {
>       }[] | null,
>       metadata?: {
>       } | null | null,
>       extensions?: string[] | null | null,
>       reference_task_ids?: string[] | null | null,
>       created_at?: string | null,
>       affiliation?: {
>         domain?: string | null,
>         verifier?: string | null,
>         last_success_at?: string | null,
>         valid_until?: string | null
>       } | null | null
>     }[] | null,
>     history_truncated?: boolean | null,
>     completed_at?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }[] | null,
>   tasks_truncated?: boolean | null,
>   created_at?: string | null,
>   last_activity_at?: string | null
> }[] | null
> ```

***

### contexts.update

`a2a.contexts.update`

Renames an A2A context (`name`). Either participant can rename it, whoever opened it.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.a2a.contexts.update({ context_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent', name: 'Support inbox' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `context_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `caller` | `object \| null` | No | — |
| `target` | `object \| null` | No | — |
| `tasks` | `object[] \| null` | No | — |
| `tasks_truncated` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `last_activity_at` | `string \| null` | No | — |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   trust_tier?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] target full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] tasks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   context_id?: string | null,
>   state?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   messages?: {
>     id?: string | null,
>     message_id?: string | null,
>     role?: string | null,
>     parts?: {
>     }[] | null,
>     metadata?: {
>     } | null | null,
>     extensions?: string[] | null | null,
>     reference_task_ids?: string[] | null | null,
>     created_at?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   }[] | null,
>   history_truncated?: boolean | null,
>   completed_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### invitations.accept

`a2a.invitations.accept`

Accepts an A2A invitation (`invitation_token`) as the agent that owns the calling agent-scoped API key, connecting it to the invitation's peer agents.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.accept({ invitation_token: 'inv_tok_example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitation_token` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitation_id` | `string \| null` | No | — |
| `invitee_identity_id` | `string \| null` | No | — |
| `invitee_agent_handle` | `string \| null` | No | — |
| `peer_agent_handles` | `string[] \| null` | No | — |
| `accepted_at` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

***

### invitations.create

`a2a.invitations.create`

Creates an A2A invitation that lets an outside agent connect to `peer_agent_handles`; Inkbox emails `recipient_email` if set, otherwise returns a link to hand off. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.create({
	peer_agent_handles: ['example'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `peer_agent_handles` | `string[]` | Yes | — |
| `recipient_email` | `string \| null` | No | — |
| `expires_in_seconds` | `number` | No | — |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   issuer_organization_id?: string | null,
>   inviter_email?: string | null | null,
>   peer_agent_handles?: string[] | null,
>   recipient_email?: string | null | null,
>   status?: string | string | null,
>   invitee_identity_id?: string | null | null,
>   invitee_agent_handle?: string | null | null,
>   invitee_organization_id?: string | null | null,
>   email_status?: string | null,
>   email_sent_at?: string | null | null,
>   expires_at?: string | null,
>   accepted_at?: string | null | null,
>   declined_at?: string | null | null,
>   revoked_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   invitation_token?: string | null,
>   invitation_url?: string | null,
>   agent_handoff_prompt?: string | null
> } | {
>   id?: string | null,
>   issuer_organization_id?: string | null,
>   inviter_email?: string | null | null,
>   peer_agent_handles?: string[] | null,
>   recipient_email?: string | null | null,
>   status?: string | string | null,
>   invitee_identity_id?: string | null | null,
>   invitee_agent_handle?: string | null | null,
>   invitee_organization_id?: string | null | null,
>   email_status?: string | null,
>   email_sent_at?: string | null | null,
>   expires_at?: string | null,
>   accepted_at?: string | null | null,
>   declined_at?: string | null | null,
>   revoked_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

### invitations.decline

`a2a.invitations.decline`

Declines an A2A invitation by its `invitation_token`. Connections already accepted are not affected. Inkbox needs no API key for this route; the plugin still sends the connected one.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.decline({ invitation_token: 'inv_tok_example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitation_token` | `string` | Yes | — |

**Output**

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

***

### invitations.get

`a2a.invitations.get`

Returns one A2A invitation issued by your organization, with its status, peer agents and email delivery state.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.get({ invitation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `issuer_organization_id` | `string \| null` | No | — |
| `inviter_email` | `string \| null \| null` | No | — |
| `peer_agent_handles` | `string[] \| null` | No | — |
| `recipient_email` | `string \| null \| null` | No | — |
| `status` | `string \| string \| null` | No | — |
| `invitee_identity_id` | `string \| null \| null` | No | — |
| `invitee_agent_handle` | `string \| null \| null` | No | — |
| `invitee_organization_id` | `string \| null \| null` | No | — |
| `email_status` | `string \| null` | No | — |
| `email_sent_at` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null` | No | — |
| `accepted_at` | `string \| null \| null` | No | — |
| `declined_at` | `string \| null \| null` | No | — |
| `revoked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### invitations.list

`a2a.invitations.list`

Lists A2A invitations issued by your organization, newest first, optionally filtered by `status`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   issuer_organization_id?: string | null,
>   inviter_email?: string | null | null,
>   peer_agent_handles?: string[] | null,
>   recipient_email?: string | null | null,
>   status?: string | string | null,
>   invitee_identity_id?: string | null | null,
>   invitee_agent_handle?: string | null | null,
>   invitee_organization_id?: string | null | null,
>   email_status?: string | null,
>   email_sent_at?: string | null | null,
>   expires_at?: string | null,
>   accepted_at?: string | null | null,
>   declined_at?: string | null | null,
>   revoked_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### invitations.preview

`a2a.invitations.preview`

Shows an A2A invitation's inviter, peer agents and expiry from the raw `invitation_token` without accepting it. Inkbox needs no API key for this route; the plugin still sends the connected one.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.preview({ invitation_token: 'inv_tok_example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitation_token` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `inviter_email` | `string \| null` | No | — |
| `peer_agent_handles` | `string[] \| null` | No | — |
| `expires_at` | `string \| null` | No | — |
| `agent_handoff_prompt` | `string \| null` | No | — |

***

### invitations.revoke

`a2a.invitations.revoke`

Revokes a pending or awaiting-verification A2A invitation so it can no longer be accepted. Accepted, declined or expired invitations cannot be revoked.

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

```ts theme={null}
await corsair.inkbox.api.a2a.invitations.revoke({ invitation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `issuer_organization_id` | `string \| null` | No | — |
| `inviter_email` | `string \| null \| null` | No | — |
| `peer_agent_handles` | `string[] \| null` | No | — |
| `recipient_email` | `string \| null \| null` | No | — |
| `status` | `string \| string \| null` | No | — |
| `invitee_identity_id` | `string \| null \| null` | No | — |
| `invitee_agent_handle` | `string \| null \| null` | No | — |
| `invitee_organization_id` | `string \| null \| null` | No | — |
| `email_status` | `string \| null` | No | — |
| `email_sent_at` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null` | No | — |
| `accepted_at` | `string \| null \| null` | No | — |
| `declined_at` | `string \| null \| null` | No | — |
| `revoked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### listDirectory

`a2a.listDirectory`

Searches the organization's directory of A2A-enabled agent identities, including non-public cards, by text `q` or `verified_domain`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.listDirectory({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `q` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `verified_domain` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   card_url?: string | null,
>   card?: {
>   } | null,
>   visibility?: string | null
> }[] | null
> ```

***

### messages.list

`a2a.messages.list`

Lists A2A task messages for an identity, newest first, filterable by `direction`, `task_id`, `context_id`, `role`, peer handles, `since` or full-text `q`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.messages.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `requester_handle` | `string \| null` | No | — |
| `worker_handle` | `string \| null` | No | — |
| `task_id` | `string \| null` | No | — |
| `context_id` | `string \| null` | No | — |
| `role` | `caller \| agent \| null` | No | Message author role; this is independent of task direction. |
| `q` | `string \| null` | No | Full-text search over message content; results remain newest first. |
| `since` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   message_id?: string | null,
>   role?: string | null,
>   parts?: {
>   }[] | null,
>   metadata?: {
>   } | null | null,
>   extensions?: string[] | null | null,
>   reference_task_ids?: string[] | null | null,
>   created_at?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null,
>   task_id?: string | null,
>   context_id?: string | null,
>   task_state?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null
> }[] | null
> ```

***

### previewCard

`a2a.previewCard`

Returns the Agent Card Inkbox would publish for one of your identities, even while A2A is disabled, to review its description and skills.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.previewCard({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output:** *empty object*

***

### sentContexts.get

`a2a.sentContexts.get`

Returns one A2A context this identity opened toward another agent, with its tasks in both directions. Returns 404 for contexts opened toward it.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.sentContexts.get({ context_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `context_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `caller` | `object \| null` | No | — |
| `target` | `object \| null` | No | — |
| `tasks` | `object[] \| null` | No | — |
| `tasks_truncated` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `last_activity_at` | `string \| null` | No | — |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   trust_tier?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] target full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] tasks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   context_id?: string | null,
>   state?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   messages?: {
>     id?: string | null,
>     message_id?: string | null,
>     role?: string | null,
>     parts?: {
>     }[] | null,
>     metadata?: {
>     } | null | null,
>     extensions?: string[] | null | null,
>     reference_task_ids?: string[] | null | null,
>     created_at?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   }[] | null,
>   history_truncated?: boolean | null,
>   completed_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### sentContexts.list

`a2a.sentContexts.list`

Lists A2A contexts this identity opened toward other agents.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.sentContexts.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   tasks?: {
>     id?: string | null,
>     context_id?: string | null,
>     state?: string | null,
>     caller?: {
>       identity_id?: string | null,
>       organization_id?: string | null,
>       handle?: string | null | null,
>       trust_tier?: string | null,
>       affiliation?: {
>         domain?: string | null,
>         verifier?: string | null,
>         last_success_at?: string | null,
>         valid_until?: string | null
>       } | null | null
>     } | null,
>     target?: {
>       identity_id?: string | null,
>       organization_id?: string | null,
>       handle?: string | null | null,
>       affiliation?: {
>         domain?: string | null,
>         verifier?: string | null,
>         last_success_at?: string | null,
>         valid_until?: string | null
>       } | null | null
>     } | null,
>     messages?: {
>       id?: string | null,
>       message_id?: string | null,
>       role?: string | null,
>       parts?: {
>       }[] | null,
>       metadata?: {
>       } | null | null,
>       extensions?: string[] | null | null,
>       reference_task_ids?: string[] | null | null,
>       created_at?: string | null,
>       affiliation?: {
>         domain?: string | null,
>         verifier?: string | null,
>         last_success_at?: string | null,
>         valid_until?: string | null
>       } | null | null
>     }[] | null,
>     history_truncated?: boolean | null,
>     completed_at?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }[] | null,
>   tasks_truncated?: boolean | null,
>   created_at?: string | null,
>   last_activity_at?: string | null
> }[] | null
> ```

***

### sentTasks.get

`a2a.sentTasks.get`

Returns one A2A task this identity sent to another agent, with its message history.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.sentTasks.get({ task_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `context_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `caller` | `object \| null` | No | — |
| `target` | `object \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `history_truncated` | `boolean \| null` | No | — |
| `completed_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   trust_tier?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] target full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   message_id?: string | null,
>   role?: string | null,
>   parts?: {
>   }[] | null,
>   metadata?: {
>   } | null | null,
>   extensions?: string[] | null | null,
>   reference_task_ids?: string[] | null | null,
>   created_at?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> }[] | null
> ```

***

### sentTasks.list

`a2a.sentTasks.list`

Lists A2A tasks this identity sent to other agents, newest first, filterable by `state`, `context_id`, peer handles, `since` or full-text `q`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.sentTasks.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `requester_handle` | `string \| null` | No | — |
| `worker_handle` | `string \| null` | No | — |
| `state` | `submitted \| working \| input_required \| completed \| failed \| canceled \| null` | No | — |
| `context_id` | `string \| null` | No | — |
| `q` | `string \| null` | No | Full-text search over task message content; results remain newest first. |
| `since` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   context_id?: string | null,
>   state?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   messages?: {
>     id?: string | null,
>     message_id?: string | null,
>     role?: string | null,
>     parts?: {
>     }[] | null,
>     metadata?: {
>     } | null | null,
>     extensions?: string[] | null | null,
>     reference_task_ids?: string[] | null | null,
>     created_at?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   }[] | null,
>   history_truncated?: boolean | null,
>   completed_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### settings.get

`a2a.settings.get`

Returns an identity's A2A settings (enabled, public discoverability, filter mode, skills, card URL) and lifetime inbound and outbound task counts.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.settings.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | — |
| `publicly_discoverable` | `boolean \| null` | No | — |
| `allow_public_egress` | `boolean \| null` | No | — |
| `filter_mode` | `string \| null` | No | — |
| `skills` | `object[] \| null` | No | — |
| `card_url` | `string \| null` | No | — |
| `inbound_task_count` | `number \| null` | No | — |
| `outbound_task_count` | `number \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |

> [accordion] skills full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   tags?: string[] | null,
>   examples?: string[] | null,
>   inputModes?: string[] | null,
>   outputModes?: string[] | null
> }[] | null | null
> ```

***

### settings.listForOrg

`a2a.settings.listForOrg`

Lists every identity's effective A2A settings across the organization, optionally filtered by `enabled`. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.settings.listForOrg({});
```

**Input**

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

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   identity?: {
>     id?: string | null,
>     agent_handle?: string | null
>   } | null,
>   settings?: {
>     enabled?: boolean | null,
>     publicly_discoverable?: boolean | null,
>     allow_public_egress?: boolean | null,
>     filter_mode?: string | null,
>     skills?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null,
>       tags?: string[] | null,
>       examples?: string[] | null,
>       inputModes?: string[] | null,
>       outputModes?: string[] | null
>     }[] | null | null,
>     card_url?: string | null,
>     inbound_task_count?: number | null,
>     outbound_task_count?: number | null,
>     updated_at?: string | null | null
>   } | null
> }[] | null
> ```

***

### settings.update

`a2a.settings.update`

Updates an identity's A2A settings: `enabled`, `skills`, `allow_public_egress`, and (admin key only) `publicly_discoverable` and `filter_mode`. Omitted fields are kept.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.a2a.settings.update({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `enabled` | `boolean \| null` | No | — |
| `publicly_discoverable` | `boolean \| null` | No | — |
| `allow_public_egress` | `boolean \| null` | No | — |
| `filter_mode` | `whitelist \| blacklist \| null` | No | — |
| `skills` | `object[] \| null` | No | — |

> [accordion] skills full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   description: string,
>   tags: string[],
>   examples?: string[],
>   inputModes?: string[],
>   outputModes?: string[]
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | — |
| `publicly_discoverable` | `boolean \| null` | No | — |
| `allow_public_egress` | `boolean \| null` | No | — |
| `filter_mode` | `string \| null` | No | — |
| `skills` | `object[] \| null` | No | — |
| `card_url` | `string \| null` | No | — |
| `inbound_task_count` | `number \| null` | No | — |
| `outbound_task_count` | `number \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |

> [accordion] skills full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   tags?: string[] | null,
>   examples?: string[] | null,
>   inputModes?: string[] | null,
>   outputModes?: string[] | null
> }[] | null | null
> ```

***

### tasks.get

`a2a.tasks.get`

Returns one A2A task this identity received as the worker, with its message history. Use `a2a.sentTasks.get` for tasks it sent.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.tasks.get({ task_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `context_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `caller` | `object \| null` | No | — |
| `target` | `object \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `history_truncated` | `boolean \| null` | No | — |
| `completed_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   trust_tier?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] target full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   message_id?: string | null,
>   role?: string | null,
>   parts?: {
>   }[] | null,
>   metadata?: {
>   } | null | null,
>   extensions?: string[] | null | null,
>   reference_task_ids?: string[] | null | null,
>   created_at?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> }[] | null
> ```

***

### tasks.list

`a2a.tasks.list`

Lists A2A tasks visible to an identity, newest first; received tasks by default, or set `direction`. Filterable by `state`, `context_id`, peer handles and `q`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.a2a.tasks.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `requester_handle` | `string \| null` | No | — |
| `worker_handle` | `string \| null` | No | — |
| `state` | `submitted \| working \| input_required \| completed \| failed \| canceled \| null` | No | — |
| `context_id` | `string \| null` | No | — |
| `q` | `string \| null` | No | Full-text search over task message content; results remain newest first. |
| `since` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   context_id?: string | null,
>   state?: string | null,
>   caller?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     trust_tier?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   target?: {
>     identity_id?: string | null,
>     organization_id?: string | null,
>     handle?: string | null | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   } | null,
>   messages?: {
>     id?: string | null,
>     message_id?: string | null,
>     role?: string | null,
>     parts?: {
>     }[] | null,
>     metadata?: {
>     } | null | null,
>     extensions?: string[] | null | null,
>     reference_task_ids?: string[] | null | null,
>     created_at?: string | null,
>     affiliation?: {
>       domain?: string | null,
>       verifier?: string | null,
>       last_success_at?: string | null,
>       valid_until?: string | null
>     } | null | null
>   }[] | null,
>   history_truncated?: boolean | null,
>   completed_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### tasks.reply

`a2a.tasks.reply`

Replies to a task this identity received, sending message `parts` to the requesting agent and moving the task by `intent`: progress, ask\_caller, complete or fail.

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

```ts theme={null}
await corsair.inkbox.api.a2a.tasks.reply({
	task_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	agent_handle: 'support-agent',
	intent: 'progress',
	parts: [{ text: 'Thanks, your order ships tomorrow.' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `intent` | `progress \| ask_caller \| complete \| fail` | Yes | — |
| `parts` | `object[]` | Yes | — |

> [accordion] parts full type
>
> ```ts theme={null}
> (
>   {
>     text: string,
>     metadata?: {
>     } | null
>   } | {
>     data: any,
>     metadata?: {
>     } | null
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `context_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `caller` | `object \| null` | No | — |
| `target` | `object \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `history_truncated` | `boolean \| null` | No | — |
| `completed_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   trust_tier?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] target full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null,
>   organization_id?: string | null,
>   handle?: string | null | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> } | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   message_id?: string | null,
>   role?: string | null,
>   parts?: {
>   }[] | null,
>   metadata?: {
>   } | null | null,
>   extensions?: string[] | null | null,
>   reference_task_ids?: string[] | null | null,
>   created_at?: string | null,
>   affiliation?: {
>     domain?: string | null,
>     verifier?: string | null,
>     last_success_at?: string | null,
>     valid_until?: string | null
>   } | null | null
> }[] | null
> ```

***

## Account

### whoami

`account.whoami`

Returns the authenticated caller's identity and auth type, to check which organization, identity or key a request runs as.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.account.whoami({});
```

**Input:** *empty object*

**Output:** *empty object*

***

## Agent Signup

### getStatus

`agentSignup.getStatus`

Returns the calling agent's claim status, its human owner's account state and email, and the restrictions that still apply to it.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.agentSignup.getStatus({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `claim_status` | `string \| null` | No | — |
| `human_state` | `string \| null` | No | — |
| `human_email` | `string \| null` | No | — |
| `restrictions` | `object \| null` | No | — |

> [accordion] restrictions full type
>
> ```ts theme={null}
> {
>   max_sends_per_day?: number | null,
>   allowed_recipients?: string[] | null,
>   can_receive?: boolean | null,
>   can_create_mailboxes?: boolean | null
> } | null
> ```

***

### resendVerification

`agentSignup.resendVerification`

Emails the agent's human owner a new 6-digit verification code, invalidating the previous one. Limited to once every 5 minutes.

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

```ts theme={null}
await corsair.inkbox.api.agentSignup.resendVerification({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `claim_status` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `invitation` | `object \| null` | No | — |

> [accordion] invitation full type
>
> ```ts theme={null}
> {
>   invitation_id?: string | null,
>   status?: string | null,
>   invitee_identity_id?: string | null,
>   invitee_agent_handle?: string | null,
>   peer_agent_handles?: string[] | null,
>   accepted_at?: string | null | null
> } | null | null
> ```

***

### verify

`agentSignup.verify`

Submits the 6-digit `verification_code` the human received by email to claim the agent and unlock full sending.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.agentSignup.verify({ verification_code: '123456' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `verification_code` | `string` | Yes | 6-digit verification code sent to the human's email. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `claim_status` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `invitation` | `object \| null` | No | — |

> [accordion] invitation full type
>
> ```ts theme={null}
> {
>   invitation_id?: string | null,
>   status?: string | null,
>   invitee_identity_id?: string | null,
>   invitee_agent_handle?: string | null,
>   peer_agent_handles?: string[] | null,
>   accepted_at?: string | null | null
> } | null | null
> ```

***

## Api Keys

### create

`apiKeys.create`

Creates an API key (`label`): set `scoped_identity_id` for an agent-scoped key, or omit it for an admin key with full organization access. The key value is returned only once.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.apiKeys.create({ label: 'support-agent key', scoped_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `label` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `scoped_identity_id` | `string \| null` | No | Scope this key to a specific agent identity. Omit or null for an admin (unscoped) key with full org-wide authority. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `api_key` | `string \| null` | No | Full API key string. Shown once, cannot be retrieved later. |
| `record` | `object \| null` | No | — |

> [accordion] record full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   created_by?: string | null,
>   creator_type?: string | null,
>   scoped_identity_id?: string | null | null,
>   label?: string | null,
>   description?: string | null | null,
>   status?: string | null,
>   last4?: string | null,
>   display_prefix?: string | null,
>   last_used_at?: string | null | null,
>   expires_at?: string | null | null,
>   revoked_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

### getCurrent

`apiKeys.getCurrent`

Returns metadata for the API key making the call (scope, label, status, last four characters, expiry). The key value itself is never returned.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.apiKeys.getCurrent({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `created_by` | `string \| null` | No | — |
| `creator_type` | `string \| null` | No | — |
| `scoped_identity_id` | `string \| null \| null` | No | — |
| `label` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `last4` | `string \| null` | No | — |
| `display_prefix` | `string \| null` | No | — |
| `last_used_at` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null \| null` | No | — |
| `revoked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### revokeCurrent

`apiKeys.revokeCurrent`

Revokes the API key making the call, permanently, so later requests with it fail. Create a replacement key before revoking.

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

```ts theme={null}
await corsair.inkbox.api.apiKeys.revokeCurrent({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `created_by` | `string \| null` | No | — |
| `creator_type` | `string \| null` | No | — |
| `scoped_identity_id` | `string \| null \| null` | No | — |
| `label` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `last4` | `string \| null` | No | — |
| `display_prefix` | `string \| null` | No | — |
| `last_used_at` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null \| null` | No | — |
| `revoked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

## Billing

### callingCountries.buy

`billing.callingCountries.buy`

Buys outbound calling access to countries (`country_code` or `country_codes`) with an accepted `quote` and a new `request_key`, charging the organization. Reuse the key on retry; admin key only.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.callingCountries.buy({ quote: 'example', request_key: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `country_code` | `string \| null` | No | — |
| `country_codes` | `string[] \| null` | No | — |
| `quote` | `string` | Yes | — |
| `request_key` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `countries` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `included_country_codes` | `string[] \| null` | No | — |

> [accordion] countries full type
>
> ```ts theme={null}
> {
>   country_code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   agreement_id?: string | null | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   country_codes?: string[] | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   covered_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null,
>   created_at?: string | null
> }[] | null
> ```

***

### callingCountries.cancel

`billing.callingCountries.cancel`

Cancels renewal of a calling-country agreement (`agreement_id`). Access lasts through the paid period; no prorated refund.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.callingCountries.cancel({ agreement_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agreement_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `countries` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `included_country_codes` | `string[] \| null` | No | — |

> [accordion] countries full type
>
> ```ts theme={null}
> {
>   country_code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   agreement_id?: string | null | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   country_codes?: string[] | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   covered_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null,
>   created_at?: string | null
> }[] | null
> ```

***

### callingCountries.list

`billing.callingCountries.list`

Lists calling destinations with monthly prices, the organization's calling-country agreements, and the countries already included.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.callingCountries.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `countries` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `included_country_codes` | `string[] \| null` | No | — |

> [accordion] countries full type
>
> ```ts theme={null}
> {
>   country_code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   agreement_id?: string | null | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   country_codes?: string[] | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   covered_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null,
>   created_at?: string | null
> }[] | null
> ```

***

### callingCountries.quote

`billing.callingCountries.quote`

Quotes the prorated charge for adding calling countries (`country_code` or `country_codes`) and returns a `quote` token to confirm the purchase. Does not charge.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.callingCountries.quote({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `country_code` | `string \| null` | No | — |
| `country_codes` | `string[] \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `quote` | `string \| null` | No | — |
| `expires_at` | `number \| null` | No | — |
| `monthly_amount` | `string \| null` | No | — |
| `country_amount_cents` | `number \| null` | No | — |
| `invoice_total_cents` | `number \| null` | No | — |
| `amount_due_cents` | `number \| null` | No | — |
| `currency` | `string \| null` | No | — |
| `renewal_at` | `number \| null \| null` | No | — |
| `items` | `object[] \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   country_code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   amount_cents?: number | null
> }[] | null
> ```

***

### callingCountries.resume

`billing.callingCountries.resume`

Resumes renewal of a canceled calling-country agreement (`agreement_id`) before its coverage ends, at the existing price.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.callingCountries.resume({ agreement_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agreement_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `countries` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `included_country_codes` | `string[] \| null` | No | — |

> [accordion] countries full type
>
> ```ts theme={null}
> {
>   country_code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   agreement_id?: string | null | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   country_codes?: string[] | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   covered_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null,
>   created_at?: string | null
> }[] | null
> ```

***

### changePlan

`billing.changePlan`

Changes the organization's subscription `plan` (`free` cancels) and optionally its billing `interval`; requires an admin key. Upgrades and moves to yearly are charged and prorated immediately.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.changePlan({ plan: 'free' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `plan` | `free \| hobbyist \| developer \| startup \| enterprise` | Yes | — |
| `startup_variant` | `outbound \| null` | No | Startup only: pass the fixed value 'outbound' when selecting the supported \$200 plan. Omit or pass null while keeping the current Startup subscription to clear a pending change without changing its legacy price. |
| `interval` | `month \| year \| null` | No | Plan fee renewal cadence to switch to: 'month' or 'year'. Omit to keep the current cadence. Moving to yearly takes effect immediately (prorated); moving from yearly to monthly takes effect at the yearly renewal. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `billing_account_available` | `boolean \| null` | No | Whether payment-method and invoice management is available. |
| `plan` | `string \| null` | No | — |
| `status` | `string \| null \| null` | No | Stripe subscription status (active, past\_due, ...) or None on Free. |
| `cancel_at_period_end` | `boolean \| null` | No | Whether the subscription is set to cancel at the period boundary. |
| `current_period_end` | `number \| null \| null` | No | Unix seconds when the current monthly usage cycle ends, if subscribed. Allowances reset and usage is billed at this boundary. |
| `billing_interval` | `string \| null \| null` | No | How often the plan fee renews ('month' or 'year'); None on Free. |
| `plan_period_end` | `number \| null \| null` | No | Unix seconds when the plan fee next renews. Equals current\_period\_end on monthly plans; up to a year out on yearly plans. |
| `pending_plan` | `string \| null \| null` | No | Plan the subscription will switch to at period end (FREE = scheduled cancel), if any. |
| `pending_change_date` | `number \| null \| null` | No | Unix seconds when the pending plan change / cancellation takes effect. |
| `pending_startup_variant` | `string \| null \| null` | No | When the pending plan is Startup: which flat-price variant the scheduled switch lands on. None otherwise. |
| `pending_billing_interval` | `string \| null \| null` | No | Renewal cadence of the pending paid plan, if a switch is scheduled. |
| `legacy_developer_price` | `boolean \| null` | No | True when the subscription's flat price is the retired \$25 Developer price (sunset migration pending); the console surfaces the phase-out banner from this. |
| `stripe_configured` | `boolean \| null` | No | False when Stripe isn't configured server-side; the UI hides upgrade actions. |
| `annual_billing_available` | `boolean \| null` | No | Whether yearly plan billing can be selected. |
| `balance` | `number \| null \| null` | No | Stripe customer account balance in cents (negative = credit available, positive = amount owed). None on Free with no customer yet, or if the read failed. |
| `estimated_next_bill` | `number \| null \| null` | No | Amount due in cents on the upcoming invoice (plan fee + metered overage accrued so far this cycle), net of any account credit. None when there's no subscription (Free) or the preview read failed. |
| `mail_custom_signatures_enabled` | `boolean \| null` | No | Whether custom email signatures are available to this organization, including account-specific overrides, regardless of subscription status. |
| `entitlements` | `object \| null` | No | Resolved organization entitlements, including additional grants on Free. May be absent from plan-change responses. |
| `lapsed_subscription` | `object \| null` | No | On Free only: a plan subscription that is unpaid, incomplete or paused and still needs the customer to act. Informational; it grants no plan, and `plan` and `status` keep describing the organization's effective billing state. |

> [accordion] entitlements full type
>
> ```ts theme={null}
> {
>   is_custom?: boolean | null,
>   display_name?: string | null,
>   plan_amount_cents?: number | null | null,
>   plan_amount_interval?: string | null | null,
>   phone_numbers?: number | null,
>   sending_domains?: number | null,
>   identities?: number | null | null,
>   mail_custom_signatures_enabled?: boolean | null,
>   mail_storage_bytes_per_identity?: number | null,
>   imessage_messages_per_org_per_cycle?: number | null,
>   imessage_dedicated_messages_per_org_per_cycle?: number | null | null,
>   startup_variant?: string | null | null,
>   imessage_unique_recipients_per_agent_identity?: number | null,
>   sms_allowance_per_identity?: number | null,
>   voice_sec_allowance_per_identity?: number | null,
>   allowance_scope?: string | null,
>   sms_allowance_per_org_per_cycle?: number | null,
>   voice_sec_allowance_per_org_per_cycle?: number | null,
>   imessage_lines?: number | null,
>   imessage_lines_used?: number | null,
>   imessage_personal_lines?: number | null,
>   imessage_shared_lines?: number | null,
>   imessage_router_lines?: number | null,
>   imessage_enabled?: boolean | null,
>   dedicated_imessage_inbound_lines?: number | null | null,
>   dedicated_imessage_outbound_lines?: number | null | null,
>   imessage_included_messages_per_cycle?: number | null | null,
>   imessage_overage_cents_per_million?: number | null | null,
>   campaign_fee_cents?: number | null | null,
>   campaign_fee_active?: boolean | null,
>   voice_packs?: {
>     pack?: string | null,
>     minutes?: number | null,
>     price_cents?: number | null,
>     quantity?: number | null,
>     ending_quantity?: number | null | null,
>     ending_at?: number | null | null
>   }[] | null | null,
>   other_recurring_items?: {
>     name?: string | null,
>     quantity?: number | null,
>     amount_cents?: number | null | null,
>     interval?: string | null | null
>   }[] | null
> } | null | null
> ```

> [accordion] lapsed\_subscription full type
>
> ```ts theme={null}
> {
>   plan?: string | null,
>   display_name?: string | null,
>   status?: string | null,
>   plan_amount_cents?: number | null | null,
>   plan_amount_interval?: string | null | null
> } | null | null
> ```

***

### createCheckoutSession

`billing.createCheckoutSession`

Creates a Stripe Checkout URL for subscribing to a `plan`, returning to `success_url` or `cancel_url`. The user pays in the browser.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.billing.createCheckoutSession({ plan: 'free', success_url: 'https://example.com/inkbox', cancel_url: 'https://example.com/inkbox' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `plan` | `free \| hobbyist \| developer \| startup \| enterprise` | Yes | — |
| `startup_variant` | `outbound` | No | Startup only: the supported \$200 dedicated-line option. The fixed value is 'outbound'; ignored for other plans. |
| `interval` | `month \| year` | No | — |
| `success_url` | `string` | Yes | Absolute URL Stripe returns to after a completed checkout. Must be https on an inkbox.ai host (localhost allowed in dev). |
| `cancel_url` | `string` | Yes | Absolute URL Stripe returns to if the user cancels checkout. Same host restrictions as success\_url. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | Stripe Checkout session URL. |

***

### createPortalSession

`billing.createPortalSession`

Creates a Stripe billing portal URL where a person manages the organization's billing, returning to `return_url` afterwards.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.billing.createPortalSession({ return_url: 'https://example.com/inkbox' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `return_url` | `string` | Yes | Absolute URL Stripe returns to when the user leaves the billing portal. Must be https on an inkbox.ai host (localhost allowed in dev). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | Stripe billing portal session URL. |

***

### getPricing

`billing.getPricing`

Returns usage rates and recurring add-on prices, with the organization's contracted price where one applies.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.getPricing({});
```

**Input:** *empty object*

**Output**

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

> [accordion] prices full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   name?: string | null,
>   kind?: string | null,
>   unit?: string | null,
>   currency?: string | null,
>   published_amount?: string | null,
>   amount?: string | null | null,
>   pricing_state?: string | null
> }[] | null
> ```

***

### getSubscription

`billing.getSubscription`

Returns the organization's plan, status, billing interval, pending changes and entitlements, including whether custom email signatures are available.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.getSubscription({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `billing_account_available` | `boolean \| null` | No | Whether payment-method and invoice management is available. |
| `plan` | `string \| null` | No | — |
| `status` | `string \| null \| null` | No | Stripe subscription status (active, past\_due, ...) or None on Free. |
| `cancel_at_period_end` | `boolean \| null` | No | Whether the subscription is set to cancel at the period boundary. |
| `current_period_end` | `number \| null \| null` | No | Unix seconds when the current monthly usage cycle ends, if subscribed. Allowances reset and usage is billed at this boundary. |
| `billing_interval` | `string \| null \| null` | No | How often the plan fee renews ('month' or 'year'); None on Free. |
| `plan_period_end` | `number \| null \| null` | No | Unix seconds when the plan fee next renews. Equals current\_period\_end on monthly plans; up to a year out on yearly plans. |
| `pending_plan` | `string \| null \| null` | No | Plan the subscription will switch to at period end (FREE = scheduled cancel), if any. |
| `pending_change_date` | `number \| null \| null` | No | Unix seconds when the pending plan change / cancellation takes effect. |
| `pending_startup_variant` | `string \| null \| null` | No | When the pending plan is Startup: which flat-price variant the scheduled switch lands on. None otherwise. |
| `pending_billing_interval` | `string \| null \| null` | No | Renewal cadence of the pending paid plan, if a switch is scheduled. |
| `legacy_developer_price` | `boolean \| null` | No | True when the subscription's flat price is the retired \$25 Developer price (sunset migration pending); the console surfaces the phase-out banner from this. |
| `stripe_configured` | `boolean \| null` | No | False when Stripe isn't configured server-side; the UI hides upgrade actions. |
| `annual_billing_available` | `boolean \| null` | No | Whether yearly plan billing can be selected. |
| `balance` | `number \| null \| null` | No | Stripe customer account balance in cents (negative = credit available, positive = amount owed). None on Free with no customer yet, or if the read failed. |
| `estimated_next_bill` | `number \| null \| null` | No | Amount due in cents on the upcoming invoice (plan fee + metered overage accrued so far this cycle), net of any account credit. None when there's no subscription (Free) or the preview read failed. |
| `mail_custom_signatures_enabled` | `boolean \| null` | No | Whether custom email signatures are available to this organization, including account-specific overrides, regardless of subscription status. |
| `entitlements` | `object \| null` | No | Resolved organization entitlements, including additional grants on Free. May be absent from plan-change responses. |
| `lapsed_subscription` | `object \| null` | No | On Free only: a plan subscription that is unpaid, incomplete or paused and still needs the customer to act. Informational; it grants no plan, and `plan` and `status` keep describing the organization's effective billing state. |

> [accordion] entitlements full type
>
> ```ts theme={null}
> {
>   is_custom?: boolean | null,
>   display_name?: string | null,
>   plan_amount_cents?: number | null | null,
>   plan_amount_interval?: string | null | null,
>   phone_numbers?: number | null,
>   sending_domains?: number | null,
>   identities?: number | null | null,
>   mail_custom_signatures_enabled?: boolean | null,
>   mail_storage_bytes_per_identity?: number | null,
>   imessage_messages_per_org_per_cycle?: number | null,
>   imessage_dedicated_messages_per_org_per_cycle?: number | null | null,
>   startup_variant?: string | null | null,
>   imessage_unique_recipients_per_agent_identity?: number | null,
>   sms_allowance_per_identity?: number | null,
>   voice_sec_allowance_per_identity?: number | null,
>   allowance_scope?: string | null,
>   sms_allowance_per_org_per_cycle?: number | null,
>   voice_sec_allowance_per_org_per_cycle?: number | null,
>   imessage_lines?: number | null,
>   imessage_lines_used?: number | null,
>   imessage_personal_lines?: number | null,
>   imessage_shared_lines?: number | null,
>   imessage_router_lines?: number | null,
>   imessage_enabled?: boolean | null,
>   dedicated_imessage_inbound_lines?: number | null | null,
>   dedicated_imessage_outbound_lines?: number | null | null,
>   imessage_included_messages_per_cycle?: number | null | null,
>   imessage_overage_cents_per_million?: number | null | null,
>   campaign_fee_cents?: number | null | null,
>   campaign_fee_active?: boolean | null,
>   voice_packs?: {
>     pack?: string | null,
>     minutes?: number | null,
>     price_cents?: number | null,
>     quantity?: number | null,
>     ending_quantity?: number | null | null,
>     ending_at?: number | null | null
>   }[] | null | null,
>   other_recurring_items?: {
>     name?: string | null,
>     quantity?: number | null,
>     amount_cents?: number | null | null,
>     interval?: string | null | null
>   }[] | null
> } | null | null
> ```

> [accordion] lapsed\_subscription full type
>
> ```ts theme={null}
> {
>   plan?: string | null,
>   display_name?: string | null,
>   status?: string | null,
>   plan_amount_cents?: number | null | null,
>   plan_amount_interval?: string | null | null
> } | null | null
> ```

***

### getUsage

`billing.getUsage`

Returns organization usage for the current billing cycle (SMS/MMS, call seconds, iMessage, storage, identities) by channel and identity, with remaining allowances and overage.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.getUsage({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `storage` | `object \| null` | No | — |
| `cycle_start` | `number \| null` | No | Unix seconds for the start of the current usage cycle. |
| `cycle_end` | `number \| null \| null` | No | Unix seconds for the end of the current usage cycle (Stripe period end, or the calendar-month boundary for orgs with no subscription). |
| `plan` | `string \| null` | No | Org's current plan (free/hobbyist/developer/startup/enterprise). |
| `channels` | `object[] \| null` | No | Org-wide totals, one per channel with usage this cycle. |
| `identities` | `object[] \| null` | No | Per-identity usage breakdown. |
| `sms_allowance_per_identity` | `number \| null` | No | Deprecated compatibility field; zero because allowances are shared by the organization. |
| `voice_sec_allowance_per_identity` | `number \| null` | No | Deprecated compatibility field; zero because allowances are shared by the organization. |
| `allowance_scope` | `string \| null` | No | — |
| `sms_allowance_per_org_per_cycle` | `number \| null` | No | SMS/MMS included across the organization per billing cycle. |
| `voice_sec_allowance_per_org_per_cycle` | `number \| null` | No | Voice seconds included across the organization per billing cycle. |
| `sms_allowance_used` | `number \| null` | No | Debits against the shared SMS/MMS allowance. |
| `voice_sec_allowance_used` | `number \| null` | No | Debits against the shared voice allowance, in seconds. |
| `sms_allowance_remaining` | `number \| null` | No | Shared included SMS/MMS remaining. |
| `voice_sec_allowance_remaining` | `number \| null` | No | Shared included voice seconds remaining, before minute packs. |
| `sms_allowance_credit` | `number \| null` | No | Additional included SMS/MMS preserved for this cycle. |
| `voice_sec_allowance_credit` | `number \| null` | No | Additional included voice seconds preserved for this cycle. |
| `overage_cap_cents` | `number \| null \| null` | No | Org's monthly SMS+voice overage spend limit in cents; None when unset. |
| `overage_spend_cents` | `number \| null \| null` | No | Contract-priced SMS and voice overage in cents; null when historical pricing is unavailable. |
| `imessage_shared_messages` | `number \| null` | No | Shared-pool iMessage messages this cycle (both directions) — the count the plan's shared iMessage cap is enforced against. |
| `imessage_dedicated_messages` | `number \| null` | No | Dedicated-line iMessage messages this cycle (both directions) — the count the dedicated-line cap is enforced against. |
| `imessage_messages_per_org_per_cycle` | `number \| null` | No | Resolved shared-service iMessage message limit per billing cycle; zero means no allowance. |
| `imessage_dedicated_messages_per_org_per_cycle` | `number \| null` | No | Resolved dedicated-line iMessage message limit per billing cycle; zero means no allowance. |
| `imessage_unique_recipients` | `number \| null` | No | Unique shared-pool iMessage recipients this cycle. Reported only; recipients are capped per agent when they connect. |
| `identities_used` | `number \| null` | No | Non-deleted agent identities in the org — the count the plan's identity cap is enforced against on create. |
| `identities_included` | `number \| null` | No | Effective identity capacity, including grants and covered identity packs. |
| `identities_baseline` | `number \| null` | No | Resolved identity capacity before identity packs. |
| `identity_pack_slots` | `number \| null` | No | Additional identity slots with paid or renewal-processing coverage. |
| `voice_pack_sec_granted` | `number \| null` | No | Voice seconds available this cycle from minute packs, shared across the org. Drawn after each identity's included allowance and before overage. |
| `voice_pack_sec_used` | `number \| null` | No | Minute-pack voice seconds used so far this cycle. |

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   items?: {
>     id?: string | null,
>     agent_identity_id?: string | null | null,
>     email_address?: string | null,
>     storage_used_bytes?: number | null,
>     storage_limit_bytes?: number | null | null
>   }[] | null,
>   next_cursor?: string | null | null,
>   used_bytes?: number | null,
>   capacity_bytes?: number | null | null,
>   mailbox_count?: number | null,
>   full_mailbox_count?: number | null,
>   max_usage_percent?: number | null | null
> } | null | null
> ```

> [accordion] channels full type
>
> ```ts theme={null}
> {
>   event_type?: string | null,
>   count?: number | null,
>   overage?: number | null,
>   est_overage_cents?: number | null | null,
>   own_campaign_count?: number | null | null
> }[] | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   identity_id?: string | null | null,
>   handle?: string | null | null,
>   display_name?: string | null | null,
>   channels?: {
>     event_type?: string | null,
>     count?: number | null,
>     own_campaign_count?: number | null | null
>   }[] | null,
>   sms_used?: number | null | null,
>   sms_limit?: number | null | null,
>   voice_sec_used?: number | null | null,
>   voice_sec_limit?: number | null | null
> }[] | null
> ```

***

### identityPacks.buy

`billing.identityPacks.buy`

Buys an identity pack (extra agent identity slots) with an accepted `quote` and a new `request_key`, charging the organization; may return a `payment_url`. Requires an admin API key.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.identityPacks.buy({ quote: 'example', request_key: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `quote` | `string` | Yes | — |
| `request_key` | `string` | Yes | — |

**Output**

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

***

### identityPacks.change

`billing.identityPacks.change`

Cancels or resumes renewal of an identity-pack agreement (`action`: cancel or resume), with a unique `request_key`.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.identityPacks.change({ agreement_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', action: 'cancel', request_key: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agreement_id` | `string` | Yes | — |
| `action` | `cancel \| resume` | Yes | — |
| `request_key` | `string` | Yes | — |

**Output**

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

***

### identityPacks.list

`billing.identityPacks.list`

Lists the identity-pack offer, the organization's identity-pack agreements, identity capacity and whether it is eligible to buy.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.identityPacks.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `offer` | `object \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `capacity` | `object \| null` | No | — |
| `mail_storage_bytes_per_identity` | `number \| null` | No | — |
| `billing_account_available` | `boolean \| null` | No | — |
| `payment_method_available` | `boolean \| null` | No | — |
| `eligible` | `boolean \| null` | No | — |
| `eligibility_reason` | `string \| null \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] offer full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   identity_slots?: number | null
> } | null | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   code?: string | null,
>   name?: string | null,
>   monthly_amount?: string | null,
>   currency?: string | null,
>   status?: string | null,
>   paid_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null,
>   renewal_processing?: boolean | null,
>   payment_url?: string | null | null,
>   can_cancel?: boolean | null,
>   can_resume?: boolean | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] capacity full type
>
> ```ts theme={null}
> {
>   used?: number | null,
>   baseline?: number | null,
>   paid_slots?: number | null,
>   processing_slots?: number | null,
>   total?: number | null,
>   renewing_packs?: number | null,
>   paid_packs?: number | null
> } | null
> ```

***

### identityPacks.quote

`billing.identityPacks.quote`

Quotes the price of an identity pack (extra identity slots) and returns a `quote` token for buying it. Does not charge.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.identityPacks.quote({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `monthly_amount` | `string \| null` | No | — |
| `currency` | `string \| null` | No | — |
| `identity_slots` | `number \| null` | No | — |
| `quote` | `string \| null` | No | — |
| `expires_at` | `number \| null` | No | — |
| `amount_due_cents` | `number \| null` | No | — |
| `invoice_total_cents` | `number \| null` | No | — |
| `pack_amount_cents` | `number \| null` | No | — |
| `renewal_at` | `number \| null \| null` | No | — |
| `payment_mode` | `string \| null` | No | — |
| `payment_method_available` | `boolean \| null` | No | — |

***

### lineBundles.buy

`billing.lineBundles.buy`

Buys a line bundle (`code`: a VoIP or personal iMessage line slot plus voice and SMS credits) with an accepted `quote` and `request_key`, charging the organization. Assigns no number; admin key only.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.lineBundles.buy({ code: 'voip_line_bundle', quote: 'example', request_key: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `voip_line_bundle \| personal_imessage_line_bundle` | Yes | — |
| `quote` | `string` | Yes | — |
| `request_key` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `offers` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `voice_seconds_remaining` | `number \| null` | No | — |
| `messages_remaining` | `number \| null` | No | — |
| `capacity` | `object \| null` | No | — |

> [accordion] offers full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   name?: string | null,
>   line_kind?: string | null,
>   monthly_amount?: string | null,
>   voice_seconds?: number | null,
>   messages?: number | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   code?: string | null,
>   name?: string | null,
>   line_kind?: string | null,
>   monthly_amount?: string | null,
>   status?: string | null,
>   paid_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null
> }[] | null
> ```

> [accordion] capacity full type
>
> ```ts theme={null}
> {
>   voip?: number | null,
>   imessage?: number | null
> } | null
> ```

***

### lineBundles.change

`billing.lineBundles.change`

Cancels or resumes a line-bundle agreement (`action`). Canceling removes an unused line slot immediately with no refund.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.lineBundles.change({ agreement_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', action: 'cancel' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agreement_id` | `string` | Yes | — |
| `action` | `cancel \| resume` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `offers` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `voice_seconds_remaining` | `number \| null` | No | — |
| `messages_remaining` | `number \| null` | No | — |
| `capacity` | `object \| null` | No | — |

> [accordion] offers full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   name?: string | null,
>   line_kind?: string | null,
>   monthly_amount?: string | null,
>   voice_seconds?: number | null,
>   messages?: number | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   code?: string | null,
>   name?: string | null,
>   line_kind?: string | null,
>   monthly_amount?: string | null,
>   status?: string | null,
>   paid_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null
> }[] | null
> ```

> [accordion] capacity full type
>
> ```ts theme={null}
> {
>   voip?: number | null,
>   imessage?: number | null
> } | null
> ```

***

### lineBundles.list

`billing.lineBundles.list`

Lists line-bundle offers, the organization's bundle agreements, and remaining bundle voice seconds and messages.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.lineBundles.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `offers` | `object[] \| null` | No | — |
| `agreements` | `object[] \| null` | No | — |
| `voice_seconds_remaining` | `number \| null` | No | — |
| `messages_remaining` | `number \| null` | No | — |
| `capacity` | `object \| null` | No | — |

> [accordion] offers full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   name?: string | null,
>   line_kind?: string | null,
>   monthly_amount?: string | null,
>   voice_seconds?: number | null,
>   messages?: number | null
> }[] | null
> ```

> [accordion] agreements full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   code?: string | null,
>   name?: string | null,
>   line_kind?: string | null,
>   monthly_amount?: string | null,
>   status?: string | null,
>   paid_through?: string | null | null,
>   cancel_at_period_end?: boolean | null,
>   change_pending?: boolean | null
> }[] | null
> ```

> [accordion] capacity full type
>
> ```ts theme={null}
> {
>   voip?: number | null,
>   imessage?: number | null
> } | null
> ```

***

### lineBundles.quote

`billing.lineBundles.quote`

Quotes the prorated price and credits of a line bundle (`code`) and returns a `quote` token for buying it. Does not charge.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.lineBundles.quote({ code: 'voip_line_bundle' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `voip_line_bundle \| personal_imessage_line_bundle` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `quote` | `string \| null` | No | — |
| `expires_at` | `number \| null` | No | — |
| `code` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `monthly_amount` | `string \| null` | No | — |
| `bundle_amount_cents` | `number \| null` | No | — |
| `amount_due_cents` | `number \| null` | No | — |
| `invoice_total_cents` | `number \| null` | No | — |
| `currency` | `string \| null` | No | — |
| `voice_seconds` | `number \| null` | No | — |
| `messages` | `number \| null` | No | — |
| `period_end` | `string \| null` | No | — |

***

### settings.get

`billing.settings.get`

Returns the organization's monthly SMS and voice overage spending cap and whether the 'Sent via Inkbox' email footer is removed.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.settings.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `overage_cap_cents` | `number \| null \| null` | No | Monthly SMS+voice overage spend limit in cents; None = no limit. Once cycle-to-date overage spend reaches it, overage-incurring sends and calls are refused (402) until the cycle resets or the limit is raised. Usage within included allowances is never blocked; inbound and in-flight usage can exceed the limit slightly. |
| `remove_branding_footer` | `boolean \| null` | No | When true and the organization is on a paid plan, outbound emails omit the 'Sent via Inkbox' footer. Automatically set to true when upgrading from Free to any paid plan. On the Free plan the footer always applies. |

***

### settings.update

`billing.settings.update`

Sets the monthly SMS/voice overage cap (`overage_cap_cents`; null clears it, 0 blocks overage) and/or `remove_branding_footer` (paid plans only).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.billing.settings.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `overage_cap_cents` | `number \| null` | No | Monthly SMS+voice overage spend limit in cents. Omit to leave unchanged; null clears the limit; 0 blocks all overage-incurring sends and calls. |
| `remove_branding_footer` | `boolean \| null` | No | Set true to remove the 'Sent via Inkbox' footer from outbound emails (paid plans only; 403 on Free). Omit or null to leave unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `overage_cap_cents` | `number \| null \| null` | No | Monthly SMS+voice overage spend limit in cents; None = no limit. Once cycle-to-date overage spend reaches it, overage-incurring sends and calls are refused (402) until the cycle resets or the limit is raised. Usage within included allowances is never blocked; inbound and in-flight usage can exceed the limit slightly. |
| `remove_branding_footer` | `boolean \| null` | No | When true and the organization is on a paid plan, outbound emails omit the 'Sent via Inkbox' footer. Automatically set to true when upgrading from Free to any paid plan. On the Free plan the footer always applies. |

***

### setVoicePacks

`billing.setVoicePacks`

Sets how many call-minute packs of one size the organization holds (`pack`, `quantity`; 0 removes them); increases are invoiced immediately. Paid plans and admin key only.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.billing.setVoicePacks({ pack: 'minutes_250', quantity: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pack` | `minutes_250 \| minutes_2000` | Yes | — |
| `quantity` | `number` | Yes | Desired number of this pack; 0 removes it. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `packs` | `object[] \| null` | No | Every pack size with the org's quantity. |
| `voice_pack_sec_granted` | `number \| null` | No | Voice seconds available this cycle from minute packs. |
| `voice_pack_sec_used` | `number \| null` | No | Minute-pack voice seconds used so far this cycle. |

> [accordion] packs full type
>
> ```ts theme={null}
> {
>   pack?: string | null,
>   minutes?: number | null,
>   price_cents?: number | null,
>   quantity?: number | null,
>   ending_quantity?: number | null | null,
>   ending_at?: number | null | null
> }[] | null
> ```

***

### usageAlerts.delete

`billing.usageAlerts.delete`

Deletes a usage alert override (`rule_id`), restoring the default 90% alert for that quota when no other overrides remain.

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

```ts theme={null}
await corsair.inkbox.api.billing.usageAlerts.delete({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |

**Output**

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

***

### usageAlerts.list

`billing.usageAlerts.list`

Lists the organization's usage email alerts (identities, storage, SMS, voice, overage) with thresholds and whether each is a default.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.billing.usageAlerts.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   metric?: string | null,
>   threshold?: number | null,
>   mailbox_id?: string | null | null,
>   enabled?: boolean | null,
>   is_default?: boolean | null,
>   id?: string | null
> }[]
> ```

***

### usageAlerts.save

`billing.usageAlerts.save`

Creates or updates a usage email alert (`rule_id`; a new UUID adds one) for a `metric` at a percentage `threshold`, optionally for one `mailbox_id` (storage).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.billing.usageAlerts.save({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', metric: 'identities', threshold: 100 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `metric` | `identities \| storage \| sms \| voice \| overage` | Yes | — |
| `threshold` | `number` | Yes | — |
| `mailbox_id` | `string \| null` | No | — |
| `enabled` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `metric` | `string \| null` | No | — |
| `threshold` | `number \| null` | No | — |
| `mailbox_id` | `string \| null \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `is_default` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |

***

## Compliance

### brand.delete

`compliance.brand.delete`

Deletes the organization's 10DLC brand registration. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.compliance.brand.delete({});
```

**Input:** *empty object*

**Output**

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

***

### brand.get

`compliance.brand.get`

Returns the organization's 10DLC brand registration and its current verification status.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.compliance.brand.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandRelationship` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `entityType` | `string \| null` | No | — |
| `vertical` | `string \| null` | No | — |
| `altBusinessId` | `string \| null \| null` | No | — |
| `altBusinessIdType` | `string \| null \| null` | No | — |
| `brandId` | `string \| null \| null` | No | — |
| `businessContactEmail` | `string \| null \| null` | No | — |
| `city` | `string \| null \| null` | No | — |
| `companyName` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null \| null` | No | — |
| `cspId` | `string \| null \| null` | No | — |
| `ein` | `string \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `firstName` | `string \| null \| null` | No | — |
| `identityStatus` | `string \| null \| null` | No | — |
| `ipAddress` | `string \| null \| null` | No | — |
| `isReseller` | `boolean \| null \| null` | No | — |
| `lastName` | `string \| null \| null` | No | — |
| `mobilePhone` | `string \| null \| null` | No | — |
| `mock` | `boolean \| null \| null` | No | — |
| `optionalAttributes` | `object \| null` | No | — |
| `phone` | `string \| null \| null` | No | — |
| `postalCode` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `state` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `stockExchange` | `string \| null \| null` | No | — |
| `stockSymbol` | `string \| null \| null` | No | — |
| `street` | `string \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `universalEin` | `string \| null \| null` | No | — |
| `updatedAt` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |
| `website` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

> [accordion] optionalAttributes full type
>
> ```ts theme={null}
> {
>   taxExemptStatus?: string | null | null
> } | null | null
> ```

***

### brand.register

`compliance.brand.register`

Registers the organization's 10DLC brand (business details for US SMS) for verification. One brand per organization; asynchronous, so check its status afterwards.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.compliance.brand.register({
	entity_type: 'PRIVATE_PROFIT',
	display_name: 'example',
	email: 'ada@example.com',
	vertical: 'PROFESSIONAL',
	country: 'US',
	phone: '+14155550123',
	website: 'example',
	street: 'example',
	city: 'example',
	state: 'example',
	postal_code: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_type` | `PRIVATE_PROFIT \| PUBLIC_PROFIT \| NON_PROFIT \| GOVERNMENT \| SOLE_PROPRIETOR` | Yes | — |
| `display_name` | `string` | Yes | — |
| `email` | `string` | Yes | — |
| `vertical` | `PROFESSIONAL \| REAL_ESTATE \| HEALTHCARE \| HUMAN_RESOURCES \| ENERGY \| ENTERTAINMENT \| RETAIL \| TRANSPORTATION \| AGRICULTURE \| INSURANCE \| POSTAL \| EDUCATION \| HOSPITALITY \| FINANCIAL \| POLITICAL \| GAMBLING \| LEGAL \| CONSTRUCTION \| NGO \| MANUFACTURING \| GOVERNMENT \| TECHNOLOGY \| COMMUNICATION` | Yes | — |
| `country` | `US \| CA` | Yes | — |
| `phone` | `string` | Yes | — |
| `website` | `string` | Yes | — |
| `street` | `string` | Yes | — |
| `city` | `string` | Yes | — |
| `state` | `string` | Yes | — |
| `postal_code` | `string` | Yes | — |
| `company_name` | `string \| null` | No | — |
| `ein` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `mobile_phone` | `string \| null` | No | — |
| `business_contact_email` | `string \| null` | No | — |
| `stock_symbol` | `string \| null` | No | — |
| `stock_exchange` | `NYSE \| NASDAQ \| AMEX \| AMX \| ASX \| B3 \| BME \| BSE \| FRA \| ICEX \| JPX \| JSE \| KRX \| LON \| NSE \| OMX \| SEHK \| SSE \| STO \| SWX \| SZSE \| TSX \| TWSE \| VSE \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandRelationship` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `entityType` | `string \| null` | No | — |
| `vertical` | `string \| null` | No | — |
| `altBusinessId` | `string \| null \| null` | No | — |
| `altBusinessIdType` | `string \| null \| null` | No | — |
| `brandId` | `string \| null \| null` | No | — |
| `businessContactEmail` | `string \| null \| null` | No | — |
| `city` | `string \| null \| null` | No | — |
| `companyName` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null \| null` | No | — |
| `cspId` | `string \| null \| null` | No | — |
| `ein` | `string \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `firstName` | `string \| null \| null` | No | — |
| `identityStatus` | `string \| null \| null` | No | — |
| `ipAddress` | `string \| null \| null` | No | — |
| `isReseller` | `boolean \| null \| null` | No | — |
| `lastName` | `string \| null \| null` | No | — |
| `mobilePhone` | `string \| null \| null` | No | — |
| `mock` | `boolean \| null \| null` | No | — |
| `optionalAttributes` | `object \| null` | No | — |
| `phone` | `string \| null \| null` | No | — |
| `postalCode` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `state` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `stockExchange` | `string \| null \| null` | No | — |
| `stockSymbol` | `string \| null \| null` | No | — |
| `street` | `string \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `universalEin` | `string \| null \| null` | No | — |
| `updatedAt` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |
| `website` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

> [accordion] optionalAttributes full type
>
> ```ts theme={null}
> {
>   taxExemptStatus?: string | null | null
> } | null | null
> ```

***

### brand.resendTwoFactorEmail

`compliance.brand.resendTwoFactorEmail`

Resends the verification (2FA) email for the organization's 10DLC brand.

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

```ts theme={null}
await corsair.inkbox.api.compliance.brand.resendTwoFactorEmail({});
```

**Input:** *empty object*

**Output**

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

***

### brand.sendSmsOtp

`compliance.brand.sendSmsOtp`

Texts a one-time PIN to the brand's phone to verify a sole-proprietor 10DLC brand; confirm it with `compliance.brand.verifySmsOtp`.

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

```ts theme={null}
await corsair.inkbox.api.compliance.brand.sendSmsOtp({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brand_id` | `string \| null` | No | The registry-side brand UUID the OTP was triggered for. |
| `reference_id` | `string \| null` | No | Carrier-registry reference id for this OTP attempt. Useful for debugging if a customer reports they never received the SMS. |

***

### brand.update

`compliance.brand.update`

Replaces the organization's 10DLC brand details; all required business fields must be sent again. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.compliance.brand.update({
	country: 'US',
	display_name: 'example',
	email: 'ada@example.com',
	entity_type: 'PRIVATE_PROFIT',
	vertical: 'PROFESSIONAL',
	phone: '+14155550123',
	website: 'example',
	street: 'example',
	city: 'example',
	state: 'example',
	postal_code: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `country` | `US \| CA` | Yes | — |
| `display_name` | `string` | Yes | — |
| `email` | `string` | Yes | — |
| `entity_type` | `PRIVATE_PROFIT \| PUBLIC_PROFIT \| NON_PROFIT \| GOVERNMENT \| SOLE_PROPRIETOR` | Yes | — |
| `vertical` | `PROFESSIONAL \| REAL_ESTATE \| HEALTHCARE \| HUMAN_RESOURCES \| ENERGY \| ENTERTAINMENT \| RETAIL \| TRANSPORTATION \| AGRICULTURE \| INSURANCE \| POSTAL \| EDUCATION \| HOSPITALITY \| FINANCIAL \| POLITICAL \| GAMBLING \| LEGAL \| CONSTRUCTION \| NGO \| MANUFACTURING \| GOVERNMENT \| TECHNOLOGY \| COMMUNICATION` | Yes | — |
| `phone` | `string` | Yes | — |
| `website` | `string` | Yes | — |
| `street` | `string` | Yes | — |
| `city` | `string` | Yes | — |
| `state` | `string` | Yes | — |
| `postal_code` | `string` | Yes | — |
| `alt_business_id` | `string \| null` | No | — |
| `alt_business_id_type` | `DUNS \| GIIN \| LEI \| null` | No | — |
| `company_name` | `string \| null` | No | — |
| `ein` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `business_contact_email` | `string \| null` | No | — |
| `stock_symbol` | `string \| null` | No | — |
| `stock_exchange` | `NYSE \| NASDAQ \| AMEX \| AMX \| ASX \| B3 \| BME \| BSE \| FRA \| ICEX \| JPX \| JSE \| KRX \| LON \| NSE \| OMX \| SEHK \| SSE \| STO \| SWX \| SZSE \| TSX \| TWSE \| VSE \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandRelationship` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `entityType` | `string \| null` | No | — |
| `vertical` | `string \| null` | No | — |
| `altBusinessId` | `string \| null \| null` | No | — |
| `altBusinessIdType` | `string \| null \| null` | No | — |
| `brandId` | `string \| null \| null` | No | — |
| `businessContactEmail` | `string \| null \| null` | No | — |
| `city` | `string \| null \| null` | No | — |
| `companyName` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null \| null` | No | — |
| `cspId` | `string \| null \| null` | No | — |
| `ein` | `string \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `firstName` | `string \| null \| null` | No | — |
| `identityStatus` | `string \| null \| null` | No | — |
| `ipAddress` | `string \| null \| null` | No | — |
| `isReseller` | `boolean \| null \| null` | No | — |
| `lastName` | `string \| null \| null` | No | — |
| `mobilePhone` | `string \| null \| null` | No | — |
| `mock` | `boolean \| null \| null` | No | — |
| `optionalAttributes` | `object \| null` | No | — |
| `phone` | `string \| null \| null` | No | — |
| `postalCode` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `state` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `stockExchange` | `string \| null \| null` | No | — |
| `stockSymbol` | `string \| null \| null` | No | — |
| `street` | `string \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `universalEin` | `string \| null \| null` | No | — |
| `updatedAt` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |
| `website` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

> [accordion] optionalAttributes full type
>
> ```ts theme={null}
> {
>   taxExemptStatus?: string | null | null
> } | null | null
> ```

***

### brand.verifySmsOtp

`compliance.brand.verifySmsOtp`

Verifies the 10DLC brand with the one-time PIN (`otp_pin`) received by SMS.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.compliance.brand.verifySmsOtp({ otp_pin: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `otp_pin` | `string` | Yes | One-time PIN the customer received via SMS. |

**Output**

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

***

### campaign.delete

`compliance.campaign.delete`

Deletes the organization's 10DLC campaign, which also stops its monthly fee. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.delete({});
```

**Input:** *empty object*

**Output**

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

***

### campaign.get

`compliance.campaign.get`

Returns the organization's 10DLC campaign and its carrier review status (`campaignStatus`).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `cspId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `mock` | `boolean \| null` | No | — |
| `subUsecases` | `string[] \| null` | No | — |
| `termsAndConditions` | `boolean \| null` | No | — |
| `usecase` | `string \| null` | No | — |
| `ageGated` | `boolean \| null \| null` | No | — |
| `autoRenewal` | `boolean \| null \| null` | No | — |
| `billedDate` | `string \| null \| null` | No | — |
| `brandDisplayName` | `string \| null \| null` | No | — |
| `campaignStatus` | `string \| null \| null` | No | Campaign status |
| `createDate` | `string \| null \| null` | No | — |
| `directLending` | `boolean \| null \| null` | No | — |
| `embeddedLink` | `boolean \| null \| null` | No | — |
| `embeddedLinkSample` | `string \| null \| null` | No | — |
| `embeddedPhone` | `boolean \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `helpKeywords` | `string \| null \| null` | No | — |
| `helpMessage` | `string \| null \| null` | No | — |
| `isTMobileNumberPoolingEnabled` | `boolean \| null \| null` | No | — |
| `isTMobileRegistered` | `boolean \| null \| null` | No | — |
| `isTMobileSuspended` | `boolean \| null \| null` | No | — |
| `messageFlow` | `string \| null \| null` | No | — |
| `nextRenewalOrExpirationDate` | `string \| null \| null` | No | — |
| `numberPool` | `boolean \| null \| null` | No | — |
| `optinKeywords` | `string \| null \| null` | No | — |
| `optinMessage` | `string \| null \| null` | No | — |
| `optoutKeywords` | `string \| null \| null` | No | — |
| `optoutMessage` | `string \| null \| null` | No | — |
| `privacyPolicyLink` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `resellerId` | `string \| null \| null` | No | — |
| `sample1` | `string \| null \| null` | No | — |
| `sample2` | `string \| null \| null` | No | — |
| `sample3` | `string \| null \| null` | No | — |
| `sample4` | `string \| null \| null` | No | — |
| `sample5` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `submissionStatus` | `string \| null \| null` | No | — |
| `subscriberHelp` | `boolean \| null \| null` | No | — |
| `subscriberOptin` | `boolean \| null \| null` | No | — |
| `subscriberOptout` | `boolean \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `tcrCampaignId` | `string \| null \| null` | No | — |
| `termsAndConditionsLink` | `string \| null \| null` | No | — |
| `vertical` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

***

### campaign.getActive

`compliance.campaign.getActive`

Returns whether the organization has selected its own 10DLC campaign (`active: true`) or Inkbox's default campaign.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.getActive({});
```

**Input:** *empty object*

**Output**

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

***

### campaign.register

`compliance.campaign.register`

Submits the organization's 10DLC campaign (use case, sample messages, opt-in/opt-out keywords, policy links) for carrier review. Costs \$20/month once approved.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.register({
	brand_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	usecase: 'ACCOUNT_NOTIFICATION',
	description: 'examplexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
	message_flow: 'examplexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
	help_message: 'examplexxxxxxxxxxxxx',
	sample1: 'examplexxxxxxxxxxxxx',
	sample2: 'examplexxxxxxxxxxxxx',
	sample3: 'examplexxxxxxxxxxxxx',
	sample4: 'examplexxxxxxxxxxxxx',
	optin_keywords: 'example',
	optout_keywords: 'example',
	help_keywords: 'example',
	optin_message: 'examplexxxxxxxxxxxxx',
	optout_message: 'examplexxxxxxxxxxxxx',
	privacy_policy_link: 'example',
	terms_and_conditions_link: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `brand_id` | `string` | Yes | — |
| `usecase` | `ACCOUNT_NOTIFICATION \| AGENTS_FRANCHISES \| CARRIER_EXEMPT \| CHARITY \| CUSTOMER_CARE \| DELIVERY_NOTIFICATION \| EMERGENCY \| FRAUD_ALERT \| HIGHER_EDUCATION \| K12_EDUCATION \| LOW_VOLUME \| MARKETING \| MIXED \| POLITICAL \| POLLING_VOTING \| PROXY \| PUBLIC_SAFETY_RESTRICTED \| PUBLIC_SERVICE_ANNOUNCEMENT \| SECURITY_ALERT \| SOCIAL \| SWEEPSTAKE \| 2FA \| UCAAS_LOW \| M2M \| SOLE_PROPRIETOR \| TRIAL \| UCAAS_HIGH` | Yes | — |
| `description` | `string` | Yes | — |
| `message_flow` | `string` | Yes | — |
| `help_message` | `string` | Yes | — |
| `sample1` | `string` | Yes | — |
| `sample2` | `string` | Yes | — |
| `sample3` | `string` | Yes | — |
| `sample4` | `string` | Yes | — |
| `sample5` | `string \| null` | No | — |
| `optin_keywords` | `string` | Yes | — |
| `optout_keywords` | `string` | Yes | — |
| `help_keywords` | `string` | Yes | — |
| `optin_message` | `string` | Yes | — |
| `optout_message` | `string` | Yes | — |
| `embedded_link` | `boolean` | No | — |
| `embedded_link_sample` | `string \| null` | No | — |
| `embedded_phone` | `boolean` | No | — |
| `age_gated` | `boolean` | No | — |
| `direct_lending` | `boolean` | No | — |
| `privacy_policy_link` | `string` | Yes | — |
| `terms_and_conditions_link` | `string` | Yes | — |
| `sub_usecases` | `string[] \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `cspId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `mock` | `boolean \| null` | No | — |
| `subUsecases` | `string[] \| null` | No | — |
| `termsAndConditions` | `boolean \| null` | No | — |
| `usecase` | `string \| null` | No | — |
| `ageGated` | `boolean \| null \| null` | No | — |
| `autoRenewal` | `boolean \| null \| null` | No | — |
| `billedDate` | `string \| null \| null` | No | — |
| `brandDisplayName` | `string \| null \| null` | No | — |
| `campaignStatus` | `string \| null \| null` | No | Campaign status |
| `createDate` | `string \| null \| null` | No | — |
| `directLending` | `boolean \| null \| null` | No | — |
| `embeddedLink` | `boolean \| null \| null` | No | — |
| `embeddedLinkSample` | `string \| null \| null` | No | — |
| `embeddedPhone` | `boolean \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `helpKeywords` | `string \| null \| null` | No | — |
| `helpMessage` | `string \| null \| null` | No | — |
| `isTMobileNumberPoolingEnabled` | `boolean \| null \| null` | No | — |
| `isTMobileRegistered` | `boolean \| null \| null` | No | — |
| `isTMobileSuspended` | `boolean \| null \| null` | No | — |
| `messageFlow` | `string \| null \| null` | No | — |
| `nextRenewalOrExpirationDate` | `string \| null \| null` | No | — |
| `numberPool` | `boolean \| null \| null` | No | — |
| `optinKeywords` | `string \| null \| null` | No | — |
| `optinMessage` | `string \| null \| null` | No | — |
| `optoutKeywords` | `string \| null \| null` | No | — |
| `optoutMessage` | `string \| null \| null` | No | — |
| `privacyPolicyLink` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `resellerId` | `string \| null \| null` | No | — |
| `sample1` | `string \| null \| null` | No | — |
| `sample2` | `string \| null \| null` | No | — |
| `sample3` | `string \| null \| null` | No | — |
| `sample4` | `string \| null \| null` | No | — |
| `sample5` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `submissionStatus` | `string \| null \| null` | No | — |
| `subscriberHelp` | `boolean \| null \| null` | No | — |
| `subscriberOptin` | `boolean \| null \| null` | No | — |
| `subscriberOptout` | `boolean \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `tcrCampaignId` | `string \| null \| null` | No | — |
| `termsAndConditionsLink` | `string \| null \| null` | No | — |
| `vertical` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

***

### campaign.resubmit

`compliance.campaign.resubmit`

Replaces the 10DLC campaign with a complete new registration and a new campaign ID; local numbers return to Inkbox's default campaign during review.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.resubmit({
	brand_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	usecase: 'ACCOUNT_NOTIFICATION',
	description: 'examplexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
	message_flow: 'examplexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
	help_message: 'examplexxxxxxxxxxxxx',
	sample1: 'examplexxxxxxxxxxxxx',
	sample2: 'examplexxxxxxxxxxxxx',
	sample3: 'examplexxxxxxxxxxxxx',
	sample4: 'examplexxxxxxxxxxxxx',
	optin_keywords: 'example',
	optout_keywords: 'example',
	help_keywords: 'example',
	optin_message: 'examplexxxxxxxxxxxxx',
	optout_message: 'examplexxxxxxxxxxxxx',
	privacy_policy_link: 'example',
	terms_and_conditions_link: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `brand_id` | `string` | Yes | — |
| `usecase` | `ACCOUNT_NOTIFICATION \| AGENTS_FRANCHISES \| CARRIER_EXEMPT \| CHARITY \| CUSTOMER_CARE \| DELIVERY_NOTIFICATION \| EMERGENCY \| FRAUD_ALERT \| HIGHER_EDUCATION \| K12_EDUCATION \| LOW_VOLUME \| MARKETING \| MIXED \| POLITICAL \| POLLING_VOTING \| PROXY \| PUBLIC_SAFETY_RESTRICTED \| PUBLIC_SERVICE_ANNOUNCEMENT \| SECURITY_ALERT \| SOCIAL \| SWEEPSTAKE \| 2FA \| UCAAS_LOW \| M2M \| SOLE_PROPRIETOR \| TRIAL \| UCAAS_HIGH` | Yes | — |
| `description` | `string` | Yes | — |
| `message_flow` | `string` | Yes | — |
| `help_message` | `string` | Yes | — |
| `sample1` | `string` | Yes | — |
| `sample2` | `string` | Yes | — |
| `sample3` | `string` | Yes | — |
| `sample4` | `string` | Yes | — |
| `sample5` | `string \| null` | No | — |
| `optin_keywords` | `string` | Yes | — |
| `optout_keywords` | `string` | Yes | — |
| `help_keywords` | `string` | Yes | — |
| `optin_message` | `string` | Yes | — |
| `optout_message` | `string` | Yes | — |
| `embedded_link` | `boolean` | No | — |
| `embedded_link_sample` | `string \| null` | No | — |
| `embedded_phone` | `boolean` | No | — |
| `age_gated` | `boolean` | No | — |
| `direct_lending` | `boolean` | No | — |
| `privacy_policy_link` | `string` | Yes | — |
| `terms_and_conditions_link` | `string` | Yes | — |
| `sub_usecases` | `string[] \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `cspId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `mock` | `boolean \| null` | No | — |
| `subUsecases` | `string[] \| null` | No | — |
| `termsAndConditions` | `boolean \| null` | No | — |
| `usecase` | `string \| null` | No | — |
| `ageGated` | `boolean \| null \| null` | No | — |
| `autoRenewal` | `boolean \| null \| null` | No | — |
| `billedDate` | `string \| null \| null` | No | — |
| `brandDisplayName` | `string \| null \| null` | No | — |
| `campaignStatus` | `string \| null \| null` | No | Campaign status |
| `createDate` | `string \| null \| null` | No | — |
| `directLending` | `boolean \| null \| null` | No | — |
| `embeddedLink` | `boolean \| null \| null` | No | — |
| `embeddedLinkSample` | `string \| null \| null` | No | — |
| `embeddedPhone` | `boolean \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `helpKeywords` | `string \| null \| null` | No | — |
| `helpMessage` | `string \| null \| null` | No | — |
| `isTMobileNumberPoolingEnabled` | `boolean \| null \| null` | No | — |
| `isTMobileRegistered` | `boolean \| null \| null` | No | — |
| `isTMobileSuspended` | `boolean \| null \| null` | No | — |
| `messageFlow` | `string \| null \| null` | No | — |
| `nextRenewalOrExpirationDate` | `string \| null \| null` | No | — |
| `numberPool` | `boolean \| null \| null` | No | — |
| `optinKeywords` | `string \| null \| null` | No | — |
| `optinMessage` | `string \| null \| null` | No | — |
| `optoutKeywords` | `string \| null \| null` | No | — |
| `optoutMessage` | `string \| null \| null` | No | — |
| `privacyPolicyLink` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `resellerId` | `string \| null \| null` | No | — |
| `sample1` | `string \| null \| null` | No | — |
| `sample2` | `string \| null \| null` | No | — |
| `sample3` | `string \| null \| null` | No | — |
| `sample4` | `string \| null \| null` | No | — |
| `sample5` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `submissionStatus` | `string \| null \| null` | No | — |
| `subscriberHelp` | `boolean \| null \| null` | No | — |
| `subscriberOptin` | `boolean \| null \| null` | No | — |
| `subscriberOptout` | `boolean \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `tcrCampaignId` | `string \| null \| null` | No | — |
| `termsAndConditionsLink` | `string \| null \| null` | No | — |
| `vertical` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

***

### campaign.setActive

`compliance.campaign.setActive`

Switches the organization's local US numbers to its own approved 10DLC campaign (`active: true`) or back to Inkbox's default. Runs asynchronously.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.setActive({ active: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `active` | `boolean` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `active` | `boolean \| null` | No | — |
| `local_numbers_scheduled_for_migration` | `number \| null` | No | — |

***

### campaign.update

`compliance.campaign.update`

Updates the 10DLC campaign's `help_message`, `message_flow` and sample messages. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.compliance.campaign.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `help_message` | `string \| null` | No | — |
| `message_flow` | `string \| null` | No | — |
| `sample1` | `string \| null` | No | — |
| `sample2` | `string \| null` | No | — |
| `sample3` | `string \| null` | No | — |
| `sample4` | `string \| null` | No | — |
| `sample5` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `brandId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `cspId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `mock` | `boolean \| null` | No | — |
| `subUsecases` | `string[] \| null` | No | — |
| `termsAndConditions` | `boolean \| null` | No | — |
| `usecase` | `string \| null` | No | — |
| `ageGated` | `boolean \| null \| null` | No | — |
| `autoRenewal` | `boolean \| null \| null` | No | — |
| `billedDate` | `string \| null \| null` | No | — |
| `brandDisplayName` | `string \| null \| null` | No | — |
| `campaignStatus` | `string \| null \| null` | No | Campaign status |
| `createDate` | `string \| null \| null` | No | — |
| `directLending` | `boolean \| null \| null` | No | — |
| `embeddedLink` | `boolean \| null \| null` | No | — |
| `embeddedLinkSample` | `string \| null \| null` | No | — |
| `embeddedPhone` | `boolean \| null \| null` | No | — |
| `failureReasons` | `string \| object[] \| null` | No | — |
| `helpKeywords` | `string \| null \| null` | No | — |
| `helpMessage` | `string \| null \| null` | No | — |
| `isTMobileNumberPoolingEnabled` | `boolean \| null \| null` | No | — |
| `isTMobileRegistered` | `boolean \| null \| null` | No | — |
| `isTMobileSuspended` | `boolean \| null \| null` | No | — |
| `messageFlow` | `string \| null \| null` | No | — |
| `nextRenewalOrExpirationDate` | `string \| null \| null` | No | — |
| `numberPool` | `boolean \| null \| null` | No | — |
| `optinKeywords` | `string \| null \| null` | No | — |
| `optinMessage` | `string \| null \| null` | No | — |
| `optoutKeywords` | `string \| null \| null` | No | — |
| `optoutMessage` | `string \| null \| null` | No | — |
| `privacyPolicyLink` | `string \| null \| null` | No | — |
| `referenceId` | `string \| null \| null` | No | — |
| `resellerId` | `string \| null \| null` | No | — |
| `sample1` | `string \| null \| null` | No | — |
| `sample2` | `string \| null \| null` | No | — |
| `sample3` | `string \| null \| null` | No | — |
| `sample4` | `string \| null \| null` | No | — |
| `sample5` | `string \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `submissionStatus` | `string \| null \| null` | No | — |
| `subscriberHelp` | `boolean \| null \| null` | No | — |
| `subscriberOptin` | `boolean \| null \| null` | No | — |
| `subscriberOptout` | `boolean \| null \| null` | No | — |
| `tcrBrandId` | `string \| null \| null` | No | — |
| `tcrCampaignId` | `string \| null \| null` | No | — |
| `termsAndConditionsLink` | `string \| null \| null` | No | — |
| `vertical` | `string \| null \| null` | No | — |
| `webhookFailoverURL` | `string \| null \| null` | No | — |
| `webhookURL` | `string \| null \| null` | No | — |

> [accordion] failureReasons full type
>
> ```ts theme={null}
> string | {
>   fields?: string[] | null,
>   description?: string | null | null
> }[] | null | null
> ```

***

### uploadOptInEvidence

`compliance.uploadOptInEvidence`

Uploads an image (`file`, max 5 MiB) of your SMS opt-in flow and returns a public URL to cite in the campaign's `message_flow`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.compliance.uploadOptInEvidence({
	file: { base64: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', filename: 'avatar.png', contentType: 'image/png' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file` | `string \| object \| custom` | Yes | A file: a public URL to it, or \{url, filename?, contentType?}, or \{base64, filename?, contentType?} for a small one. |

> [accordion] file full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

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

***

## Contacts

### bulkDelete

`contacts.bulkDelete`

Deletes 1 to 1,000 contacts by `contact_ids` and returns a result for each.

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

```ts theme={null}
await corsair.inkbox.api.contacts.bulkDelete({
	contact_ids: ['7c9e6679-7425-40de-944b-e07fc1f90ae7'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_ids` | `string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `deleted_count` | `number \| null` | No | — |
| `error_count` | `number \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   contact_id?: string | null,
>   status?: string | null,
>   error?: string | null | null,
>   error_code?: string | null | null
> }[] | null
> ```

***

### communicationPolicy.get

`contacts.communicationPolicy.get`

Returns a contact's communication policy for an agent identity (`identity_id`): per-address inbound/outbound allow or block and field visibility.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.communicationPolicy.get({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `revision` | `number \| null` | No | — |
| `identity_id` | `string \| null \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `effective_visibility` | `object \| null` | No | — |
| `visibility` | `object \| null` | No | — |

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

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   value?: string | null,
>   label?: string | null | null,
>   action?: string | null,
>   allowed?: boolean | null,
>   inbound_action?: string | null,
>   outbound_action?: string | null,
>   allowed_inbound?: boolean | null,
>   allowed_outbound?: boolean | null
> }[] | null
> ```

> [accordion] effective\_visibility full type
>
> ```ts theme={null}
> {
>   profile?: boolean | null,
>   memories?: boolean | null
> } | null | null
> ```

> [accordion] visibility full type
>
> ```ts theme={null}
> {
>   defaults?: {
>     profile?: string | null,
>     memories?: string | null
>   } | null,
>   identities?: {
>     profile?: string | null,
>     memories?: string | null,
>     identity_id?: string | null
>   }[] | null
> } | null
> ```

***

### communicationPolicy.preview

`contacts.communicationPolicy.preview`

Previews what one agent identity (`identity_id`) can see of a contact and whether it may email or phone it in each direction. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.communicationPolicy.preview({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `identity_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `contact` | `object \| null` | No | — |
| `email` | `boolean \| null` | No | — |
| `phone` | `boolean \| null` | No | — |
| `inbound_email` | `boolean \| null` | No | — |
| `outbound_email` | `boolean \| null` | No | — |
| `inbound_phone` | `boolean \| null` | No | — |
| `outbound_phone` | `boolean \| null` | No | — |
| `full_profile` | `boolean \| null` | No | — |
| `visibility` | `object \| null` | No | — |

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

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null,
>   memory_count?: number | null,
>   latest_memory?: {
>     id?: string | null,
>     content?: string | null,
>     updated_at?: string | null
>   } | null | null
> } | null | null
> ```

> [accordion] visibility full type
>
> ```ts theme={null}
> {
>   profile?: boolean | null,
>   memories?: boolean | null
> } | null
> ```

***

### communicationPolicy.set

`contacts.communicationPolicy.set`

Sets which of a contact's `addresses` an agent identity (`identity_id`) may use inbound and outbound, and its `visibility`, given the current `expected_revision`. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.communicationPolicy.set({
	contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	expected_revision: 1,
	identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	addresses: [{ kind: 'email', value: 'example', action: 'inherit' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `expected_revision` | `number` | Yes | — |
| `identity_id` | `string` | Yes | — |
| `addresses` | `object[]` | Yes | — |
| `visibility` | `object \| null` | No | — |

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   kind: email | phone,
>   value: string,
>   action: inherit | allow | block,
>   direction?: inbound | outbound | both,
>   expected_action?: inherit | allow | block | null,
>   expected_inbound_action?: inherit | allow | block | null,
>   expected_outbound_action?: inherit | allow | block | null
> }[]
> ```

> [accordion] visibility full type
>
> ```ts theme={null}
> {
>   defaults: {
>     profile: inherit | allow | block,
>     memories: inherit | allow | block
>   },
>   identities: {
>     profile: inherit | allow | block,
>     memories: inherit | allow | block,
>     identity_id: string
>   }[]
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `revision` | `number \| null` | No | — |
| `identity_id` | `string \| null \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `effective_visibility` | `object \| null` | No | — |
| `visibility` | `object \| null` | No | — |

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

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   value?: string | null,
>   label?: string | null | null,
>   action?: string | null,
>   allowed?: boolean | null,
>   inbound_action?: string | null,
>   outbound_action?: string | null,
>   allowed_inbound?: boolean | null,
>   allowed_outbound?: boolean | null
> }[] | null
> ```

> [accordion] effective\_visibility full type
>
> ```ts theme={null}
> {
>   profile?: boolean | null,
>   memories?: boolean | null
> } | null | null
> ```

> [accordion] visibility full type
>
> ```ts theme={null}
> {
>   defaults?: {
>     profile?: string | null,
>     memories?: string | null
>   } | null,
>   identities?: {
>     profile?: string | null,
>     memories?: string | null,
>     identity_id?: string | null
>   }[] | null
> } | null
> ```

***

### create

`contacts.create`

Creates a contact with names, company, emails, phones, addresses and custom fields. At least one name field or `company_name` is required.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.create({
	given_name: 'Ada',
	family_name: 'Lovelace',
	emails: [{ value: 'ada@example.com', is_primary: true }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `preferred_name` | `string \| null` | No | — |
| `name_prefix` | `string \| null` | No | — |
| `given_name` | `string \| null` | No | — |
| `middle_name` | `string \| null` | No | — |
| `family_name` | `string \| null` | No | — |
| `name_suffix` | `string \| null` | No | — |
| `company_name` | `string \| null` | No | — |
| `job_title` | `string \| null` | No | — |
| `birthday` | `string \| null` | No | — |
| `notes` | `string \| null` | No | — |
| `emails` | `object[]` | No | — |
| `phones` | `object[]` | No | — |
| `websites` | `object[]` | No | — |
| `dates` | `object[]` | No | — |
| `addresses` | `object[]` | No | — |
| `custom_fields` | `object[]` | No | — |
| `access_identity_ids` | `string[] \| null` | No | Deprecated. Non-null values are rejected; use contact communication policies instead. |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value: string,
>   label?: string | null,
>   is_primary?: boolean
> }[]
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164: string,
>   label?: string | null,
>   is_primary?: boolean
> }[]
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url: string,
>   label?: string | null
> }[]
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date: string,
>   label: string
> }[]
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null,
>   city?: string | null,
>   region?: string | null,
>   postal?: string | null,
>   country?: string | null,
>   label?: string | null
> }[]
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label: string,
>   value: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `preferred_name` | `string \| null \| null` | No | — |
| `name_prefix` | `string \| null \| null` | No | — |
| `given_name` | `string \| null \| null` | No | — |
| `middle_name` | `string \| null \| null` | No | — |
| `family_name` | `string \| null \| null` | No | — |
| `name_suffix` | `string \| null \| null` | No | — |
| `company_name` | `string \| null \| null` | No | — |
| `job_title` | `string \| null \| null` | No | — |
| `birthday` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `emails` | `object[] \| null` | No | — |
| `phones` | `object[] \| null` | No | — |
| `slack_accounts` | `object[] \| null` | No | — |
| `websites` | `object[] \| null` | No | — |
| `dates` | `object[] \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `custom_fields` | `object[] \| null` | No | — |
| `creation_source` | `string \| null` | No | — |
| `review_status` | `string \| null` | No | — |
| `reviewed_at` | `string \| null \| null` | No | — |
| `reviewed_by` | `string \| null \| null` | No | — |
| `preferred_name_source` | `string \| null` | No | — |
| `preferred_name_locked_at` | `string \| null \| null` | No | — |
| `created_by_identity_id` | `string \| null \| null` | No | — |
| `merged_into_contact_id` | `string \| null \| null` | No | — |
| `is_auto_created` | `boolean \| null` | No | — |
| `is_confirmed` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `contact_access` rows for this contact, inlined so the console can skip a follow-up `GET /contacts/{id}/access` per row. Either a single wildcard row (`identity_id=null`), an explicit per-identity list, or empty when the contact has zero legacy rows. These rows do not determine communication permissions. Always populated by the list and single-contact read paths; empty does not mean 'not loaded'. |
| `memory_count` | `number \| null` | No | — |
| `latest_memory` | `object \| null` | No | — |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] slack\_accounts full type
>
> ```ts theme={null}
> {
>   workspace_id?: string | null,
>   user_id?: string | null,
>   workspace_name?: string | null | null
> }[] | null
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   label?: string | null
> }[] | null
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null | null,
>   city?: string | null | null,
>   region?: string | null | null,
>   postal?: string | null | null,
>   country?: string | null | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   contact_id?: string | null,
>   identity_id?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] latest\_memory full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### createWithPermissions

`contacts.createWithPermissions`

Creates a contact and sets one agent's access `permissions` in a single transaction. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.createWithPermissions({
	permissions: { identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `preferred_name` | `string \| null` | No | — |
| `name_prefix` | `string \| null` | No | — |
| `given_name` | `string \| null` | No | — |
| `middle_name` | `string \| null` | No | — |
| `family_name` | `string \| null` | No | — |
| `name_suffix` | `string \| null` | No | — |
| `company_name` | `string \| null` | No | — |
| `job_title` | `string \| null` | No | — |
| `birthday` | `string \| null` | No | — |
| `notes` | `string \| null` | No | — |
| `emails` | `object[]` | No | — |
| `phones` | `object[]` | No | — |
| `websites` | `object[]` | No | — |
| `dates` | `object[]` | No | — |
| `addresses` | `object[]` | No | — |
| `custom_fields` | `object[]` | No | — |
| `access_identity_ids` | `string[] \| null` | No | Deprecated. Non-null values are rejected; use contact communication policies instead. |
| `permissions` | `object` | Yes | Initial permissions for one agent, saved atomically. Requires an admin API key or the Console. |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value: string,
>   label?: string | null,
>   is_primary?: boolean
> }[]
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164: string,
>   label?: string | null,
>   is_primary?: boolean
> }[]
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url: string,
>   label?: string | null
> }[]
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date: string,
>   label: string
> }[]
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null,
>   city?: string | null,
>   region?: string | null,
>   postal?: string | null,
>   country?: string | null,
>   label?: string | null
> }[]
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label: string,
>   value: string
> }[]
> ```

> [accordion] permissions full type
>
> ```ts theme={null}
> {
>   emails?: Record<string, boolean>,
>   phones?: Record<string, boolean>,
>   inbound_emails?: Record<string, boolean>,
>   outbound_emails?: Record<string, boolean>,
>   inbound_phones?: Record<string, boolean>,
>   outbound_phones?: Record<string, boolean>,
>   profile?: boolean,
>   memories?: boolean,
>   identity_id: string
> } | {
>   identity_id: string,
>   addresses?: {
>     kind: email | phone,
>     value: string,
>     action: inherit | allow | block,
>     direction?: inbound | outbound | both,
>     expected_inbound_action?: inherit | allow | block | null,
>     expected_outbound_action?: inherit | allow | block | null
>   }[],
>   profile?: inherit | allow | block | null,
>   memories?: inherit | allow | block | null
> } | {
>   email?: {
>     visible?: boolean,
>     contactable?: string[],
>     inbound_contactable?: string[],
>     outbound_contactable?: string[]
>   },
>   phone?: {
>     visible?: boolean,
>     contactable?: string[],
>     inbound_contactable?: string[],
>     outbound_contactable?: string[]
>   },
>   profile?: boolean,
>   memories?: boolean,
>   identity_id: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `preferred_name` | `string \| null \| null` | No | — |
| `name_prefix` | `string \| null \| null` | No | — |
| `given_name` | `string \| null \| null` | No | — |
| `middle_name` | `string \| null \| null` | No | — |
| `family_name` | `string \| null \| null` | No | — |
| `name_suffix` | `string \| null \| null` | No | — |
| `company_name` | `string \| null \| null` | No | — |
| `job_title` | `string \| null \| null` | No | — |
| `birthday` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `emails` | `object[] \| null` | No | — |
| `phones` | `object[] \| null` | No | — |
| `slack_accounts` | `object[] \| null` | No | — |
| `websites` | `object[] \| null` | No | — |
| `dates` | `object[] \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `custom_fields` | `object[] \| null` | No | — |
| `creation_source` | `string \| null` | No | — |
| `review_status` | `string \| null` | No | — |
| `reviewed_at` | `string \| null \| null` | No | — |
| `reviewed_by` | `string \| null \| null` | No | — |
| `preferred_name_source` | `string \| null` | No | — |
| `preferred_name_locked_at` | `string \| null \| null` | No | — |
| `created_by_identity_id` | `string \| null \| null` | No | — |
| `merged_into_contact_id` | `string \| null \| null` | No | — |
| `is_auto_created` | `boolean \| null` | No | — |
| `is_confirmed` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `contact_access` rows for this contact, inlined so the console can skip a follow-up `GET /contacts/{id}/access` per row. Either a single wildcard row (`identity_id=null`), an explicit per-identity list, or empty when the contact has zero legacy rows. These rows do not determine communication permissions. Always populated by the list and single-contact read paths; empty does not mean 'not loaded'. |
| `memory_count` | `number \| null` | No | — |
| `latest_memory` | `object \| null` | No | — |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] slack\_accounts full type
>
> ```ts theme={null}
> {
>   workspace_id?: string | null,
>   user_id?: string | null,
>   workspace_name?: string | null | null
> }[] | null
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   label?: string | null
> }[] | null
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null | null,
>   city?: string | null | null,
>   region?: string | null | null,
>   postal?: string | null | null,
>   country?: string | null | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   contact_id?: string | null,
>   identity_id?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] latest\_memory full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### delete

`contacts.delete`

Deletes one contact by `contact_id`. Use `contacts.bulkDelete` to delete up to 1,000 at once.

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

```ts theme={null}
await corsair.inkbox.api.contacts.delete({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

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

***

### exportVcard

`contacts.exportVcard`

Downloads one contact (`contact_id`) as a vCard (.vcf) file.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.exportVcard({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |

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

***

### exportVcards

`contacts.exportVcards`

Exports 1 to 25 contacts (`contact_ids`) as a single vCard document.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.exportVcards({
	contact_ids: ['7c9e6679-7425-40de-944b-e07fc1f90ae7'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_ids` | `string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `content_type` | `string \| null` | No | — |
| `contact_count` | `number \| null` | No | — |
| `vcard` | `string \| null` | No | — |

***

### facts.create

`contacts.facts.create`

Adds a memory (`content`, `kind`) to a contact. Requires an admin API key; agent-scoped keys cannot write memories.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.facts.create({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', content: 'Prefers email over phone calls.', kind: 'profile' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `content` | `string` | Yes | — |
| `kind` | `profile \| preference \| context` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `content` | `string \| null` | No | — |
| `confidence` | `string \| null \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `kind` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null \| null` | No | — |
| `locked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `citations` | `object[] \| null` | No | — |

> [accordion] citations full type
>
> ```ts theme={null}
> {
>   source_type?: string | null,
>   availability?: string | null,
>   source_id?: string | null | null,
>   source_url?: string | null | null,
>   source_locator?: {
>   } | null | null
> }[] | null
> ```

***

### facts.delete

`contacts.facts.delete`

Deletes one memory from a contact. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.contacts.facts.delete({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', fact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `fact_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `deleted_fact_id` | `string \| null` | No | — |
| `memory_count` | `number \| null` | No | — |
| `latest_memory` | `object \| null` | No | — |

> [accordion] latest\_memory full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### facts.get

`contacts.facts.get`

Returns one contact memory with its citations, including a memory whose deadline has passed.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.facts.get({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', fact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `fact_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `content` | `string \| null` | No | — |
| `confidence` | `string \| null \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `kind` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null \| null` | No | — |
| `locked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `citations` | `object[] \| null` | No | — |

> [accordion] citations full type
>
> ```ts theme={null}
> {
>   source_type?: string | null,
>   availability?: string | null,
>   source_id?: string | null | null,
>   source_url?: string | null | null,
>   source_locator?: {
>   } | null | null
> }[] | null
> ```

***

### facts.list

`contacts.facts.list`

Lists a contact's memories, most recently updated first. Set `include_expired` to include memories past their deadline.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.facts.list({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `include_expired` | `boolean` | No | Include context memories whose deadline has passed. |
| `limit` | `number \| null` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   contact_id?: string | null,
>   content?: string | null,
>   confidence?: string | null | null,
>   origin?: string | null,
>   kind?: string | null | null,
>   expires_at?: string | null | null,
>   locked_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   citations?: {
>     source_type?: string | null,
>     availability?: string | null,
>     source_id?: string | null | null,
>     source_url?: string | null | null,
>     source_locator?: {
>     } | null | null
>   }[] | null
> }[]
> ```

***

### facts.resolveCitation

`contacts.facts.resolveCitation`

Resolves a memory's citation to its source ID, locator and URL, after rechecking that the caller can still access that correspondence.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.facts.resolveCitation({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', fact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', citation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `fact_id` | `string` | Yes | — |
| `citation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_type` | `string \| null` | No | — |
| `source_id` | `string \| null` | No | — |
| `source_locator` | `object \| null` | No | — |
| `source_url` | `string \| null \| null` | No | — |

> [accordion] source\_locator full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### facts.update

`contacts.facts.update`

Edits a contact memory's `content` or moves it to another `kind`. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.facts.update({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', fact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `fact_id` | `string` | Yes | — |
| `content` | `string \| null` | No | — |
| `kind` | `profile \| preference \| context \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `content` | `string \| null` | No | — |
| `confidence` | `string \| null \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `kind` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null \| null` | No | — |
| `locked_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `citations` | `object[] \| null` | No | — |

> [accordion] citations full type
>
> ```ts theme={null}
> {
>   source_type?: string | null,
>   availability?: string | null,
>   source_id?: string | null | null,
>   source_url?: string | null | null,
>   source_locator?: {
>   } | null | null
> }[] | null
> ```

***

### get

`contacts.get`

Returns one contact by `contact_id`, limited to the fields the caller is permitted to see.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.get({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `preferred_name` | `string \| null \| null` | No | — |
| `name_prefix` | `string \| null \| null` | No | — |
| `given_name` | `string \| null \| null` | No | — |
| `middle_name` | `string \| null \| null` | No | — |
| `family_name` | `string \| null \| null` | No | — |
| `name_suffix` | `string \| null \| null` | No | — |
| `company_name` | `string \| null \| null` | No | — |
| `job_title` | `string \| null \| null` | No | — |
| `birthday` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `emails` | `object[] \| null` | No | — |
| `phones` | `object[] \| null` | No | — |
| `slack_accounts` | `object[] \| null` | No | — |
| `websites` | `object[] \| null` | No | — |
| `dates` | `object[] \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `custom_fields` | `object[] \| null` | No | — |
| `creation_source` | `string \| null` | No | — |
| `review_status` | `string \| null` | No | — |
| `reviewed_at` | `string \| null \| null` | No | — |
| `reviewed_by` | `string \| null \| null` | No | — |
| `preferred_name_source` | `string \| null` | No | — |
| `preferred_name_locked_at` | `string \| null \| null` | No | — |
| `created_by_identity_id` | `string \| null \| null` | No | — |
| `merged_into_contact_id` | `string \| null \| null` | No | — |
| `is_auto_created` | `boolean \| null` | No | — |
| `is_confirmed` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `contact_access` rows for this contact, inlined so the console can skip a follow-up `GET /contacts/{id}/access` per row. Either a single wildcard row (`identity_id=null`), an explicit per-identity list, or empty when the contact has zero legacy rows. These rows do not determine communication permissions. Always populated by the list and single-contact read paths; empty does not mean 'not loaded'. |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] slack\_accounts full type
>
> ```ts theme={null}
> {
>   workspace_id?: string | null,
>   user_id?: string | null,
>   workspace_name?: string | null | null
> }[] | null
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   label?: string | null
> }[] | null
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null | null,
>   city?: string | null | null,
>   region?: string | null | null,
>   postal?: string | null | null,
>   country?: string | null | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   contact_id?: string | null,
>   identity_id?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

***

### getCorrespondence

`contacts.getCorrespondence`

Returns email, SMS, iMessage, WhatsApp and call history between one contact and an agent identity, filterable by `channels`, `after`/`before` and per-channel limits.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.getCorrespondence({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `channels` | `string[]` | No | Channels to include. Repeat the parameter or use comma-separated values. |
| `after` | `string \| null` | No | — |
| `before` | `string \| null` | No | — |
| `limit_per_channel` | `number` | No | — |
| `email_limit` | `number \| null` | No | — |
| `sms_limit` | `number \| null` | No | — |
| `imessage_limit` | `number \| null` | No | — |
| `calls_limit` | `number \| null` | No | — |
| `whatsapp_limit` | `number \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `order` | `asc \| desc` | No | — |
| `content` | `metadata \| preview \| full` | No | — |
| `transcripts` | `none \| abridged \| full` | No | — |
| `include_failed` | `boolean` | No | — |
| `identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `items` | `object[] \| null` | No | — |
| `channels` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> (
>   {
>     source_id?: string | null,
>     direction?: string | null,
>     occurred_at?: string | null,
>     identity_id?: string | null,
>     status?: string | null | null,
>     detail_url?: string | null | null,
>     channel?: string | null,
>     mailbox_email?: string | null,
>     thread_id?: string | null | null,
>     from_address?: string | null,
>     to_addresses?: string[] | null,
>     cc_addresses?: string[] | null,
>     bcc_addresses?: string[] | null,
>     subject?: string | null | null,
>     snippet?: string | null | null,
>     body_text?: string | null | null,
>     content_unavailable?: boolean | null,
>     attachments?: {
>       filename?: string | null | null,
>       content_type?: string | null | null,
>       size?: number | null | null
>     }[] | null
>   } | {
>     source_id?: string | null,
>     direction?: string | null,
>     occurred_at?: string | null,
>     identity_id?: string | null,
>     status?: string | null | null,
>     detail_url?: string | null | null,
>     channel?: string | null,
>     conversation_id?: string | null,
>     local_resource_id?: string | null,
>     local_phone_number?: string | null,
>     sender_phone_number?: string | null | null,
>     participants?: string[] | null,
>     matched_contact_phone?: string | null,
>     is_group?: boolean | null,
>     text?: string | null | null,
>     media?: {
>       count?: number | null
>     } | null | null
>   } | {
>     source_id?: string | null,
>     direction?: string | null,
>     occurred_at?: string | null,
>     identity_id?: string | null,
>     status?: string | null | null,
>     detail_url?: string | null | null,
>     channel?: string | null,
>     conversation_id?: string | null,
>     remote_handle?: string | null,
>     sender_handle?: string | null | null,
>     participants?: string[] | null,
>     is_group?: boolean | null,
>     service?: string | null,
>     text?: string | null | null,
>     media?: {
>       count?: number | null
>     } | null | null
>   } | {
>     source_id?: string | null,
>     direction?: string | null,
>     occurred_at?: string | null,
>     identity_id?: string | null,
>     status?: string | null | null,
>     detail_url?: string | null | null,
>     channel?: string | null,
>     conversation_id?: string | null,
>     local_number?: string | null | null,
>     remote_number?: string | null | null,
>     participants?: string[] | null,
>     text?: string | null | null,
>     media?: {
>       count?: number | null
>     } | null | null
>   } | {
>     source_id?: string | null,
>     direction?: string | null,
>     occurred_at?: string | null,
>     identity_id?: string | null,
>     status?: string | null | null,
>     detail_url?: string | null | null,
>     channel?: string | null,
>     remote_phone_number?: string | null,
>     local_phone_number?: string | null | null,
>     started_at?: string | null | null,
>     ended_at?: string | null | null,
>     duration_seconds?: number | null | null,
>     connections?: {
>       id?: string | null,
>       kind?: string | null,
>       trigger?: string | null,
>       status?: string | null,
>       target_type?: string | null,
>       target?: string | null,
>       requested_at?: string | null,
>       dialing_at?: string | null | null,
>       connected_at?: string | null | null,
>       ended_at?: string | null | null,
>       failure_code?: string | null | null
>     }[] | null,
>     transcript?: {
>       id?: string | null | null,
>       seq?: number | null | null,
>       party?: string | null | null,
>       phone_number?: string | null | null,
>       text?: string | null | null,
>       ts_ms?: number | null | null,
>       marker?: string | null | null,
>       omitted_turns?: number | null | null,
>       omitted_ms?: number | null | null
>     }[] | null | null,
>     transcript_abridged?: boolean | null,
>     transcript_unavailable?: boolean | null
>   } | {
>     source_id?: string | null,
>     direction?: string | null,
>     occurred_at?: string | null,
>     identity_id?: string | null,
>     status?: string | null | null,
>     detail_url?: string | null | null,
>     channel?: string | null,
>     connection_id?: string | null,
>     conversation_id?: string | null,
>     workspace_id?: string | null,
>     user_id?: string | null,
>     message_ts?: string | null,
>     thread_ts?: string | null | null,
>     text?: string | null | null,
>     text_truncated?: boolean | null,
>     media?: {
>       count?: number | null
>     } | null | null,
>     sender_access?: string | null | null
>   }
> )[] | null
> ```

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

***

### import

`contacts.import`

Imports up to 2,500 contacts from a vCard body (max 10 MiB). Pass `X-VCard-Preview-Hash` from a preview to fail if the data or conflicts changed.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.import({ vcard: 'BEGIN:VCARD
VERSION:3.0
FN:Ada Lovelace
EMAIL:ada@example.com
END:VCARD
' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `vcardPreviewHash` | `string \| null` | No | — |
| `vcard` | `string` | Yes | The vCard text to import: one or more cards, UTF-8, at most 10 MiB and 2,500 cards. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `created_count` | `number \| null` | No | — |
| `error_count` | `number \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   index?: number | null,
>   status?: string | null,
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   error?: string | null | null,
>   conflicting_contact_id?: string | null | null
> }[] | null
> ```

***

### list

`contacts.list`

Lists contacts visible to the caller, with name search `q`, `order` and `review_status` filters.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `q` | `string \| null` | No | Case-insensitive substring match over name fields. |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `order` | `name \| recent` | No | — |
| `review_status` | `(unreviewed \| confirmed)[] \| null` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null,
>   memory_count?: number | null,
>   latest_memory?: {
>     id?: string | null,
>     content?: string | null,
>     updated_at?: string | null
>   } | null | null
> }[]
> ```

***

### lookup

`contacts.lookup`

Finds contacts by one field: exact `email` or `phone`, or partial match with `email_contains`, `email_domain` or `phone_contains`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.lookup({ email: 'ada@example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string \| null` | No | — |
| `email_contains` | `string \| null` | No | Substring match on stored email value (case-insensitive). |
| `email_domain` | `string \| null` | No | Suffix match on '@\<domain>'. Leading '@' is tolerated. |
| `phone` | `string \| null` | No | — |
| `phone_contains` | `string \| null` | No | Substring match on stored E.164 phone value. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> }[]
> ```

***

### merge

`contacts.merge`

Merges duplicate contacts (`losing_contact_ids`) into this contact, combining identifiers, correspondence and memories. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.contacts.merge({
	contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	losing_contact_ids: ['7c9e6679-7425-40de-944b-e07fc1f90ae7'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `losing_contact_ids` | `string[]` | Yes | — |
| `field_sources` | `Record<string, string>` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `preferred_name` | `string \| null \| null` | No | — |
| `name_prefix` | `string \| null \| null` | No | — |
| `given_name` | `string \| null \| null` | No | — |
| `middle_name` | `string \| null \| null` | No | — |
| `family_name` | `string \| null \| null` | No | — |
| `name_suffix` | `string \| null \| null` | No | — |
| `company_name` | `string \| null \| null` | No | — |
| `job_title` | `string \| null \| null` | No | — |
| `birthday` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `emails` | `object[] \| null` | No | — |
| `phones` | `object[] \| null` | No | — |
| `slack_accounts` | `object[] \| null` | No | — |
| `websites` | `object[] \| null` | No | — |
| `dates` | `object[] \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `custom_fields` | `object[] \| null` | No | — |
| `creation_source` | `string \| null` | No | — |
| `review_status` | `string \| null` | No | — |
| `reviewed_at` | `string \| null \| null` | No | — |
| `reviewed_by` | `string \| null \| null` | No | — |
| `preferred_name_source` | `string \| null` | No | — |
| `preferred_name_locked_at` | `string \| null \| null` | No | — |
| `created_by_identity_id` | `string \| null \| null` | No | — |
| `merged_into_contact_id` | `string \| null \| null` | No | — |
| `is_auto_created` | `boolean \| null` | No | — |
| `is_confirmed` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `contact_access` rows for this contact, inlined so the console can skip a follow-up `GET /contacts/{id}/access` per row. Either a single wildcard row (`identity_id=null`), an explicit per-identity list, or empty when the contact has zero legacy rows. These rows do not determine communication permissions. Always populated by the list and single-contact read paths; empty does not mean 'not loaded'. |
| `memory_count` | `number \| null` | No | — |
| `latest_memory` | `object \| null` | No | — |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] slack\_accounts full type
>
> ```ts theme={null}
> {
>   workspace_id?: string | null,
>   user_id?: string | null,
>   workspace_name?: string | null | null
> }[] | null
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   label?: string | null
> }[] | null
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null | null,
>   city?: string | null | null,
>   region?: string | null | null,
>   postal?: string | null | null,
>   country?: string | null | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   contact_id?: string | null,
>   identity_id?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] latest\_memory full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### previewImport

`contacts.previewImport`

Validates a vCard batch (`vcard`) and reports conflicts with existing contacts, without creating any. Returns a `preview_hash` for the import.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.contacts.previewImport({ vcard: 'BEGIN:VCARD
VERSION:3.0
FN:Ada Lovelace
EMAIL:ada@example.com
END:VCARD
' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `vcard` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_count` | `number \| null` | No | — |
| `conflicts` | `object[] \| null` | No | — |
| `payload_hash` | `string \| null` | No | — |
| `preview_hash` | `string \| null` | No | — |

> [accordion] conflicts full type
>
> ```ts theme={null}
> {
>   index?: number | null,
>   contact_ids?: string[] | null
> }[] | null
> ```

***

### update

`contacts.update`

Updates a contact with JSON merge-patch: sent fields replace, null clears, omitted fields are kept.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.contacts.update({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `preferred_name` | `string \| null` | No | — |
| `name_prefix` | `string \| null` | No | — |
| `given_name` | `string \| null` | No | — |
| `middle_name` | `string \| null` | No | — |
| `family_name` | `string \| null` | No | — |
| `name_suffix` | `string \| null` | No | — |
| `company_name` | `string \| null` | No | — |
| `job_title` | `string \| null` | No | — |
| `birthday` | `string \| null` | No | — |
| `notes` | `string \| null` | No | — |
| `emails` | `object[] \| null` | No | — |
| `phones` | `object[] \| null` | No | — |
| `websites` | `object[] \| null` | No | — |
| `dates` | `object[] \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `custom_fields` | `object[] \| null` | No | — |
| `review_status` | `unreviewed \| confirmed \| null` | No | — |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value: string,
>   label?: string | null,
>   is_primary?: boolean
> }[] | null
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164: string,
>   label?: string | null,
>   is_primary?: boolean
> }[] | null
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url: string,
>   label?: string | null
> }[] | null
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date: string,
>   label: string
> }[] | null
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null,
>   city?: string | null,
>   region?: string | null,
>   postal?: string | null,
>   country?: string | null,
>   label?: string | null
> }[] | null
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label: string,
>   value: string
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `preferred_name` | `string \| null \| null` | No | — |
| `name_prefix` | `string \| null \| null` | No | — |
| `given_name` | `string \| null \| null` | No | — |
| `middle_name` | `string \| null \| null` | No | — |
| `family_name` | `string \| null \| null` | No | — |
| `name_suffix` | `string \| null \| null` | No | — |
| `company_name` | `string \| null \| null` | No | — |
| `job_title` | `string \| null \| null` | No | — |
| `birthday` | `string \| null \| null` | No | — |
| `notes` | `string \| null \| null` | No | — |
| `emails` | `object[] \| null` | No | — |
| `phones` | `object[] \| null` | No | — |
| `slack_accounts` | `object[] \| null` | No | — |
| `websites` | `object[] \| null` | No | — |
| `dates` | `object[] \| null` | No | — |
| `addresses` | `object[] \| null` | No | — |
| `custom_fields` | `object[] \| null` | No | — |
| `creation_source` | `string \| null` | No | — |
| `review_status` | `string \| null` | No | — |
| `reviewed_at` | `string \| null \| null` | No | — |
| `reviewed_by` | `string \| null \| null` | No | — |
| `preferred_name_source` | `string \| null` | No | — |
| `preferred_name_locked_at` | `string \| null \| null` | No | — |
| `created_by_identity_id` | `string \| null \| null` | No | — |
| `merged_into_contact_id` | `string \| null \| null` | No | — |
| `is_auto_created` | `boolean \| null` | No | — |
| `is_confirmed` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `contact_access` rows for this contact, inlined so the console can skip a follow-up `GET /contacts/{id}/access` per row. Either a single wildcard row (`identity_id=null`), an explicit per-identity list, or empty when the contact has zero legacy rows. These rows do not determine communication permissions. Always populated by the list and single-contact read paths; empty does not mean 'not loaded'. |
| `memory_count` | `number \| null` | No | — |
| `latest_memory` | `object \| null` | No | — |

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] phones full type
>
> ```ts theme={null}
> {
>   value_e164?: string | null,
>   label?: string | null | null,
>   is_primary?: boolean | null
> }[] | null
> ```

> [accordion] slack\_accounts full type
>
> ```ts theme={null}
> {
>   workspace_id?: string | null,
>   user_id?: string | null,
>   workspace_name?: string | null | null
> }[] | null
> ```

> [accordion] websites full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] dates full type
>
> ```ts theme={null}
> {
>   date?: string | null,
>   label?: string | null
> }[] | null
> ```

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   street?: string | null | null,
>   city?: string | null | null,
>   region?: string | null | null,
>   postal?: string | null | null,
>   country?: string | null | null,
>   label?: string | null | null
> }[] | null
> ```

> [accordion] custom\_fields full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   contact_id?: string | null,
>   identity_id?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] latest\_memory full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

## Domains

### create

`domains.create`

Registers a custom email sending domain (`domain`) and returns the DNS records to publish. An apex with existing MX records needs `apex_mx_acknowledged` to displace that mail provider.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.domains.create({ domain: 'mail.example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | — |
| `apex_mx_acknowledged` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `object \| null` | No | — |
| `dns_records` | `object[] \| null` | No | — |
| `apex_mx_warning` | `object \| null` | No | — |
| `spf_lookup_report` | `object \| null` | No | — |

> [accordion] domain full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   domain?: string | null,
>   mail_from_subdomain?: string | null,
>   is_default?: boolean | null,
>   status?: string | null,
>   failure_reason?: string | null | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   dkim_selector?: string | null,
>   ownership_token?: string | null
> } | null
> ```

> [accordion] dns\_records full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   host?: string | null,
>   value?: string | null,
>   ttl?: number | null,
>   purpose?: string | null,
>   status?: string | null,
>   is_required?: boolean | null,
>   is_inkbox_branded?: boolean | null,
>   observed_values?: string[] | null
> }[] | null
> ```

> [accordion] apex\_mx\_warning full type
>
> ```ts theme={null}
> {
>   current_mx_targets?: string[] | null,
>   acknowledged?: boolean | null
> } | null | null
> ```

> [accordion] spf\_lookup\_report full type
>
> ```ts theme={null}
> {
>   current?: number | null,
>   limit?: number | null,
>   mechanisms?: string[] | null
> } | null | null
> ```

***

### delete

`domains.delete`

Deletes a custom sending domain: sending and receiving stop at once, and it can be restored for 24 hours before deletion is permanent. Fails while mailboxes still use it.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.domains.delete({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

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

***

### forceDelete

`domains.forceDelete`

Deletes a custom sending domain (`domain_id`) by force, bypassing the normal delete flow and its restore window; treat it as permanent.

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

```ts theme={null}
await corsair.inkbox.api.domains.forceDelete({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

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

***

### get

`domains.get`

Returns one custom sending domain with its status and required DNS records.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.domains.get({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

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

> [accordion] domain full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   domain?: string | null,
>   mail_from_subdomain?: string | null,
>   is_default?: boolean | null,
>   status?: string | null,
>   failure_reason?: string | null | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   dkim_selector?: string | null,
>   ownership_token?: string | null
> } | null
> ```

> [accordion] dns\_records full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   host?: string | null,
>   value?: string | null,
>   ttl?: number | null,
>   purpose?: string | null,
>   status?: string | null,
>   is_required?: boolean | null,
>   is_inkbox_branded?: boolean | null,
>   observed_values?: string[] | null
> }[] | null
> ```

***

### getDnsRecords

`domains.getDnsRecords`

Returns the DNS records (ownership TXT, mail routing, DKIM and others) to publish at the registrar for a custom sending domain.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.domains.getDnsRecords({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

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

> [accordion] dns\_records full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   host?: string | null,
>   value?: string | null,
>   ttl?: number | null,
>   purpose?: string | null,
>   status?: string | null,
>   is_required?: boolean | null,
>   is_inkbox_branded?: boolean | null,
>   observed_values?: string[] | null
> }[] | null
> ```

***

### getHealth

`domains.getHealth`

Returns a custom sending domain's health: its status and the current check result for each required DNS record.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.domains.getHealth({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

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

> [accordion] domain full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   domain?: string | null,
>   mail_from_subdomain?: string | null,
>   is_default?: boolean | null,
>   status?: string | null,
>   ownership_validated?: boolean | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   degraded_since?: string | null | null
> } | null
> ```

> [accordion] dns\_records full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   host?: string | null,
>   purpose?: string | null,
>   status?: string | null,
>   required?: boolean | null
> }[] | null
> ```

***

### list

`domains.list`

Lists the organization's custom email sending domains, optionally filtered by lifecycle `status`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.domains.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `not_started \| awaiting_ownership \| pending \| dns_invalid \| verifying \| verified \| failed \| pending_dkim_rotation \| degraded \| pending_deletion \| null` | No | Filter to rows in this lifecycle status. Omit to return every row in the org regardless of state. The mailbox-create dropdown reads from `?status=verified`. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   domain?: string | null,
>   mail_from_subdomain?: string | null,
>   is_default?: boolean | null,
>   status?: string | null,
>   failure_reason?: string | null | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   dkim_selector?: string | null,
>   ownership_token?: string | null
> }[]
> ```

***

### restore

`domains.restore`

Restores a custom sending domain that is still in its 24-hour deletion grace period.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.domains.restore({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `mail_from_subdomain` | `string \| null` | No | — |
| `is_default` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `string \| null \| null` | No | — |
| `verified_at` | `string \| null \| null` | No | — |
| `last_checked_at` | `string \| null \| null` | No | — |
| `dkim_selector` | `string \| null` | No | — |
| `ownership_token` | `string \| null` | No | — |

***

### rotateDkim

`domains.rotateDkim`

Starts a DKIM key rotation for a custom sending domain and returns the new selector and TXT value to publish; the old key stays active until the new one verifies.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.domains.rotateDkim({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `object \| null` | No | — |
| `new_selector` | `string \| null` | No | — |
| `new_dkim_txt_value` | `string \| null` | No | — |

> [accordion] domain full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   domain?: string | null,
>   mail_from_subdomain?: string | null,
>   is_default?: boolean | null,
>   status?: string | null,
>   failure_reason?: string | null | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   dkim_selector?: string | null,
>   ownership_token?: string | null
> } | null
> ```

***

### setDefault

`domains.setDefault`

Makes a verified custom domain (`domain_name`) the organization's default for new mailboxes; pass `inkboxmail.com` to revert. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.domains.setDefault({ domain_name: 'mail.example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `default_domain` | `string \| null \| null` | No | Bare domain name now serving as the org's default for new mailbox creations. `None` means no custom default is set and mailboxes fall back to the platform domain. |

***

### verify

`domains.verify`

Re-checks a custom sending domain's DNS records now and returns its updated status.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.domains.verify({ domain_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_id` | `string` | Yes | — |

**Output**

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

> [accordion] domain full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   domain?: string | null,
>   mail_from_subdomain?: string | null,
>   is_default?: boolean | null,
>   status?: string | null,
>   failure_reason?: string | null | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   dkim_selector?: string | null,
>   ownership_token?: string | null
> } | null
> ```

> [accordion] dns\_records full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   host?: string | null,
>   value?: string | null,
>   ttl?: number | null,
>   purpose?: string | null,
>   status?: string | null,
>   is_required?: boolean | null,
>   is_inkbox_branded?: boolean | null,
>   observed_values?: string[] | null
> }[] | null
> ```

***

## Hosted Chat

### answerInteraction

`hostedChat.answerInteraction`

Answers a pending tool approval or question in a hosted-agent conversation with `response` (for example approve\_once or deny) at `expected_version`; only the first valid answer counts.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedChat.answerInteraction({
	conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	interaction_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	agent_handle: 'support-agent',
	expected_version: 1,
	response: { kind: 'approval', decision: 'approve_once' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `interaction_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `expected_version` | `number` | Yes | — |
| `response` | `object` | Yes | — |

> [accordion] response full type
>
> ```ts theme={null}
> {
>   kind: approval,
>   decision: approve_once | deny
> } | {
>   kind: question,
>   answers: Record<string, string | string[]>
> }
> ```

**Output**

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

***

### conversations.create

`hostedChat.conversations.create`

Starts a new chat conversation with an identity's hosted agent, with an optional `title`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedChat.conversations.create({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `title` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `permission_mode` | `string \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `last_active_at` | `string \| null \| null` | No | — |
| `id` | `string \| null` | No | — |
| `identity_id` | `string \| null \| null` | No | — |
| `title` | `string \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `history_completeness` | `string \| null` | No | — |

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   pause_resume?: boolean | null,
>   permission_mode_selection?: boolean | null,
>   model_selection?: boolean | null,
>   send_message?: boolean | null,
>   cancel_turn?: boolean | null,
>   approvals?: boolean | null,
>   questions?: boolean | null,
>   attachments?: boolean | null,
>   tool_activity?: boolean | null
> } | null
> ```

***

### conversations.get

`hostedChat.conversations.get`

Returns a snapshot of a hosted-agent conversation: recent items, pending approvals, the current turn, and cursors for paging and events.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.conversations.get({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `permission_mode` | `string \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `last_active_at` | `string \| null \| null` | No | — |
| `id` | `string \| null` | No | — |
| `identity_id` | `string \| null \| null` | No | — |
| `title` | `string \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `history_completeness` | `string \| null` | No | — |
| `sequence` | `number \| null` | No | — |
| `snapshot_token` | `string \| null` | No | — |
| `event_cursor` | `string \| null` | No | — |
| `items` | `object[] \| null` | No | — |
| `pending_interactions` | `object[] \| null` | No | — |
| `current_turn` | `object \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   pause_resume?: boolean | null,
>   permission_mode_selection?: boolean | null,
>   model_selection?: boolean | null,
>   send_message?: boolean | null,
>   cancel_turn?: boolean | null,
>   approvals?: boolean | null,
>   questions?: boolean | null,
>   attachments?: boolean | null,
>   tool_activity?: boolean | null
> } | null
> ```

> [accordion] items full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     phase?: string | null | null,
>     role?: string | null,
>     content?: (
>       {
>         type?: string | null,
>         text?: string | null
>       } | {
>         type?: string | null,
>         file_id?: string | null,
>         name?: string | null,
>         media_type?: string | null,
>         size_bytes?: number | null,
>         availability?: string | null
>       }
>     )[] | null,
>     completed?: boolean | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     status?: string | null,
>     terminal?: boolean | null,
>     conversation_id?: string | null | null,
>     blocker?: {
>       code?: string | null,
>       message?: string | null,
>       scope?: string | null,
>       retryable?: boolean | null,
>       actions?: string[] | null
>     } | null | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     title?: string | null,
>     status?: string | null,
>     detail?: string | null | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     auto_approve?: boolean | null,
>     decision?: string | null | null,
>     kind?: string | null,
>     version?: number | null,
>     status?: string | null,
>     expires_at?: string | null,
>     title?: string | null,
>     detail?: string | null | null,
>     effective_scope?: string | null | null,
>     tool_call_id?: string | null | null,
>     decisions?: string[] | null | null,
>     fields?: {
>       id?: string | null,
>       label?: string | null,
>       required?: boolean | null,
>       type?: string | null,
>       choices?: {
>         id?: string | null,
>         label?: string | null
>       }[] | null,
>       allow_free_text?: boolean | null
>     }[] | null | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     file_id?: string | null,
>     name?: string | null,
>     media_type?: string | null,
>     size_bytes?: number | null,
>     availability?: string | null
>   }
> )[] | null
> ```

> [accordion] pending\_interactions full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   revision?: number | null | null,
>   created_sequence?: number | null | null,
>   turn_id?: string | null | null,
>   resource_type?: string | null | null,
>   auto_approve?: boolean | null,
>   decision?: string | null | null,
>   kind?: string | null,
>   version?: number | null,
>   status?: string | null,
>   expires_at?: string | null,
>   title?: string | null,
>   detail?: string | null | null,
>   effective_scope?: string | null | null,
>   tool_call_id?: string | null | null,
>   decisions?: string[] | null | null,
>   fields?: {
>     id?: string | null,
>     label?: string | null,
>     required?: boolean | null,
>     type?: string | null,
>     choices?: {
>       id?: string | null,
>       label?: string | null
>     }[] | null,
>     allow_free_text?: boolean | null
>   }[] | null | null
> }[] | null
> ```

> [accordion] current\_turn full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   revision?: number | null | null,
>   created_sequence?: number | null | null,
>   turn_id?: string | null | null,
>   resource_type?: string | null | null,
>   status?: string | null,
>   terminal?: boolean | null,
>   conversation_id?: string | null | null,
>   blocker?: {
>     code?: string | null,
>     message?: string | null,
>     scope?: string | null,
>     retryable?: boolean | null,
>     actions?: string[] | null
>   } | null | null
> } | null | null
> ```

***

### conversations.list

`hostedChat.conversations.list`

Lists chat conversations with an identity's hosted agent, optionally filtered by `origin` (`chat`, `communication` or `schedule`).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.conversations.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `after` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `origin` | `chat \| communication \| schedule \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   permission_mode?: string | null,
>   created_at?: string | null | null,
>   last_active_at?: string | null | null,
>   id?: string | null,
>   identity_id?: string | null | null,
>   title?: string | null,
>   origin?: string | null,
>   capabilities?: {
>     pause_resume?: boolean | null,
>     permission_mode_selection?: boolean | null,
>     model_selection?: boolean | null,
>     send_message?: boolean | null,
>     cancel_turn?: boolean | null,
>     approvals?: boolean | null,
>     questions?: boolean | null,
>     attachments?: boolean | null,
>     tool_activity?: boolean | null
>   } | null,
>   history_completeness?: string | null
> }[] | null
> ```

***

### conversations.listMessages

`hostedChat.conversations.listMessages`

Lists older items of a hosted-agent conversation, paging with `after` and a `snapshot` token from the conversation snapshot.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.conversations.listMessages({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `after` | `string \| null` | No | — |
| `snapshot` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `sequence` | `number \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     phase?: string | null | null,
>     role?: string | null,
>     content?: (
>       {
>         type?: string | null,
>         text?: string | null
>       } | {
>         type?: string | null,
>         file_id?: string | null,
>         name?: string | null,
>         media_type?: string | null,
>         size_bytes?: number | null,
>         availability?: string | null
>       }
>     )[] | null,
>     completed?: boolean | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     status?: string | null,
>     terminal?: boolean | null,
>     conversation_id?: string | null | null,
>     blocker?: {
>       code?: string | null,
>       message?: string | null,
>       scope?: string | null,
>       retryable?: boolean | null,
>       actions?: string[] | null
>     } | null | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     title?: string | null,
>     status?: string | null,
>     detail?: string | null | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     auto_approve?: boolean | null,
>     decision?: string | null | null,
>     kind?: string | null,
>     version?: number | null,
>     status?: string | null,
>     expires_at?: string | null,
>     title?: string | null,
>     detail?: string | null | null,
>     effective_scope?: string | null | null,
>     tool_call_id?: string | null | null,
>     decisions?: string[] | null | null,
>     fields?: {
>       id?: string | null,
>       label?: string | null,
>       required?: boolean | null,
>       type?: string | null,
>       choices?: {
>         id?: string | null,
>         label?: string | null
>       }[] | null,
>       allow_free_text?: boolean | null
>     }[] | null | null
>   } | {
>     id?: string | null,
>     revision?: number | null | null,
>     created_sequence?: number | null | null,
>     turn_id?: string | null | null,
>     resource_type?: string | null | null,
>     file_id?: string | null,
>     name?: string | null,
>     media_type?: string | null,
>     size_bytes?: number | null,
>     availability?: string | null
>   }
> )[] | null
> ```

***

### conversations.rename

`hostedChat.conversations.rename`

Updates a hosted-agent conversation's `title` and/or tool `permission_mode` (ask or yolo, which auto-approves tool requests in future turns).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedChat.conversations.rename({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `title` | `string \| null` | No | — |
| `permission_mode` | `ask \| yolo \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `permission_mode` | `string \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `last_active_at` | `string \| null \| null` | No | — |
| `id` | `string \| null` | No | — |
| `identity_id` | `string \| null \| null` | No | — |
| `title` | `string \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `history_completeness` | `string \| null` | No | — |

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   pause_resume?: boolean | null,
>   permission_mode_selection?: boolean | null,
>   model_selection?: boolean | null,
>   send_message?: boolean | null,
>   cancel_turn?: boolean | null,
>   approvals?: boolean | null,
>   questions?: boolean | null,
>   attachments?: boolean | null,
>   tool_activity?: boolean | null
> } | null
> ```

***

### files.download

`hostedChat.files.download`

Downloads a hosted-agent chat file (uploaded or produced by the agent) as base64 (`data_base64`).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.files.download({ file_id: 'F0123456789', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `string \| null` | No | — |
| `data_base64` | `string \| null` | No | — |

***

### files.get

`hostedChat.files.get`

Returns metadata for a hosted-agent chat file: name, media type, size and availability.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.files.get({ file_id: 'F0123456789', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `string \| null` | No | — |
| `file_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `media_type` | `string \| null` | No | — |
| `size_bytes` | `number \| null` | No | — |
| `availability` | `string \| null` | No | — |

***

### files.upload

`hostedChat.files.upload`

Uploads a file (`name`, `data_base64`, max 5 MB) for use as an attachment in a hosted-agent chat turn.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedChat.files.upload({ agent_handle: 'support-agent', name: 'Support inbox', data_base64: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `media_type` | `string` | No | — |
| `data_base64` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `file` | `object \| null` | No | — |
| `operation_id` | `string \| null` | No | — |

> [accordion] file full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   file_id?: string | null,
>   name?: string | null,
>   media_type?: string | null,
>   size_bytes?: number | null,
>   availability?: string | null
> } | null
> ```

***

### getStatus

`hostedChat.getStatus`

Returns the hosted agent's workspace status for chat: computer state, agent readiness, capabilities, funding and allowed actions.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.getStatus({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string \| null` | No | — |
| `machine_id` | `string \| null \| null` | No | — |
| `observed_at` | `string \| null` | No | — |
| `computer` | `object \| null` | No | — |
| `agent` | `object \| null` | No | — |
| `automation` | `object \| null` | No | — |
| `funding` | `object \| null` | No | — |
| `configuration` | `object \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `allowed_actions` | `string[] \| null` | No | — |
| `hosting` | `object \| null` | No | — |
| `links` | `object[] \| null` | No | — |
| `unavailable_sections` | `string[] \| null` | No | — |

> [accordion] computer full type
>
> ```ts theme={null}
> {
>   state?: string | null,
>   desired_state?: string | null,
>   pause_requested?: boolean | null,
>   shape_id?: string | null | null,
>   version?: number | null | null,
>   created_at?: string | null,
>   tier?: string | null,
>   vcpus?: number | null,
>   memory_bytes?: number | null,
>   disk_bytes?: number | null,
>   software?: Record<string, string | null> | null | null,
>   operation?: {
>     id?: string | null,
>     machine_id?: string | null | null,
>     kind?: string | null,
>     state?: string | null,
>     error_code?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null | null
> } | null | null
> ```

> [accordion] agent full type
>
> ```ts theme={null}
> {
>   last_delivery_failure?: {
>     event_id?: string | null | null,
>     code?: string | null,
>     finished_unix_ms?: number | null
>   } | null | null,
>   state?: string | null,
>   observed_at?: string | null | null,
>   stale?: boolean | null,
>   generation?: number | null,
>   applied_generation?: number | null
> } | null
> ```

> [accordion] automation full type
>
> ```ts theme={null}
> {
>   idle_stop_enabled?: boolean | null,
>   idle_timeout_seconds?: number | null,
>   schedules_may_start?: boolean | null,
>   selected_events_may_start?: boolean | null
> } | null
> ```

> [accordion] funding full type
>
> ```ts theme={null}
> {
>   applied?: {
>     source?: string | null,
>     binding_id?: string | null | null,
>     key_revoked?: boolean | null | null
>   } | null | null,
>   selected_binding_id?: string | null | null,
>   pending?: boolean | null,
>   credits?: {
>     currency?: string | null,
>     one_time?: boolean | null,
>     grant_microusd?: number | null,
>     settled_microusd?: number | null,
>     reserved_microusd?: number | null,
>     available_microusd?: number | null,
>     activated?: boolean | null,
>     eligible?: boolean | null,
>     exhausted?: boolean | null
>   } | null | null,
>   observed_at?: string | null,
>   blockers?: {
>     code?: string | null,
>     message?: string | null,
>     scope?: string | null,
>     retryable?: boolean | null,
>     actions?: string[] | null
>   }[] | null
> } | null | null
> ```

> [accordion] configuration full type
>
> ```ts theme={null}
> {
>   environment_version?: number | null | null,
>   applied_environment_version?: number | null | null,
>   pending?: boolean | null,
>   last_error?: string | null | null
> } | null
> ```

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   pause_resume?: boolean | null,
>   permission_mode_selection?: boolean | null,
>   model_selection?: boolean | null,
>   send_message?: boolean | null,
>   cancel_turn?: boolean | null,
>   approvals?: boolean | null,
>   questions?: boolean | null,
>   attachments?: boolean | null,
>   tool_activity?: boolean | null
> } | null
> ```

> [accordion] hosting full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   identity_id?: string | null,
>   machine_id?: string | null | null,
>   harness?: string | null | null,
>   tier?: string | null | null,
>   shape_id?: string | null | null,
>   state?: string | null,
>   generation?: number | null,
>   applied_generation?: number | null,
>   default_model?: string | null,
>   instructions?: string | null,
>   trigger_events?: string[] | null,
>   default_trigger_events?: string[] | null,
>   follow_defaults?: boolean | null,
>   credential_binding_id?: string | null | null,
>   idle_stop_enabled?: boolean | null,
>   idle_timeout_seconds?: number | null,
>   last_error?: string | null | null,
>   quota_blocker?: {
>     resource?: string | null,
>     usage?: number | null,
>     limit?: number | null
>   } | null | null,
>   updated_at?: string | null | null,
>   url?: string | null | null,
>   delivery?: string | null
> } | null | null
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   resource?: string | null,
>   path?: string | null
> }[] | null
> ```

***

### turns.cancel

`hostedChat.turns.cancel`

Requests cancellation of a running turn in a hosted-agent conversation.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedChat.turns.cancel({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', turn_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `turn_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `cancellation_requested` | `boolean \| null` | No | — |
| `terminal` | `boolean \| null` | No | — |

***

### turns.create

`hostedChat.turns.create`

Sends a message (`content`: text and file parts) to an identity's hosted agent, starting a turn with an optional `model`; wakes a stopped computer, one turn at a time. Admin API key only.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.hostedChat.turns.create({
	conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	agent_handle: 'support-agent',
	content: [{ text: 'Thanks, your order ships tomorrow.' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `model` | `gpt-6-luna \| gpt-6.1-terra \| gpt-6.1-sol \| gpt-6-astra \| claude-haiku-5-5 \| claude-sonnet-5-5 \| claude-opus-5-5 \| claude-fable-5-2 \| deepseek-flash \| deepseek-v4-pro \| null` | No | — |
| `content` | `object[]` | Yes | — |

> [accordion] content full type
>
> ```ts theme={null}
> (
>   {
>     type?: text,
>     text: string
>   } | {
>     type?: file,
>     file_id: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `terminal` | `boolean \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `blocker` | `object \| null` | No | — |

> [accordion] blocker full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   message?: string | null,
>   scope?: string | null,
>   retryable?: boolean | null,
>   actions?: string[] | null
> } | null | null
> ```

***

### turns.get

`hostedChat.turns.get`

Returns the status of one turn in a hosted-agent conversation (queued, running, waiting\_for\_input, completed, failed and so on) and any blocker.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedChat.turns.get({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', turn_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `turn_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `terminal` | `boolean \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `blocker` | `object \| null` | No | — |

> [accordion] blocker full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   message?: string | null,
>   scope?: string | null,
>   retryable?: boolean | null,
>   actions?: string[] | null
> } | null | null
> ```

***

## Hosted Workspace

### environment.get

`hostedWorkspace.environment.get`

Lists environment variables set on the hosted agent's computer; secret values are masked.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.environment.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `number \| null` | No | — |
| `items` | `object[] \| null` | No | — |
| `applies_to` | `string \| null` | No | — |
| `supported` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   secret?: boolean | null,
>   is_set?: boolean | null,
>   value?: string | null | null
> }[] | null
> ```

***

### environment.update

`hostedWorkspace.environment.update`

Sets (`set`) or removes (`remove`) environment variables on the hosted agent's computer at `expected_version`. Changes apply to new processes.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.environment.update({ agent_handle: 'support-agent', expected_version: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `expected_version` | `number` | Yes | — |
| `set` | `object` | No | — |
| `remove` | `string[]` | No | — |

> [accordion] set full type
>
> ```ts theme={null}
> Record<string, {
>   value: string,
>   secret?: boolean
> }>
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `number \| null` | No | — |
| `applies_to` | `string \| null` | No | — |

***

### get

`hostedWorkspace.get`

Returns the hosted agent's computer state, agent readiness, capabilities, funding and allowed actions.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string \| null` | No | — |
| `machine_id` | `string \| null \| null` | No | — |
| `observed_at` | `string \| null` | No | — |
| `computer` | `object \| null` | No | — |
| `agent` | `object \| null` | No | — |
| `automation` | `object \| null` | No | — |
| `funding` | `object \| null` | No | — |
| `configuration` | `object \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `allowed_actions` | `string[] \| null` | No | — |
| `hosting` | `object \| null` | No | — |
| `links` | `object[] \| null` | No | — |
| `unavailable_sections` | `string[] \| null` | No | — |

> [accordion] computer full type
>
> ```ts theme={null}
> {
>   state?: string | null,
>   desired_state?: string | null,
>   pause_requested?: boolean | null,
>   shape_id?: string | null | null,
>   version?: number | null | null,
>   created_at?: string | null,
>   tier?: string | null,
>   vcpus?: number | null,
>   memory_bytes?: number | null,
>   disk_bytes?: number | null,
>   software?: Record<string, string | null> | null | null,
>   operation?: {
>     id?: string | null,
>     machine_id?: string | null | null,
>     kind?: string | null,
>     state?: string | null,
>     error_code?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null | null
> } | null | null
> ```

> [accordion] agent full type
>
> ```ts theme={null}
> {
>   last_delivery_failure?: {
>     event_id?: string | null | null,
>     code?: string | null,
>     finished_unix_ms?: number | null
>   } | null | null,
>   state?: string | null,
>   observed_at?: string | null | null,
>   stale?: boolean | null,
>   generation?: number | null,
>   applied_generation?: number | null
> } | null
> ```

> [accordion] automation full type
>
> ```ts theme={null}
> {
>   idle_stop_enabled?: boolean | null,
>   idle_timeout_seconds?: number | null,
>   schedules_may_start?: boolean | null,
>   selected_events_may_start?: boolean | null
> } | null
> ```

> [accordion] funding full type
>
> ```ts theme={null}
> {
>   applied?: {
>     source?: string | null,
>     binding_id?: string | null | null,
>     key_revoked?: boolean | null | null
>   } | null | null,
>   selected_binding_id?: string | null | null,
>   pending?: boolean | null,
>   credits?: {
>     currency?: string | null,
>     one_time?: boolean | null,
>     grant_microusd?: number | null,
>     settled_microusd?: number | null,
>     reserved_microusd?: number | null,
>     available_microusd?: number | null,
>     activated?: boolean | null,
>     eligible?: boolean | null,
>     exhausted?: boolean | null
>   } | null | null,
>   observed_at?: string | null,
>   blockers?: {
>     code?: string | null,
>     message?: string | null,
>     scope?: string | null,
>     retryable?: boolean | null,
>     actions?: string[] | null
>   }[] | null
> } | null | null
> ```

> [accordion] configuration full type
>
> ```ts theme={null}
> {
>   environment_version?: number | null | null,
>   applied_environment_version?: number | null | null,
>   pending?: boolean | null,
>   last_error?: string | null | null
> } | null
> ```

> [accordion] capabilities full type
>
> ```ts theme={null}
> {
>   pause_resume?: boolean | null,
>   permission_mode_selection?: boolean | null,
>   model_selection?: boolean | null,
>   send_message?: boolean | null,
>   cancel_turn?: boolean | null,
>   approvals?: boolean | null,
>   questions?: boolean | null,
>   attachments?: boolean | null,
>   tool_activity?: boolean | null
> } | null
> ```

> [accordion] hosting full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   identity_id?: string | null,
>   machine_id?: string | null | null,
>   harness?: string | null | null,
>   tier?: string | null | null,
>   shape_id?: string | null | null,
>   state?: string | null,
>   generation?: number | null,
>   applied_generation?: number | null,
>   default_model?: string | null,
>   instructions?: string | null,
>   trigger_events?: string[] | null,
>   default_trigger_events?: string[] | null,
>   follow_defaults?: boolean | null,
>   credential_binding_id?: string | null | null,
>   idle_stop_enabled?: boolean | null,
>   idle_timeout_seconds?: number | null,
>   last_error?: string | null | null,
>   quota_blocker?: {
>     resource?: string | null,
>     usage?: number | null,
>     limit?: number | null
>   } | null | null,
>   updated_at?: string | null | null,
>   url?: string | null | null,
>   delivery?: string | null
> } | null | null
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   resource?: string | null,
>   path?: string | null
> }[] | null
> ```

***

### getOperation

`hostedWorkspace.getOperation`

Returns the progress and result of a workspace operation (start, stop, pause, resume, resize, terminal) by `operation_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.getOperation({ operation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `operation_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `machine_id` | `string \| null \| null` | No | — |
| `kind` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### getUsage

`hostedWorkspace.getUsage`

Returns current CPU, memory and disk usage of the hosted agent's computer.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.getUsage({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `machine_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sampled_at` | `string \| null \| null` | No | — |
| `fresh_for_seconds` | `number \| null` | No | — |
| `allocated` | `Record<string, number> \| null` | No | — |
| `measured` | `Record<string, number \| number \| null> \| null \| null` | No | — |
| `cpu_basis` | `string \| null` | No | — |
| `storage_warning` | `object \| null` | No | — |

> [accordion] storage\_warning full type
>
> ```ts theme={null}
> {
> } | null | null
> ```

***

### getUsageHistory

`hostedWorkspace.getUsageHistory`

Returns CPU, memory and disk usage history of the hosted agent's computer over a `window` (1h, 24h, 7d or 30d).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.getUsageHistory({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `window` | `1h \| 24h \| 7d \| 30d` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `machine_id` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `from` | `string \| null` | No | — |
| `to` | `string \| null` | No | — |
| `resolution_seconds` | `number \| null` | No | — |
| `sample_interval_seconds` | `number \| null` | No | — |
| `missing_intervals` | `string \| null` | No | — |
| `items` | `object[] \| null` | No | — |

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

***

### ports.get

`hostedWorkspace.ports.get`

Returns the hosted agent's public URL, default port and exposed ports.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.ports.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `version` | `number \| null` | No | Send back on update to avoid overwriting a concurrent change. |
| `default_port` | `number \| null \| null` | No | — |
| `ports` | `object[] \| null` | No | — |

> [accordion] ports full type
>
> ```ts theme={null}
> {
>   port?: number | null,
>   public?: boolean | null,
>   url?: string | null | null,
>   token_url?: string | null | null
> }[] | null
> ```

***

### ports.rotateToken

`hostedWorkspace.ports.rotateToken`

Issues a new access token URL for an exposed port on the hosted agent; the old token stops working immediately. Requires an admin API key.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.ports.rotateToken({ port: 8080, agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `port` | `number` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `version` | `number \| null` | No | Send back on update to avoid overwriting a concurrent change. |
| `default_port` | `number \| null \| null` | No | — |
| `ports` | `object[] \| null` | No | — |

> [accordion] ports full type
>
> ```ts theme={null}
> {
>   port?: number | null,
>   public?: boolean | null,
>   url?: string | null | null,
>   token_url?: string | null | null
> }[] | null
> ```

***

### ports.update

`hostedWorkspace.ports.update`

Sets which ports the hosted agent exposes (`ports`, public or token-protected) and the `default_port`, given the current `version`. Removing a port deletes its token.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.ports.update({ agent_handle: 'support-agent', version: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `version` | `number` | Yes | The `version` last read; a changed version returns 409 `stale_version`. |
| `default_port` | `number \| null` | No | — |
| `ports` | `object[] \| null` | No | — |

> [accordion] ports full type
>
> ```ts theme={null}
> {
>   port: number,
>   public?: boolean
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `version` | `number \| null` | No | Send back on update to avoid overwriting a concurrent change. |
| `default_port` | `number \| null \| null` | No | — |
| `ports` | `object[] \| null` | No | — |

> [accordion] ports full type
>
> ```ts theme={null}
> {
>   port?: number | null,
>   public?: boolean | null,
>   url?: string | null | null,
>   token_url?: string | null | null
> }[] | null
> ```

***

### resize

`hostedWorkspace.resize`

Changes a stopped hosted computer's CPU and memory (`shape_id`) and optionally `disk_bytes`, given `expected_version`. Runs asynchronously; larger shapes need a paid plan.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.resize({ agent_handle: 'support-agent', shape_id: 'v1-cpu2-ram4gb', expected_version: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `shape_id` | `v1-cpu2-ram4gb \| v1-cpu4-ram8gb` | Yes | v1-cpu4-ram8gb is available on paid plans. |
| `expected_version` | `number` | Yes | — |
| `disk_bytes` | `number \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `operation_id` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |
| `snapshot_id` | `string \| null \| null` | No | — |

***

### runAction

`hostedWorkspace.runAction`

Starts, stops, pauses or resumes the hosted agent's computer (`action`) and returns an `operation_id` to poll; stop ends running programs but keeps files. Requires an admin API key.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.runAction({ action: 'start', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `action` | `start \| stop \| pause \| resume` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### schedules.create

`hostedWorkspace.schedules.create`

Creates a scheduled run for the hosted agent (cron, interval or once, in `fields`) with `expected_revision` 0. Needs a running agent; scheduled runs auto-approve tool requests.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.schedules.create({ agent_handle: 'support-agent', expected_revision: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `expected_revision` | `number` | Yes | — |
| `fields` | `object` | No | — |

> [accordion] fields full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   task?: {
>     kind: prompt | script,
>     prompt?: string | null,
>     script?: string | null
>   } | null,
>   timing?: {
>     kind: once | interval | cron,
>     timezone?: string | null,
>     at?: string | null,
>     seconds?: number | null,
>     expression?: string | null
>   } | null,
>   enabled?: boolean | null,
>   catch_up?: boolean | null,
>   reauthorize?: boolean | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `controller_effective_state` | `string \| null \| null` | No | — |
| `native_sync_status` | `string \| null \| null` | No | — |
| `command_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `registration_status` | `string \| null` | No | — |
| `schedule_id` | `string \| null` | No | — |
| `revision` | `number \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |

***

### schedules.delete

`hostedWorkspace.schedules.delete`

Deletes a hosted-agent schedule, given its current `expected_revision`.

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

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.schedules.delete({ schedule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent', expected_revision: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `schedule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `expected_revision` | `number` | Yes | — |
| `fields` | `object` | No | — |

> [accordion] fields full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   task?: {
>     kind: prompt | script,
>     prompt?: string | null,
>     script?: string | null
>   } | null,
>   timing?: {
>     kind: once | interval | cron,
>     timezone?: string | null,
>     at?: string | null,
>     seconds?: number | null,
>     expression?: string | null
>   } | null,
>   enabled?: boolean | null,
>   catch_up?: boolean | null,
>   reauthorize?: boolean | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `controller_effective_state` | `string \| null \| null` | No | — |
| `native_sync_status` | `string \| null \| null` | No | — |
| `command_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `registration_status` | `string \| null` | No | — |
| `schedule_id` | `string \| null` | No | — |
| `revision` | `number \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |

***

### schedules.list

`hostedWorkspace.schedules.list`

Lists the hosted agent's schedules with their registration status.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.schedules.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `after` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `computer_state` | `string \| null` | No | — |
| `capabilities` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   controller_effective_state?: string | null | null,
>   native_sync_status?: string | null | null,
>   conversation_id?: string | null | null,
>   id?: string | null,
>   revision?: number | null,
>   display?: {
>   } | null | null,
>   timing?: {
>   } | null,
>   timezone?: string | null,
>   enabled?: boolean | null,
>   registration_status?: string | null,
>   registration_error?: string | null | null,
>   next_run_at?: string | null | null,
>   last_result?: {
>     id?: string | null,
>     intended_due_at?: string | null,
>     started_at?: string | null | null,
>     finished_at?: string | null | null,
>     output_references?: {
>       conversation_id?: string | null,
>       message_id?: string | null,
>       availability?: string | null
>     }[] | null,
>     state?: string | null,
>     reason?: string | null | null,
>     created_at?: string | null | null,
>     updated_at?: string | null | null
>   } | null | null,
>   allowed_actions?: string[] | null
> }[] | null
> ```

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

***

### schedules.listOccurrences

`hostedWorkspace.schedules.listOccurrences`

Lists past runs of one hosted-agent schedule and the conversation that holds their output.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.schedules.listOccurrences({ schedule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `schedule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `conversation_id` | `string \| null \| null` | No | — |
| `history_completeness` | `string \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   intended_due_at?: string | null,
>   started_at?: string | null | null,
>   finished_at?: string | null | null,
>   output_references?: {
>     conversation_id?: string | null,
>     message_id?: string | null,
>     availability?: string | null
>   }[] | null,
>   state?: string | null,
>   reason?: string | null | null,
>   created_at?: string | null | null,
>   updated_at?: string | null | null
> }[] | null
> ```

***

### schedules.preview

`hostedWorkspace.schedules.preview`

Previews the next run times for a schedule `timing` (cron, interval or once) without saving anything.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.schedules.preview({
	agent_handle: 'support-agent',
	timing: { kind: 'once' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `timing` | `object` | Yes | — |

> [accordion] timing full type
>
> ```ts theme={null}
> {
>   kind: once | interval | cron,
>   timezone?: string | null,
>   at?: string | null,
>   seconds?: number | null,
>   expression?: string | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `timing` | `object \| null` | No | — |
| `next_occurrences` | `string[] \| null` | No | — |

> [accordion] timing full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   timezone?: string | null | null,
>   at?: string | null | null,
>   seconds?: number | null | null,
>   expression?: string | null | null
> } | null
> ```

***

### schedules.update

`hostedWorkspace.schedules.update`

Edits, pauses (`enabled: false`) or resumes a hosted-agent schedule via `fields`, given its current `expected_revision`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.schedules.update({ schedule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent', expected_revision: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `schedule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `expected_revision` | `number` | Yes | — |
| `fields` | `object` | No | — |

> [accordion] fields full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   task?: {
>     kind: prompt | script,
>     prompt?: string | null,
>     script?: string | null
>   } | null,
>   timing?: {
>     kind: once | interval | cron,
>     timezone?: string | null,
>     at?: string | null,
>     seconds?: number | null,
>     expression?: string | null
>   } | null,
>   enabled?: boolean | null,
>   catch_up?: boolean | null,
>   reauthorize?: boolean | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `controller_effective_state` | `string \| null \| null` | No | — |
| `native_sync_status` | `string \| null \| null` | No | — |
| `command_id` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `registration_status` | `string \| null` | No | — |
| `schedule_id` | `string \| null` | No | — |
| `revision` | `number \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |

***

### terminals.close

`hostedWorkspace.terminals.close`

Closes a terminal session on the hosted agent's computer.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.terminals.close({ terminal_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `terminal_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### terminals.create

`hostedWorkspace.terminals.create`

Opens a terminal or runs a command (`argv`, `cwd`, `env`, optional `pty`, `timeout_ms`) on the hosted agent's computer, which must be started. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.terminals.create({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `argv` | `string[]` | No | — |
| `env` | `Record<string, string>` | No | — |
| `cwd` | `string` | No | — |
| `timeout_ms` | `number` | No | — |
| `output_limit_bytes` | `number` | No | — |
| `pty` | `object` | No | — |

> [accordion] pty full type
>
> ```ts theme={null}
> {
>   rows?: number,
>   cols?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `operation_id` | `string \| null` | No | — |
| `receipt` | `object \| null` | No | — |

> [accordion] receipt full type
>
> ```ts theme={null}
> {
>   exec_id?: string | null,
>   state?: string | null,
>   exit_code?: number | null | null,
>   signal?: number | null | null,
>   stdout_bytes?: number | null,
>   stderr_bytes?: number | null,
>   stdout_truncated?: boolean | null,
>   stderr_truncated?: boolean | null
> } | null | null
> ```

***

### terminals.createTicket

`hostedWorkspace.terminals.createTicket`

Returns a short-lived ticket and URL to attach to a terminal session on the hosted agent's computer.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.terminals.createTicket({ terminal_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `terminal_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ticket` | `string \| null` | No | — |
| `expires_at` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### terminals.list

`hostedWorkspace.terminals.list`

Lists terminal sessions on the hosted agent's computer.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hostedWorkspace.terminals.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `after` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `computer_state` | `string \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   terminal?: boolean | null,
>   state?: string | null | null,
>   exit_code?: number | null | null,
>   stdout_offset?: number | null,
>   stderr_offset?: number | null,
>   output_truncated?: boolean | null
> }[] | null
> ```

***

## Hosting

### callTool

`hosting.callTool`

Sends a JSON-RPC MCP request (`method`, `params`) to the identity's hosted tools endpoint, for example to list or call the tools its hosted agent uses.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.hosting.callTool({ agent_handle: 'support-agent', jsonrpc: '2.0', method: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `jsonrpc` | `2.0` | Yes | — |
| `id` | `string \| number \| null` | No | — |
| `method` | `string` | Yes | — |
| `params` | `Record<string, any>` | No | — |

**Output:** `any`

***

### deliveries.list

`hosting.deliveries.list`

Lists up to 100 incoming-event deliveries to an identity's hosted agent, with state, attempts and last error. Page back with `before`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hosting.deliveries.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `before` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_before` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   event?: string | null,
>   state?: string | null,
>   attempts?: number | null,
>   received_at?: string | null,
>   last_error?: string | null | null,
>   retryable?: boolean | null
> }[] | null
> ```

***

### deliveries.retry

`hosting.deliveries.retry`

Re-queues a failed event delivery to the identity's hosted agent. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.hosting.deliveries.retry({ delivery_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `delivery_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### get

`hosting.get`

Returns an identity's hosted-agent configuration: harness, compute shape, state, default model, instructions, trigger events and current `generation`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.hosting.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `mode` | `string \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `machine_id` | `string \| null \| null` | No | — |
| `harness` | `string \| null \| null` | No | — |
| `tier` | `string \| null \| null` | No | — |
| `shape_id` | `string \| null \| null` | No | Initial shape preference; workspace.computer.shape\_id reports the current allocation. |
| `state` | `string \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `applied_generation` | `number \| null` | No | — |
| `default_model` | `string \| null` | No | — |
| `instructions` | `string \| null` | No | — |
| `trigger_events` | `string[] \| null` | No | — |
| `default_trigger_events` | `string[] \| null` | No | — |
| `follow_defaults` | `boolean \| null` | No | Derived equality with default\_trigger\_events; retained for older clients. |
| `credential_binding_id` | `string \| null \| null` | No | — |
| `idle_stop_enabled` | `boolean \| null` | No | — |
| `idle_timeout_seconds` | `number \| null` | No | — |
| `last_error` | `string \| null \| null` | No | — |
| `quota_blocker` | `object \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `url` | `string \| null \| null` | No | The hosted agent's address, e.g. https\://\{handle}.inkbox.sh. |
| `delivery` | `string \| null` | No | How Inkbox events reach the agent: internally, or over the identity's tunnel. |

> [accordion] quota\_blocker full type
>
> ```ts theme={null}
> {
>   resource?: string | null,
>   usage?: number | null,
>   limit?: number | null
> } | null | null
> ```

***

### set

`hosting.set`

Configures an identity's hosted agent (harness, `shape_id`, `default_model`, `instructions`, `trigger_events`) at `expected_generation`; admin key only. `enabled: false` deletes the computer and its files.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.hosting.set({ agent_handle: 'support-agent', expected_generation: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `expected_generation` | `number` | Yes | — |
| `enabled` | `boolean` | No | — |
| `harness` | `codex \| hermes \| claude_code \| opencode \| deepseek \| openclaw \| null` | No | — |
| `tier` | `medium \| null` | No | — |
| `shape_id` | `v1-cpu2-ram4gb \| v1-cpu4-ram8gb \| null` | No | Initial compute shape; defaults to v1-cpu2-ram4gb. v1-cpu4-ram8gb is available on paid plans. Use workspace resize to change an existing computer. |
| `default_model` | `gpt-6-luna \| gpt-6.1-terra \| gpt-6.1-sol \| gpt-6-astra \| claude-haiku-5-5 \| claude-sonnet-5-5 \| claude-opus-5-5 \| claude-fable-5-2 \| deepseek-flash \| deepseek-v4-pro \| null` | No | — |
| `instructions` | `string \| null` | No | — |
| `trigger_events` | `(message.received \| message.sent \| message.forwarded \| message.delivered \| message.bounced \| message.failed \| text.received \| text.sent \| text.delivered \| text.delivery_failed \| text.delivery_unconfirmed \| call.ended \| imessage.received \| imessage.reaction_received \| imessage.sent \| imessage.delivered \| imessage.delivery_failed \| message.transcription_finished \| whatsapp.reaction_received \| whatsapp.received \| whatsapp.sent \| whatsapp.delivered \| whatsapp.delivery_failed \| whatsapp.delivery_unconfirmed \| a2a.task.created \| a2a.task.message \| a2a.task.canceled \| a2a.sent_task.updated \| slack.dm_received \| slack.group_dm_received \| slack.channel_message_received \| slack.mention_received \| slack.thread_reply_received \| slack.message_updated \| slack.message_deleted \| slack.reaction_added \| slack.reaction_removed \| slack.member_joined \| slack.member_left \| slack.channel_updated \| slack.file_shared \| slack.file_changed \| slack.file_deleted \| slack.pin_added \| slack.pin_removed \| slack.connection_changed \| slack.message_sent \| slack.message_send_failed \| slack.message_send_unknown \| slack.interaction \| slack.session_stopped)[] \| null` | No | — |
| `follow_defaults` | `boolean \| null` | No | Legacy reset shortcut; true selects the current defaults. No automatic following. |
| `credential_binding_id` | `string \| null` | No | Omit to preserve the current key. Null selects included credits; a UUID selects a saved key. |
| `idle_stop_enabled` | `true \| null` | No | Automatic idle shutdown is required; only true is accepted. |
| `reset_instructions` | `boolean` | No | — |
| `idle_timeout_seconds` | `60 \| 300 \| null` | No | Sleep after 1 or 5 minutes of inactivity. New agents default to 60 seconds. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `mode` | `string \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `machine_id` | `string \| null \| null` | No | — |
| `harness` | `string \| null \| null` | No | — |
| `tier` | `string \| null \| null` | No | — |
| `shape_id` | `string \| null \| null` | No | Initial shape preference; workspace.computer.shape\_id reports the current allocation. |
| `state` | `string \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `applied_generation` | `number \| null` | No | — |
| `default_model` | `string \| null` | No | — |
| `instructions` | `string \| null` | No | — |
| `trigger_events` | `string[] \| null` | No | — |
| `default_trigger_events` | `string[] \| null` | No | — |
| `follow_defaults` | `boolean \| null` | No | Derived equality with default\_trigger\_events; retained for older clients. |
| `credential_binding_id` | `string \| null \| null` | No | — |
| `idle_stop_enabled` | `boolean \| null` | No | — |
| `idle_timeout_seconds` | `number \| null` | No | — |
| `last_error` | `string \| null \| null` | No | — |
| `quota_blocker` | `object \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `url` | `string \| null \| null` | No | The hosted agent's address, e.g. https\://\{handle}.inkbox.sh. |
| `delivery` | `string \| null` | No | How Inkbox events reach the agent: internally, or over the identity's tunnel. |

> [accordion] quota\_blocker full type
>
> ```ts theme={null}
> {
>   resource?: string | null,
>   usage?: number | null,
>   limit?: number | null
> } | null | null
> ```

***

## Identities

### avatar.delete

`identities.avatar.delete`

Removes an identity's avatar so future contact cards go out without a photo. Succeeds even when no avatar is set.

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

```ts theme={null}
await corsair.inkbox.api.identities.avatar.delete({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### avatar.get

`identities.avatar.get`

Downloads an identity's avatar as a 600x600 JPEG image.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.avatar.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

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

***

### avatar.getMetadata

`identities.avatar.getMetadata`

Returns whether an identity has an avatar, its content type, and a temporary authorized URL to fetch it.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.avatar.getMetadata({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `content_type` | `string \| null \| null` | No | — |
| `authorized_url` | `string \| null \| null` | No | — |
| `expires_at` | `string \| null \| null` | No | — |

***

### avatar.setFromStagedMedia

`identities.avatar.setFromStagedMedia`

Sets an identity's avatar from a previously uploaded staged media file (`staged_media_handle`) instead of a direct upload.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.avatar.setFromStagedMedia({ agent_handle: 'support-agent', staged_media_handle: 'examplexxxxxxxxxxxxxxxxxxxxxxxxxxxxx' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `staged_media_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string \| null` | No | — |
| `agent_handle` | `string \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `sha256` | `string \| null \| null` | No | — |

***

### avatar.upload

`identities.avatar.upload`

Uploads or replaces an identity's avatar image (`file`, multipart), used as the photo on the contact cards it shares.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.avatar.upload({
	agent_handle: 'support-agent',
	file: { base64: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', filename: 'avatar.png', contentType: 'image/png' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `file` | `string \| object \| custom` | Yes | A file: a public URL to it, or \{url, filename?, contentType?}, or \{base64, filename?, contentType?} for a small one. |

> [accordion] file full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `agent_handle` | `string \| null` | No | — |
| `display_name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `whatsapp_enabled` | `boolean \| null` | No | — |
| `whatsapp_configured` | `boolean \| null` | No | — |
| `whatsapp_number` | `string \| null \| null` | No | — |
| `imessage_enabled` | `boolean \| null` | No | — |
| `contact_sharing_enabled` | `boolean \| null` | No | — |
| `imessage_filter_mode` | `string \| null` | No | — |
| `mail_filter_mode` | `string \| null` | No | — |
| `phone_filter_mode` | `string \| null` | No | — |
| `slack_filter_mode` | `string \| null` | No | — |
| `slack_inbound_filter_mode` | `string \| null` | No | — |
| `slack_outbound_filter_mode` | `string \| null` | No | — |
| `mail_inbound_filter_mode` | `string \| null` | No | — |
| `mail_outbound_filter_mode` | `string \| null` | No | — |
| `phone_inbound_filter_mode` | `string \| null` | No | — |
| `phone_outbound_filter_mode` | `string \| null` | No | — |
| `email_address` | `string \| null \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `signing_key_configured` | `boolean \| null` | No | — |
| `signing_key_created_at` | `string \| null \| null` | No | — |

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

***

### companion.get

`identities.companion.get`

Returns an identity's Companion mode setting (whether it can join group conversations when an allowed sender brings it in) and per-channel readiness.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.companion.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `config_revision` | `number \| null` | No | — |
| `readiness` | `object \| null` | No | — |

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

> [accordion] readiness full type
>
> ```ts theme={null}
> Record<string, {
>   ready?: boolean | null,
>   reasons?: string[] | null
> }> | null
> ```

***

### companion.getHistory

`identities.companion.getHistory`

Returns the authorized message history for one Companion mode activation (`activation_id`), including the sponsor's triggering message, page by page.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.companion.getHistory({ activation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `activation_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `scope_id` | `string \| null` | No | — |
| `activation_id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `channel` | `string \| null` | No | — |
| `items` | `object[] \| null` | No | — |
| `history_complete` | `boolean \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `reply_context` | `object \| null` | No | — |

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   author?: string | null,
>   occurred_at?: string | null,
>   text?: string | null,
>   historical?: boolean | null,
>   is_trigger?: boolean | null,
>   attachments?: {
>   }[] | null,
>   sender_access?: string | null
> }[] | null
> ```

> [accordion] reply\_context full type
>
> ```ts theme={null}
> {
>   channel?: string | null,
>   conversation_id?: string | null,
>   connection_id?: string | null | null,
>   slack_conversation_id?: string | null | null,
>   thread_ts?: string | null | null,
>   reply_to_message_id?: string | null | null,
>   to?: string[] | null | null,
>   cc?: string[] | null | null
> } | null
> ```

***

### companion.listConversations

`identities.companion.listConversations`

Lists an identity's Companion mode conversation scopes (pending or active sponsorship), optionally filtered by `channel`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.companion.listConversations({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `channel` | `mail \| phone \| imessage \| slack \| whatsapp \| null` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   scope_id?: string | null,
>   conversation_id?: string | null,
>   channel?: string | null,
>   status?: string | null,
>   activation_id?: string | null | null,
>   reply_ready?: boolean | null,
>   reasons?: string[] | null
> }[] | null
> ```

***

### companion.update

`identities.companion.update`

Turns Companion mode on or off (`enabled`) for an identity. Requires an admin API key; it never creates contact rules or channels.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.companion.update({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `enabled` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `config_revision` | `number \| null` | No | — |
| `readiness` | `object \| null` | No | — |

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

> [accordion] readiness full type
>
> ```ts theme={null}
> Record<string, {
>   ready?: boolean | null,
>   reasons?: string[] | null
> }> | null
> ```

***

### connectImessageNumber

`identities.connectImessageNumber`

Attaches an existing dedicated iMessage number (`imessage_number_id`) to an identity.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.connectImessageNumber({ agent_handle: 'support-agent', imessage_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `imessage_number_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `number` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `line_role` | `string \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `inbound_only` | `boolean \| null` | No | Deprecated compatibility field; dedicated lines can initiate. |

***

### contactAccess.get

`identities.contactAccess.get`

Returns what an identity can see and contact for one contact: email and phone visibility, addresses it may send to or receive from, profile and memories. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.contactAccess.get({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `email` | `object \| null` | No | — |
| `phone` | `object \| null` | No | — |
| `profile` | `boolean \| null` | No | — |
| `memories` | `boolean \| null` | No | — |

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

> [accordion] email full type
>
> ```ts theme={null}
> {
>   visible?: boolean | null,
>   contactable?: string[] | null,
>   inbound_contactable?: string[] | null,
>   outbound_contactable?: string[] | null
> } | null
> ```

> [accordion] phone full type
>
> ```ts theme={null}
> {
>   visible?: boolean | null,
>   contactable?: string[] | null,
>   inbound_contactable?: string[] | null,
>   outbound_contactable?: string[] | null
> } | null
> ```

***

### contactAccess.update

`identities.contactAccess.update`

Sets an identity's access to one contact by group: `email` and `phone` visibility and inbound/outbound contactable lists (replacing that side), `profile` and `memories`. Admin API key only.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.contactAccess.update({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `email` | `object` | No | — |
| `phone` | `object` | No | — |
| `profile` | `boolean` | No | — |
| `memories` | `boolean` | No | — |

> [accordion] email full type
>
> ```ts theme={null}
> {
>   visible?: boolean,
>   contactable?: string[],
>   inbound_contactable?: string[],
>   outbound_contactable?: string[]
> }
> ```

> [accordion] phone full type
>
> ```ts theme={null}
> {
>   visible?: boolean,
>   contactable?: string[],
>   inbound_contactable?: string[],
>   outbound_contactable?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `email` | `object \| null` | No | — |
| `phone` | `object \| null` | No | — |
| `profile` | `boolean \| null` | No | — |
| `memories` | `boolean \| null` | No | — |

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

> [accordion] email full type
>
> ```ts theme={null}
> {
>   visible?: boolean | null,
>   contactable?: string[] | null,
>   inbound_contactable?: string[] | null,
>   outbound_contactable?: string[] | null
> } | null
> ```

> [accordion] phone full type
>
> ```ts theme={null}
> {
>   visible?: boolean | null,
>   contactable?: string[] | null,
>   inbound_contactable?: string[] | null,
>   outbound_contactable?: string[] | null
> } | null
> ```

***

### contactPermissions.get

`identities.contactPermissions.get`

Returns an identity's legacy per-address email and phone permissions (inbound and outbound) for one contact, plus profile and memories access. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.contactPermissions.get({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `emails` | `Record<string, boolean> \| null` | No | — |
| `phones` | `Record<string, boolean> \| null` | No | — |
| `inbound_emails` | `Record<string, boolean> \| null` | No | — |
| `outbound_emails` | `Record<string, boolean> \| null` | No | — |
| `inbound_phones` | `Record<string, boolean> \| null` | No | — |
| `outbound_phones` | `Record<string, boolean> \| null` | No | — |
| `profile` | `boolean \| null` | No | — |
| `memories` | `boolean \| null` | No | — |

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

***

### contactPermissions.list

`identities.contactPermissions.list`

Lists every contact in the organization with an identity's permissions, including contacts hidden from that identity. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.contactPermissions.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `q` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `order` | `name \| recent` | No | — |
| `review_status` | `(unreviewed \| confirmed)[] \| null` | No | — |

**Output**

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

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     preferred_name?: string | null | null,
>     given_name?: string | null | null,
>     family_name?: string | null | null,
>     company_name?: string | null | null,
>     review_status?: string | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null
>   } | null,
>   revision?: number | null,
>   visibility?: {
>     defaults?: {
>       profile?: string | null,
>       memories?: string | null
>     } | null,
>     identity_override?: {
>       profile?: string | null,
>       memories?: string | null
>     } | null
>   } | null,
>   effective?: {
>     profile?: boolean | null,
>     memories?: boolean | null,
>     email?: string | null,
>     phone?: string | null,
>     inbound_email?: string | null,
>     outbound_email?: string | null,
>     inbound_phone?: string | null,
>     outbound_phone?: string | null
>   } | null,
>   access?: {
>     notices?: {
>       code?: string | null,
>       level?: string | null,
>       message?: string | null
>     }[] | null | null,
>     email?: {
>       visible?: boolean | null,
>       contactable?: string[] | null,
>       inbound_contactable?: string[] | null,
>       outbound_contactable?: string[] | null
>     } | null,
>     phone?: {
>       visible?: boolean | null,
>       contactable?: string[] | null,
>       inbound_contactable?: string[] | null,
>       outbound_contactable?: string[] | null
>     } | null,
>     profile?: boolean | null,
>     memories?: boolean | null
>   } | null | null
> }[] | null
> ```

***

### contactPermissions.update

`identities.contactPermissions.update`

Updates an identity's legacy permissions for one contact: `emails`/`phones` maps set both directions, `inbound_*`/`outbound_*` maps set one. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.contactPermissions.update({ contact_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `emails` | `Record<string, boolean>` | No | — |
| `phones` | `Record<string, boolean>` | No | — |
| `inbound_emails` | `Record<string, boolean>` | No | — |
| `outbound_emails` | `Record<string, boolean>` | No | — |
| `inbound_phones` | `Record<string, boolean>` | No | — |
| `outbound_phones` | `Record<string, boolean>` | No | — |
| `profile` | `boolean` | No | — |
| `memories` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `emails` | `Record<string, boolean> \| null` | No | — |
| `phones` | `Record<string, boolean> \| null` | No | — |
| `inbound_emails` | `Record<string, boolean> \| null` | No | — |
| `outbound_emails` | `Record<string, boolean> \| null` | No | — |
| `inbound_phones` | `Record<string, boolean> \| null` | No | — |
| `outbound_phones` | `Record<string, boolean> \| null` | No | — |
| `profile` | `boolean \| null` | No | — |
| `memories` | `boolean \| null` | No | — |

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

***

### create

`identities.create`

Creates an agent identity (`agent_handle`) with its mailbox and tunnel, optionally provisioning a phone number, claiming an iMessage line or attaching vault secrets.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.identities.create({ agent_handle: 'support-agent', display_name: 'Support Agent', description: 'Answers customer email for the support team.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | Agent handle for the identity. A leading '@' is stripped automatically and the handle must be globally unique. |
| `display_name` | `string \| null` | No | Human-readable display name for the identity. Defaults to agent\_handle if omitted. |
| `description` | `string \| null` | No | Free-form description of what the identity is. Visible only to your org. |
| `imessage_enabled` | `boolean` | No | Whether this identity can be reached through the shared iMessage service. Defaults to false; set true to opt in. |
| `whatsapp_enabled` | `boolean` | No | Whether this identity can be reached through WhatsApp. Defaults to false; set true to opt in. Paid plans include WhatsApp through shared numbers on one agent; other WhatsApp access is invite-only while in beta. |
| `contact_sharing_enabled` | `boolean` | No | Whether an attached dedicated iMessage line automatically shares this identity's name and optional avatar. Defaults to true. |
| `claim_imessage_number` | `true \| null` | No | Claim and attach a dedicated iMessage line during identity creation. Requires imessage\_enabled=true. |
| `mailbox` | `object \| null` | No | Optional mailbox-spec; the mailbox is always created. Omit to default to the org's sending domain with a server-chosen local part. |
| `tunnel` | `object \| null` | No | Optional tunnel-spec. Unless `hosted` is true, the tunnel is provisioned with name = agent\_handle; this body only opts into PASSTHROUGH or sets a description. |
| `hosted` | `boolean` | No | Create the identity for an Inkbox-hosted agent. Hosted agents receive events without a tunnel, so none is created and `tunnel` must be omitted. |
| `phone_number` | `object \| null` | No | Optional phone-number provisioning payload to create and link a phone number to the identity during identity creation. |
| `vault_secret_ids` | `string \| string[] \| * \| all \| null` | No | Optional vault secret attachment request to scope vault secret access to the newly created agent identity. |

> [accordion] mailbox full type
>
> ```ts theme={null}
> {
>   email_local_part?: string | null,
>   sending_domain?: string | null
> } | null
> ```

> [accordion] tunnel full type
>
> ```ts theme={null}
> {
>   tls_mode?: edge | passthrough
> } | null
> ```

> [accordion] phone\_number full type
>
> ```ts theme={null}
> {
>   type?: local | toll_free,
>   state?: string | null,
>   incoming_call_action?: auto_accept | auto_reject | webhook | hosted_agent | forward,
>   client_websocket_url?: string | null,
>   incoming_call_webhook_url?: string | null,
>   forwarding_target_type?: phone | sip | null,
>   forwarding_phone_number?: string | null,
>   forwarding_sip_uri?: string | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `agent_handle` | `string \| null` | No | — |
| `display_name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `whatsapp_enabled` | `boolean \| null` | No | — |
| `whatsapp_configured` | `boolean \| null` | No | — |
| `whatsapp_number` | `string \| null \| null` | No | — |
| `imessage_enabled` | `boolean \| null` | No | — |
| `contact_sharing_enabled` | `boolean \| null` | No | — |
| `imessage_filter_mode` | `string \| null` | No | — |
| `mail_filter_mode` | `string \| null` | No | — |
| `phone_filter_mode` | `string \| null` | No | — |
| `slack_filter_mode` | `string \| null` | No | — |
| `slack_inbound_filter_mode` | `string \| null` | No | — |
| `slack_outbound_filter_mode` | `string \| null` | No | — |
| `mail_inbound_filter_mode` | `string \| null` | No | — |
| `mail_outbound_filter_mode` | `string \| null` | No | — |
| `phone_inbound_filter_mode` | `string \| null` | No | — |
| `phone_outbound_filter_mode` | `string \| null` | No | — |
| `email_address` | `string \| null \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `signing_key_configured` | `boolean \| null` | No | — |
| `signing_key_created_at` | `string \| null \| null` | No | — |
| `hosting_mode` | `string \| null` | No | — |
| `mailbox` | `object \| null` | No | — |
| `phone_number` | `object \| null` | No | — |
| `imessage_number` | `object \| null` | No | — |
| `tunnel` | `object \| null` | No | — |

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

> [accordion] mailbox full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   email_address?: string | null,
>   status?: string | null,
>   sending_domain?: string | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   storage_used_bytes?: number | null,
>   storage_limit_bytes?: number | null | null,
>   signature_html?: string | null | null,
>   signature_text?: string | null | null,
>   signature_enabled?: boolean | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null,
>   unread_count?: number | null | null
> } | null | null
> ```

> [accordion] phone\_number full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   status?: string | null,
>   sms_status?: string | null,
>   sms_error_code?: string | null | null,
>   sms_error_detail?: string | null | null,
>   sms_ready_at?: string | null | null,
>   incoming_call_action?: string | null,
>   client_websocket_url?: string | null | null,
>   incoming_call_webhook_url?: string | null | null,
>   forwarding_target_type?: string | null | null,
>   forwarding_phone_number?: string | null | null,
>   forwarding_sip_uri?: string | null | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   country?: string | null,
>   state?: string | null | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null
> } | null | null
> ```

> [accordion] imessage\_number full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   line_role?: string | null,
>   status?: string | null | null,
>   inbound_only?: boolean | null
> } | null | null
> ```

> [accordion] tunnel full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   tunnel_name?: string | null,
>   agent_identity_id?: string | null | null,
>   tls_mode?: string | null,
>   status?: string | null,
>   public_host?: string | null,
>   zone?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### createTunnel

`identities.createTunnel`

Creates the tunnel for an identity that has none (for example one created with `hosted: true`), named after its handle. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.createTunnel({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `tunnel_name` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | Identifier of the identity associated with this tunnel, when available. |
| `tls_mode` | `string \| null` | No | — |
| `cert_pem` | `string \| null \| null` | No | — |
| `cert_fingerprint_sha256` | `string \| null \| null` | No | — |
| `cert_expires_at` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `last_connected_at` | `string \| null \| null` | No | — |
| `last_connected_ip_addr` | `string \| null \| null` | No | Caller IP (leftmost X-Forwarded-For hop, falling back to the direct peer) recorded at the most recent /\_system/hello. |
| `last_disconnected_at` | `string \| null \| null` | No | Best-effort timestamp of the most recently observed transition from connected to disconnected. Null means no disconnect has been recorded. Use `currently_connected` for current liveness. |
| `currently_connected` | `boolean \| null` | No | Live agent-connection state at read time: true if at least one agent connection is registered in Redis. Always resolved live on every tunnels endpoint — runtime state never appears as a stale placeholder. Identity payloads embed `TunnelSummaryResponse` instead, which carries no liveness. |
| `public_host` | `string \| null` | No | Per-tunnel public hostname, e.g. `my-agent.inkboxwire.com` in production (non-production environments include the environment label in the tunnel zone, e.g. `my-agent.beta.inkboxwire.com`). Use this for constructing the public URL the third party hits. |
| `zone` | `string \| null` | No | Tunnel zone host, e.g. `inkboxwire.com` in production. Use this as the data-plane h2 endpoint — the agent connects to `https://{zone}/_system/connect`, not to `https://{public_host}/_system/connect`. |
| `metadata` | `object \| null` | No | Customer-supplied free-form metadata, set via `PATCH /tunnels/{id}` with `metadata={...}`. Returned as-is on read. Empty dict (`{}`) when unset or cleared. Capped at 4 KB serialized JSON; over-limit writes return 422. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

### delete

`identities.delete`

Deletes an identity with its mailbox and tunnel, revokes its scoped API keys and releases its phone number to the carrier. Cannot be undone; the handle stays reserved.

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

```ts theme={null}
await corsair.inkbox.api.identities.delete({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### disconnectImessageNumber

`identities.disconnectImessageNumber`

Detaches the dedicated iMessage number from an identity.

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

```ts theme={null}
await corsair.inkbox.api.identities.disconnectImessageNumber({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### domainAffiliation.get

`identities.domainAffiliation.get`

Returns the verified organization domain an identity is affiliated with, as shown to A2A peers, and the affiliation's validity.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.domainAffiliation.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_claim_id` | `string \| null \| null` | No | — |
| `domain` | `string \| null \| null` | No | — |
| `affiliation` | `object \| null` | No | — |

> [accordion] affiliation full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   verifier?: string | null,
>   last_success_at?: string | null,
>   valid_until?: string | null
> } | null | null
> ```

***

### domainAffiliation.remove

`identities.domainAffiliation.remove`

Removes an identity's affiliation with a verified organization domain.

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

```ts theme={null}
await corsair.inkbox.api.identities.domainAffiliation.remove({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### domainAffiliation.set

`identities.domainAffiliation.set`

Affiliates an identity with a verified organization domain claim (`domain_claim_id`) so A2A peers see it belongs to that domain's owner.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.domainAffiliation.set({ agent_handle: 'support-agent', domain_claim_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `domain_claim_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain_claim_id` | `string \| null \| null` | No | — |
| `domain` | `string \| null \| null` | No | — |
| `affiliation` | `object \| null` | No | — |

> [accordion] affiliation full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   verifier?: string | null,
>   last_success_at?: string | null,
>   valid_until?: string | null
> } | null | null
> ```

***

### get

`identities.get`

Returns one identity with its linked mailbox, tunnel, phone number and iMessage line, plus its channel and filter settings.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.get({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `agent_handle` | `string \| null` | No | — |
| `display_name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `whatsapp_enabled` | `boolean \| null` | No | — |
| `whatsapp_configured` | `boolean \| null` | No | — |
| `whatsapp_number` | `string \| null \| null` | No | — |
| `imessage_enabled` | `boolean \| null` | No | — |
| `contact_sharing_enabled` | `boolean \| null` | No | — |
| `imessage_filter_mode` | `string \| null` | No | — |
| `mail_filter_mode` | `string \| null` | No | — |
| `phone_filter_mode` | `string \| null` | No | — |
| `slack_filter_mode` | `string \| null` | No | — |
| `slack_inbound_filter_mode` | `string \| null` | No | — |
| `slack_outbound_filter_mode` | `string \| null` | No | — |
| `mail_inbound_filter_mode` | `string \| null` | No | — |
| `mail_outbound_filter_mode` | `string \| null` | No | — |
| `phone_inbound_filter_mode` | `string \| null` | No | — |
| `phone_outbound_filter_mode` | `string \| null` | No | — |
| `email_address` | `string \| null \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `signing_key_configured` | `boolean \| null` | No | — |
| `signing_key_created_at` | `string \| null \| null` | No | — |
| `hosting_mode` | `string \| null` | No | — |
| `mailbox` | `object \| null` | No | — |
| `phone_number` | `object \| null` | No | — |
| `imessage_number` | `object \| null` | No | — |
| `tunnel` | `object \| null` | No | — |

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

> [accordion] mailbox full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   email_address?: string | null,
>   status?: string | null,
>   sending_domain?: string | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   storage_used_bytes?: number | null,
>   storage_limit_bytes?: number | null | null,
>   signature_html?: string | null | null,
>   signature_text?: string | null | null,
>   signature_enabled?: boolean | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null,
>   unread_count?: number | null | null
> } | null | null
> ```

> [accordion] phone\_number full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   status?: string | null,
>   sms_status?: string | null,
>   sms_error_code?: string | null | null,
>   sms_error_detail?: string | null | null,
>   sms_ready_at?: string | null | null,
>   incoming_call_action?: string | null,
>   client_websocket_url?: string | null | null,
>   incoming_call_webhook_url?: string | null | null,
>   forwarding_target_type?: string | null | null,
>   forwarding_phone_number?: string | null | null,
>   forwarding_sip_uri?: string | null | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   country?: string | null,
>   state?: string | null | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null
> } | null | null
> ```

> [accordion] imessage\_number full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   line_role?: string | null,
>   status?: string | null | null,
>   inbound_only?: boolean | null
> } | null | null
> ```

> [accordion] tunnel full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   tunnel_name?: string | null,
>   agent_identity_id?: string | null | null,
>   tls_mode?: string | null,
>   status?: string | null,
>   public_host?: string | null,
>   zone?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### getChannelStatus

`identities.getChannelStatus`

Returns which channels an identity can use right now: email and sending domain, phone, SMS and calling availability, iMessage and WhatsApp status.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.getChannelStatus({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string \| null` | No | — |
| `email` | `object \| null` | No | — |
| `sending_domain` | `object \| null` | No | — |
| `phone` | `object \| null` | No | — |
| `imessage` | `object \| null` | No | — |
| `whatsapp` | `object \| null` | No | — |
| `calling_available` | `boolean \| null` | No | — |
| `sms_available` | `boolean \| null` | No | — |

> [accordion] email full type
>
> ```ts theme={null}
> {
>   assigned?: boolean | null,
>   address?: string | null | null,
>   status?: string | null | null
> } | null
> ```

> [accordion] sending\_domain full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   domain?: string | null,
>   status?: string | null
> } | null | null
> ```

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

> [accordion] imessage full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   dedicated_number?: string | null | null,
>   status?: string | null | null,
>   awaiting_inbound?: {
>     remote_number?: string | null,
>     connected_at?: string | null
>   }[] | null
> } | null
> ```

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

***

### getCurrent

`identities.getCurrent`

Returns the identity the calling agent-scoped API key belongs to.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.getCurrent({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `agent_handle` | `string \| null` | No | — |
| `display_name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `whatsapp_enabled` | `boolean \| null` | No | — |
| `whatsapp_configured` | `boolean \| null` | No | — |
| `whatsapp_number` | `string \| null \| null` | No | — |
| `imessage_enabled` | `boolean \| null` | No | — |
| `contact_sharing_enabled` | `boolean \| null` | No | — |
| `imessage_filter_mode` | `string \| null` | No | — |
| `mail_filter_mode` | `string \| null` | No | — |
| `phone_filter_mode` | `string \| null` | No | — |
| `slack_filter_mode` | `string \| null` | No | — |
| `slack_inbound_filter_mode` | `string \| null` | No | — |
| `slack_outbound_filter_mode` | `string \| null` | No | — |
| `mail_inbound_filter_mode` | `string \| null` | No | — |
| `mail_outbound_filter_mode` | `string \| null` | No | — |
| `phone_inbound_filter_mode` | `string \| null` | No | — |
| `phone_outbound_filter_mode` | `string \| null` | No | — |
| `email_address` | `string \| null \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `signing_key_configured` | `boolean \| null` | No | — |
| `signing_key_created_at` | `string \| null \| null` | No | — |
| `hosting_mode` | `string \| null` | No | — |
| `mailbox` | `object \| null` | No | — |
| `phone_number` | `object \| null` | No | — |
| `imessage_number` | `object \| null` | No | — |
| `tunnel` | `object \| null` | No | — |

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

> [accordion] mailbox full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   email_address?: string | null,
>   status?: string | null,
>   sending_domain?: string | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   storage_used_bytes?: number | null,
>   storage_limit_bytes?: number | null | null,
>   signature_html?: string | null | null,
>   signature_text?: string | null | null,
>   signature_enabled?: boolean | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null,
>   unread_count?: number | null | null
> } | null | null
> ```

> [accordion] phone\_number full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   status?: string | null,
>   sms_status?: string | null,
>   sms_error_code?: string | null | null,
>   sms_error_detail?: string | null | null,
>   sms_ready_at?: string | null | null,
>   incoming_call_action?: string | null,
>   client_websocket_url?: string | null | null,
>   incoming_call_webhook_url?: string | null | null,
>   forwarding_target_type?: string | null | null,
>   forwarding_phone_number?: string | null | null,
>   forwarding_sip_uri?: string | null | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   country?: string | null,
>   state?: string | null | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null
> } | null | null
> ```

> [accordion] imessage\_number full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   line_role?: string | null,
>   status?: string | null | null,
>   inbound_only?: boolean | null
> } | null | null
> ```

> [accordion] tunnel full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   tunnel_name?: string | null,
>   agent_identity_id?: string | null | null,
>   tls_mode?: string | null,
>   status?: string | null,
>   public_host?: string | null,
>   zone?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### list

`identities.list`

Lists all identities in the organization, newest first, each with its mailbox, tunnel, phone number and iMessage line.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   organization_id?: string | null,
>   agent_handle?: string | null,
>   display_name?: string | null | null,
>   description?: string | null | null,
>   status?: string | null,
>   whatsapp_enabled?: boolean | null,
>   whatsapp_configured?: boolean | null,
>   whatsapp_number?: string | null | null,
>   imessage_enabled?: boolean | null,
>   contact_sharing_enabled?: boolean | null,
>   imessage_filter_mode?: string | null,
>   mail_filter_mode?: string | null,
>   phone_filter_mode?: string | null,
>   slack_filter_mode?: string | null,
>   slack_inbound_filter_mode?: string | null,
>   slack_outbound_filter_mode?: string | null,
>   mail_inbound_filter_mode?: string | null,
>   mail_outbound_filter_mode?: string | null,
>   phone_inbound_filter_mode?: string | null,
>   phone_outbound_filter_mode?: string | null,
>   email_address?: string | null | null,
>   has_avatar?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   signing_key_configured?: boolean | null,
>   signing_key_created_at?: string | null | null,
>   hosting_mode?: string | null,
>   mailbox?: {
>     notices?: {
>       code?: string | null,
>       level?: string | null,
>       message?: string | null
>     }[] | null | null,
>     id?: string | null,
>     email_address?: string | null,
>     status?: string | null,
>     sending_domain?: string | null,
>     filter_mode?: string | null,
>     inbound_filter_mode?: string | null,
>     outbound_filter_mode?: string | null,
>     agent_identity_id?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     storage_used_bytes?: number | null,
>     storage_limit_bytes?: number | null | null,
>     signature_html?: string | null | null,
>     signature_text?: string | null | null,
>     signature_enabled?: boolean | null,
>     filter_mode_change_notice?: {
>       new_filter_mode?: string | null,
>       redundant_rule_action?: string | null,
>       redundant_rule_count?: number | null
>     } | null | null,
>     unread_count?: number | null | null
>   } | null | null,
>   phone_number?: {
>     notices?: {
>       code?: string | null,
>       level?: string | null,
>       message?: string | null
>     }[] | null | null,
>     id?: string | null,
>     number?: string | null,
>     type?: string | null,
>     status?: string | null,
>     sms_status?: string | null,
>     sms_error_code?: string | null | null,
>     sms_error_detail?: string | null | null,
>     sms_ready_at?: string | null | null,
>     incoming_call_action?: string | null,
>     client_websocket_url?: string | null | null,
>     incoming_call_webhook_url?: string | null | null,
>     forwarding_target_type?: string | null | null,
>     forwarding_phone_number?: string | null | null,
>     forwarding_sip_uri?: string | null | null,
>     filter_mode?: string | null,
>     inbound_filter_mode?: string | null,
>     outbound_filter_mode?: string | null,
>     country?: string | null,
>     state?: string | null | null,
>     agent_identity_id?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     filter_mode_change_notice?: {
>       new_filter_mode?: string | null,
>       redundant_rule_action?: string | null,
>       redundant_rule_count?: number | null
>     } | null | null
>   } | null | null,
>   imessage_number?: {
>     id?: string | null,
>     number?: string | null,
>     type?: string | null,
>     line_role?: string | null,
>     status?: string | null | null,
>     inbound_only?: boolean | null
>   } | null | null,
>   tunnel?: {
>     id?: string | null,
>     tunnel_name?: string | null,
>     agent_identity_id?: string | null | null,
>     tls_mode?: string | null,
>     status?: string | null,
>     public_host?: string | null,
>     zone?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null | null
> }[]
> ```

***

### listContactCommunicationPolicies

`identities.listContactCommunicationPolicies`

Lists an identity's per-contact communication policies (which contact addresses it may use) with paging.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.listContactCommunicationPolicies({ agent_handle: 'support-agent' });
```

**Input**

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

**Output**

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

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   identity_id?: string | null,
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null,
>     memory_count?: number | null,
>     latest_memory?: {
>       id?: string | null,
>       content?: string | null,
>       updated_at?: string | null
>     } | null | null
>   } | null | null,
>   email?: boolean | null,
>   phone?: boolean | null,
>   inbound_email?: boolean | null,
>   outbound_email?: boolean | null,
>   inbound_phone?: boolean | null,
>   outbound_phone?: boolean | null,
>   full_profile?: boolean | null,
>   visibility?: {
>     profile?: boolean | null,
>     memories?: boolean | null
>   } | null
> }[] | null
> ```

***

### mailContactRules.create

`identities.mailContactRules.create`

Creates an email allow or block rule (`action`) for an identity matching an exact address or domain (`match_type`, `match_target`), optionally per `direction`. Admin API key only.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.mailContactRules.create({
	agent_handle: 'support-agent',
	action: 'allow',
	match_type: 'exact_email',
	match_target: 'example.com',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `action` | `allow \| block` | Yes | — |
| `match_type` | `exact_email \| domain` | Yes | — |
| `match_target` | `string` | Yes | What the rule matches against. For EXACT\_EMAIL: a full email address (stored lowercased). For DOMAIN: a bare domain like 'gmail.com'. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### mailContactRules.delete

`identities.mailContactRules.delete`

Deletes an email contact rule from an identity. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.identities.mailContactRules.delete({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### mailContactRules.get

`identities.mailContactRules.get`

Returns one email allow or block rule of an identity by `rule_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.mailContactRules.get({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### mailContactRules.list

`identities.mailContactRules.list`

Lists an identity's email allow and block rules, newest first, filterable by `action`, `match_type` and `direction`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.mailContactRules.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_email \| domain \| null` | No | Filter by exact\_email or domain. |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | Max rules to return. |
| `offset` | `number` | No | Number of rules to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### mailContactRules.update

`identities.mailContactRules.update`

Changes an email contact rule's `action` or `direction`, or edits one side with `apply_to`. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.mailContactRules.update({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | — |
| `direction` | `inbound \| outbound \| both \| null` | No | — |
| `apply_to` | `inbound \| outbound \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### phoneContactRules.create

`identities.phoneContactRules.create`

Creates a phone allow or block rule for an E.164 number (`match_target`) covering an identity's SMS, calls, iMessage and WhatsApp, optionally per `direction`. Admin API key only.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.phoneContactRules.create({
	agent_handle: 'support-agent',
	action: 'block',
	match_type: 'exact_number',
	match_target: '+14155550123',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `action` | `allow \| block` | Yes | — |
| `match_type` | `exact_number` | No | — |
| `match_target` | `string` | Yes | Phone number to match, in E.164 format. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### phoneContactRules.delete

`identities.phoneContactRules.delete`

Deletes a phone contact rule from an identity. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.identities.phoneContactRules.delete({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### phoneContactRules.get

`identities.phoneContactRules.get`

Returns one phone allow or block rule of an identity by `rule_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.phoneContactRules.get({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### phoneContactRules.list

`identities.phoneContactRules.list`

Lists an identity's phone allow and block rules, newest first, filterable by `action`, `match_type` and `direction`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.phoneContactRules.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_number \| null` | No | Filter by match type (only 'exact\_number' in v1). |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | Max rules to return. |
| `offset` | `number` | No | Number of rules to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### phoneContactRules.update

`identities.phoneContactRules.update`

Changes a phone contact rule's `action` or `direction`, or edits one side with `apply_to`; the number cannot change. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.phoneContactRules.update({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | — |
| `direction` | `inbound \| outbound \| both \| null` | No | — |
| `apply_to` | `inbound \| outbound \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### releasePhoneNumber

`identities.releasePhoneNumber`

Releases an identity's phone number back to the carrier; it is removed from your account and cannot be reassigned. The identity stays active.

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

```ts theme={null}
await corsair.inkbox.api.identities.releasePhoneNumber({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### signingKey.createOrRotate

`identities.signingKey.createOrRotate`

Creates the identity's webhook signing key, or replaces the existing one so payloads are signed with the new key. The key is returned only once.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.identities.signingKey.createOrRotate({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `signing_key` | `string \| null` | No | Plaintext signing key (shown once — store it securely) |
| `created_at` | `string \| null` | No | When the key was created (or rotated) |

***

### signingKey.getStatus

`identities.signingKey.getStatus`

Reports whether an identity has a webhook signing key configured and when it was created, without returning the secret.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.signingKey.getStatus({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `configured` | `boolean \| null` | No | Whether the caller's organization has a signing key configured |
| `created_at` | `string \| null \| null` | No | When the key was created (or last rotated), if configured |

***

### slackContactRules.create

`identities.slackContactRules.create`

Creates a Slack allow or block rule for an identity matching one Slack user or a whole workspace (`match_type`, `match_target`), optionally per `direction`. Admin API key only.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.slackContactRules.create({
	agent_handle: 'support-agent',
	action: 'allow',
	match_type: 'exact_user',
	match_target: 'example.com',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `action` | `allow \| block` | Yes | — |
| `match_type` | `exact_user \| workspace` | Yes | — |
| `match_target` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### slackContactRules.delete

`identities.slackContactRules.delete`

Deletes a Slack contact rule from an identity. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.identities.slackContactRules.delete({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### slackContactRules.get

`identities.slackContactRules.get`

Returns one Slack allow or block rule of an identity by `rule_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.slackContactRules.get({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### slackContactRules.list

`identities.slackContactRules.list`

Lists an identity's Slack allow and block rules, filterable by `action`, `match_type` (exact\_user or workspace) and `direction`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.identities.slackContactRules.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_user \| workspace \| null` | No | Filter by exact\_user or workspace. |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | Max rules to return. |
| `offset` | `number` | No | Number of rules to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### slackContactRules.update

`identities.slackContactRules.update`

Changes a Slack contact rule's `action` or `direction`, or edits one side with `apply_to`. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.identities.slackContactRules.update({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | — |
| `direction` | `inbound \| outbound \| both \| null` | No | — |
| `apply_to` | `inbound \| outbound \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### update

`identities.update`

Updates an identity's display name, description, iMessage and WhatsApp reachability, attached iMessage line, and whitelist/blacklist filter modes per channel.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.identities.update({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `display_name` | `string \| null` | No | New human-readable display name for the identity. Omit to leave unchanged; send null to clear. |
| `description` | `string \| null` | No | New free-form description of what the identity is. Omit to leave unchanged; send null to clear. |
| `imessage_enabled` | `boolean \| null` | No | Whether this identity can be reached through the shared iMessage service. Omit to leave unchanged. |
| `whatsapp_enabled` | `boolean \| null` | No | Whether this identity can be reached through WhatsApp shared numbers and routers. Omit to leave unchanged. |
| `contact_sharing_enabled` | `boolean \| null` | No | Whether an attached dedicated iMessage line automatically shares this identity's name and optional avatar. Omit to leave unchanged. |
| `imessage_number_id` | `string \| null` | No | Dedicated iMessage number to attach. Send a number UUID to attach or atomically swap from the current dedicated number, null to move to the shared service, or omit to leave unchanged. Available to admin-scoped API keys and JWT callers. |
| `claim_imessage_number` | `true \| null` | No | Claim and attach a dedicated iMessage line. Omit to avoid provisioning. Requires an Idempotency-Key header when supplied. |
| `imessage_filter_mode` | `whitelist \| blacklist \| null` | No | Alias of phone\_filter\_mode for the shared SMS, calls, and iMessage list. Manage with admin credentials or through the Console; omit to leave unchanged. |
| `mail_filter_mode` | `whitelist \| blacklist \| null` | No | Whitelist/blacklist mode for this identity's mail contact rules. Manage with admin credentials or through the Console; omit to leave unchanged. |
| `phone_filter_mode` | `whitelist \| blacklist \| null` | No | Whitelist/blacklist mode for this identity's SMS, calls, and iMessage list. Manage with admin credentials or through the Console; omit to leave unchanged. |
| `slack_filter_mode` | `whitelist \| blacklist \| null` | No | Shared Slack whitelist or blacklist mode; resets directional overrides. |
| `slack_inbound_filter_mode` | `whitelist \| blacklist \| null` | No | Slack inbound whitelist or blacklist mode. |
| `slack_outbound_filter_mode` | `whitelist \| blacklist \| null` | No | Slack outbound whitelist or blacklist mode. |
| `mail_inbound_filter_mode` | `whitelist \| blacklist \| null` | No | Email receiving mode. Omit to leave unchanged; null is not accepted. |
| `mail_outbound_filter_mode` | `whitelist \| blacklist \| null` | No | Email sending mode. Omit to leave unchanged; null is not accepted. |
| `phone_inbound_filter_mode` | `whitelist \| blacklist \| null` | No | Receiving mode for calls, SMS and iMessage. Omit to leave unchanged; null is not accepted. |
| `phone_outbound_filter_mode` | `whitelist \| blacklist \| null` | No | Sending mode for calls, SMS and iMessage. Omit to leave unchanged; null is not accepted. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `agent_handle` | `string \| null` | No | — |
| `display_name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `whatsapp_enabled` | `boolean \| null` | No | — |
| `whatsapp_configured` | `boolean \| null` | No | — |
| `whatsapp_number` | `string \| null \| null` | No | — |
| `imessage_enabled` | `boolean \| null` | No | — |
| `contact_sharing_enabled` | `boolean \| null` | No | — |
| `imessage_filter_mode` | `string \| null` | No | — |
| `mail_filter_mode` | `string \| null` | No | — |
| `phone_filter_mode` | `string \| null` | No | — |
| `slack_filter_mode` | `string \| null` | No | — |
| `slack_inbound_filter_mode` | `string \| null` | No | — |
| `slack_outbound_filter_mode` | `string \| null` | No | — |
| `mail_inbound_filter_mode` | `string \| null` | No | — |
| `mail_outbound_filter_mode` | `string \| null` | No | — |
| `phone_inbound_filter_mode` | `string \| null` | No | — |
| `phone_outbound_filter_mode` | `string \| null` | No | — |
| `email_address` | `string \| null \| null` | No | — |
| `has_avatar` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `signing_key_configured` | `boolean \| null` | No | — |
| `signing_key_created_at` | `string \| null \| null` | No | — |
| `hosting_mode` | `string \| null` | No | — |
| `mailbox` | `object \| null` | No | — |
| `phone_number` | `object \| null` | No | — |
| `imessage_number` | `object \| null` | No | — |
| `tunnel` | `object \| null` | No | — |

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

> [accordion] mailbox full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   email_address?: string | null,
>   status?: string | null,
>   sending_domain?: string | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   storage_used_bytes?: number | null,
>   storage_limit_bytes?: number | null | null,
>   signature_html?: string | null | null,
>   signature_text?: string | null | null,
>   signature_enabled?: boolean | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null,
>   unread_count?: number | null | null
> } | null | null
> ```

> [accordion] phone\_number full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   status?: string | null,
>   sms_status?: string | null,
>   sms_error_code?: string | null | null,
>   sms_error_detail?: string | null | null,
>   sms_ready_at?: string | null | null,
>   incoming_call_action?: string | null,
>   client_websocket_url?: string | null | null,
>   incoming_call_webhook_url?: string | null | null,
>   forwarding_target_type?: string | null | null,
>   forwarding_phone_number?: string | null | null,
>   forwarding_sip_uri?: string | null | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   country?: string | null,
>   state?: string | null | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null
> } | null | null
> ```

> [accordion] imessage\_number full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   line_role?: string | null,
>   status?: string | null | null,
>   inbound_only?: boolean | null
> } | null | null
> ```

> [accordion] tunnel full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   tunnel_name?: string | null,
>   agent_identity_id?: string | null | null,
>   tls_mode?: string | null,
>   status?: string | null,
>   public_host?: string | null,
>   zone?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

## Imessage

### assignments.list

`imessage.assignments.list`

Lists active iMessage connections (one per recipient connected to an agent through the router or connect call), newest first, optionally for one `agent_identity_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.assignments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Narrow to one agent identity. Ignored for agent-scoped keys (always their own identity). |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   remote_number?: string | null,
>   agent_identity_id?: string | null,
>   organization_id?: string | null,
>   status?: string | null,
>   released_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### assignments.release

`imessage.assignments.release`

Disconnects a recipient from an agent (`assignment_id`): their messages stop reaching the agent and sends into that conversation fail. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.imessage.assignments.release({ assignment_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `assignment_id` | `string` | Yes | — |

**Output**

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

***

### checkCapability

`imessage.checkCapability`

Checks which messaging service (`iMessage`, `SMS` or `RCS`) is currently available for an E.164 phone `number`. Read-only; sends nothing.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.checkCapability({ number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `number` | `string` | Yes | Recipient phone number in E.164 format. |

**Output:** `string`

***

### connect

`imessage.connect`

Connects a recipient (`recipient_number`) to an agent identity over a shared iMessage line, and texts them `first_message` if given. Phone contact rules must allow them.

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

```ts theme={null}
await corsair.inkbox.api.imessage.connect({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', recipient_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `agent_identity_id` | `string` | Yes | — |
| `recipient_number` | `string` | Yes | Phone number in E.164 format (e.g. '+15551234567'). |
| `first_message` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `assignment` | `object \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `assigned_number` | `string \| null \| null` | No | Assigned E.164 number for an organization-owned shared pool or personal dedicated line; otherwise null. |
| `message` | `object \| null` | No | — |
| `already_connected` | `boolean \| null` | No | — |

> [accordion] assignment full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   remote_number?: string | null,
>   agent_identity_id?: string | null,
>   organization_id?: string | null,
>   status?: string | null,
>   released_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

> [accordion] message full type
>
> ```ts theme={null}
> {
>   provider_message_handle?: string | null | null,
>   id?: string | null,
>   conversation_id?: string | null,
>   assignment_id?: string | null | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null | null,
>   is_group?: boolean | null,
>   content?: string | null | null,
>   message_type?: string | null,
>   service?: string | null,
>   send_style?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null | null,
>     size?: number | null | null,
>     url?: string | null
>   }[] | null | null,
>   was_downgraded?: boolean | null | null,
>   status?: string | null | null,
>   error_code?: string | null | null,
>   error_message?: string | null | null,
>   error_reason?: string | null | null,
>   error_detail?: string | null | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null | null,
>     service?: string | null | null,
>     error_code?: string | null | null,
>     error_message?: string | null | null,
>     error_reason?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   reactions?: {
>     id?: string | null,
>     direction?: string | null,
>     reaction?: string | null,
>     custom_emoji?: string | null | null,
>     remote_number?: string | null,
>     part_index?: number | null,
>     created_at?: string | null
>   }[] | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

***

### contactRules.create

`imessage.contactRules.create`

Creates an allow or block rule for an E.164 number (`match_target`) on an identity's shared phone list (iMessage, SMS, calls, WhatsApp), optionally per `direction`. Admin API key only.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.contactRules.create({
	agent_handle: 'support-agent',
	action: 'allow',
	match_type: 'exact_number',
	match_target: '+14155550123',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `direction` | `inbound \| outbound \| both` | No | — |
| `action` | `allow \| block` | Yes | — |
| `match_type` | `exact_number` | No | — |
| `match_target` | `string` | Yes | Phone number to match, in E.164 format. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### contactRules.delete

`imessage.contactRules.delete`

Deletes a phone-list contact rule (used for iMessage, SMS, calls and WhatsApp) from an identity. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.imessage.contactRules.delete({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### contactRules.get

`imessage.contactRules.get`

Returns one iMessage/phone-list contact rule of an identity.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.contactRules.get({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### contactRules.list

`imessage.contactRules.list`

Lists an identity's iMessage/phone-list allow and block rules, newest first, filterable by `action`, `match_type` and `direction`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.contactRules.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_number \| null` | No | Filter by match type (only 'exact\_number' in v1). |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### contactRules.listForOrg

`imessage.contactRules.listForOrg`

Lists iMessage/phone-list contact rules across every identity the key can see, optionally narrowed to one `agent_identity_id`. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.contactRules.listForOrg({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Narrow to one agent identity. Omit to list across every visible identity. |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_number \| null` | No | Filter by match type (only 'exact\_number' in v1). |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### contactRules.update

`imessage.contactRules.update`

Changes an iMessage/phone-list contact rule's `action` or `direction`, or edits one side with `apply_to`; the number cannot change. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.contactRules.update({ rule_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rule_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `action` | `allow \| block \| null` | No | — |
| `direction` | `inbound \| outbound \| both \| null` | No | — |
| `apply_to` | `inbound \| outbound \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `match_target` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   preferred_name?: string | null | null,
>   name_prefix?: string | null | null,
>   given_name?: string | null | null,
>   middle_name?: string | null | null,
>   family_name?: string | null | null,
>   name_suffix?: string | null | null,
>   company_name?: string | null | null,
>   job_title?: string | null | null,
>   birthday?: string | null | null,
>   notes?: string | null | null,
>   emails?: {
>     value?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   phones?: {
>     value_e164?: string | null,
>     label?: string | null | null,
>     is_primary?: boolean | null
>   }[] | null,
>   slack_accounts?: {
>     workspace_id?: string | null,
>     user_id?: string | null,
>     workspace_name?: string | null | null
>   }[] | null,
>   websites?: {
>     url?: string | null,
>     label?: string | null | null
>   }[] | null,
>   dates?: {
>     date?: string | null,
>     label?: string | null
>   }[] | null,
>   addresses?: {
>     street?: string | null | null,
>     city?: string | null | null,
>     region?: string | null | null,
>     postal?: string | null | null,
>     country?: string | null | null,
>     label?: string | null | null
>   }[] | null,
>   custom_fields?: {
>     label?: string | null,
>     value?: string | null
>   }[] | null,
>   creation_source?: string | null,
>   review_status?: string | null,
>   reviewed_at?: string | null | null,
>   reviewed_by?: string | null | null,
>   preferred_name_source?: string | null,
>   preferred_name_locked_at?: string | null | null,
>   created_by_identity_id?: string | null | null,
>   merged_into_contact_id?: string | null | null,
>   is_auto_created?: boolean | null,
>   is_confirmed?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     contact_id?: string | null,
>     identity_id?: string | null | null,
>     created_at?: string | null
>   }[] | null
> } | null | null
> ```

***

### conversations.get

`imessage.conversations.get`

Returns one iMessage 1:1 or group conversation by `conversation_id`, with participants and connection status. Read its messages with `imessage.messages.list`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.conversations.get({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `assignment_id` | `string \| null \| null` | No | — |
| `assignment_status` | `string \| null \| null` | No | — |
| `remote_number` | `string \| null \| null` | No | — |
| `participants` | `string[] \| null \| null` | No | — |
| `is_group` | `boolean \| null` | No | — |
| `group_creation_status` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### conversations.getThread

`imessage.conversations.getThread`

Returns the messages of one reply thread (`thread_id`) inside an iMessage conversation, paged with `cursor`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.conversations.getThread({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `thread_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `thread_root_message_id` | `string \| null \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   provider_message_handle?: string | null | null,
>   id?: string | null,
>   conversation_id?: string | null,
>   assignment_id?: string | null | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null | null,
>   is_group?: boolean | null,
>   content?: string | null | null,
>   message_type?: string | null,
>   service?: string | null,
>   send_style?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null | null,
>     size?: number | null | null,
>     url?: string | null
>   }[] | null | null,
>   was_downgraded?: boolean | null | null,
>   status?: string | null | null,
>   error_code?: string | null | null,
>   error_message?: string | null | null,
>   error_reason?: string | null | null,
>   error_detail?: string | null | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null | null,
>     service?: string | null | null,
>     error_code?: string | null | null,
>     error_message?: string | null | null,
>     error_reason?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   reactions?: {
>     id?: string | null,
>     direction?: string | null,
>     reaction?: string | null,
>     custom_emoji?: string | null | null,
>     remote_number?: string | null,
>     part_index?: number | null,
>     created_at?: string | null
>   }[] | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### conversations.list

`imessage.conversations.list`

Lists iMessage conversations by most recent message, with latest-message preview and unread count, filterable by identity, participants, contact, date range and groups.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `include_groups` | `boolean` | No | — |
| `participants` | `string[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   assignment_id?: string | null | null,
>   assignment_status?: string | null | null,
>   remote_number?: string | null | null,
>   participants?: string[] | null | null,
>   is_group?: boolean | null,
>   group_creation_status?: string | null | null,
>   latest_text?: string | null | null,
>   latest_message_at?: string | null | null,
>   latest_direction?: string | null | null,
>   latest_has_media?: boolean | null,
>   unread_count?: number | null,
>   total_count?: number | null
> }[]
> ```

***

### disconnect

`imessage.disconnect`

Disconnects the active iMessage connection between an agent identity (`agent_identity_id`) and a recipient (`recipient_number`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.disconnect({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', recipient_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `agent_identity_id` | `string` | Yes | — |
| `recipient_number` | `string` | Yes | Phone number in E.164 format (e.g. '+15551234567'). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `assignment_id` | `string \| null \| null` | No | — |
| `disconnected` | `boolean \| null` | No | — |

***

### getMediaPlayback

`imessage.getMediaPlayback`

Returns an iMessage audio attachment (`media_id`) converted to WAV for browser playback.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.getMediaPlayback({ media_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `media_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | 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. |

***

### getOnboarding

`imessage.getOnboarding`

Returns instructions a person follows to connect to an agent over iMessage through the router (the `connect @handle` message and links). Sends nothing.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.getOnboarding({});
```

**Input**

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

**Output:** *empty object*

***

### getTriageNumber

`imessage.getTriageNumber`

Returns the iMessage router number and the `connect @handle` command, with a tap-to-text link and QR code, for people to reach an agent.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.getTriageNumber({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Resolve the connect command + link/QR for this agent identity. Org-wide callers (admin keys / JWT) may pass any identity in the org; agent-scoped keys may only pass their own. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `number` | `string \| null` | No | — |
| `connect_command` | `string \| null` | No | — |
| `sms_link` | `string \| null` | No | — |
| `connect_qr_png_data_url` | `string \| null` | No | — |

***

### markRead

`imessage.markRead`

Marks a conversation's inbound iMessages as read and sends a read receipt the person sees under their latest message.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.markRead({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `conversation_id` | `string` | Yes | — |
| `recipient` | `string \| null` | No | Phone number in E.164 format (e.g. '+15551234567'). |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   conversation_id?: string | null,
>   updated_count?: number | null
> } | {
>   conversation_id?: string | null,
>   recipient?: string | null,
>   updated_count?: number | null
> }
> ```

***

### messages.get

`imessage.messages.get`

Returns one iMessage message by `message_id`, with its content, sender, direction, service and thread.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.messages.get({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider_message_handle` | `string \| null \| null` | No | — |
| `id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `assignment_id` | `string \| null \| null` | No | — |
| `reply_to_message_id` | `string \| null \| null` | No | Visible native reply target, when resolved. Null does not prove the message is not a reply. |
| `thread_id` | `string \| null \| null` | No | Thread identifier when resolved, including standalone messages; does not imply replies exist. |
| `thread_root_message_id` | `string \| null \| null` | No | Visible thread root when resolved; a standalone message is its own root. |
| `direction` | `string \| null` | No | — |
| `remote_number` | `string \| null \| null` | No | — |
| `sender_number` | `string \| null \| null` | No | — |
| `participants` | `string[] \| null \| null` | No | — |
| `is_group` | `boolean \| null` | No | — |
| `content` | `string \| null \| null` | No | — |
| `message_type` | `string \| null` | No | — |
| `service` | `string \| null` | No | — |
| `send_style` | `string \| null \| null` | No | — |
| `media` | `object[] \| null` | No | — |
| `was_downgraded` | `boolean \| null \| null` | No | — |
| `status` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `error_message` | `string \| null \| null` | No | — |
| `error_reason` | `string \| null \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `recipients` | `object[] \| null` | No | — |
| `reactions` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] media full type
>
> ```ts theme={null}
> {
>   transcription?: {
>     status?: string | null,
>     text?: string | null | null,
>     error_code?: string | null | null
>   } | null | null,
>   id?: string | null | null,
>   content_type?: string | null | null,
>   size?: number | null | null,
>   url?: string | null
> }[] | null | null
> ```

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   remote_number?: string | null,
>   delivery_status?: string | null | null,
>   service?: string | null | null,
>   error_code?: string | null | null,
>   error_message?: string | null | null,
>   error_reason?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null
> }[] | null | null
> ```

> [accordion] reactions full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   direction?: string | null,
>   reaction?: string | null,
>   custom_emoji?: string | null | null,
>   remote_number?: string | null,
>   part_index?: number | null,
>   created_at?: string | null
> }[] | null | null
> ```

***

### messages.getThread

`imessage.messages.getThread`

Returns the reply thread containing a message (root and replies), using any message in the thread.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.messages.getThread({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `thread_root_message_id` | `string \| null \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   provider_message_handle?: string | null | null,
>   id?: string | null,
>   conversation_id?: string | null,
>   assignment_id?: string | null | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null | null,
>   is_group?: boolean | null,
>   content?: string | null | null,
>   message_type?: string | null,
>   service?: string | null,
>   send_style?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null | null,
>     size?: number | null | null,
>     url?: string | null
>   }[] | null | null,
>   was_downgraded?: boolean | null | null,
>   status?: string | null | null,
>   error_code?: string | null | null,
>   error_message?: string | null | null,
>   error_reason?: string | null | null,
>   error_detail?: string | null | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null | null,
>     service?: string | null | null,
>     error_code?: string | null | null,
>     error_message?: string | null | null,
>     error_reason?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   reactions?: {
>     id?: string | null,
>     direction?: string | null,
>     reaction?: string | null,
>     custom_emoji?: string | null | null,
>     remote_number?: string | null,
>     part_index?: number | null,
>     created_at?: string | null
>   }[] | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### messages.list

`imessage.messages.list`

Lists iMessage messages, filterable by identity, `conversation_id`, `thread_id`, read and blocked state, groups and date range.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.messages.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `thread_id` | `string \| null` | No | — |
| `include_groups` | `boolean` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   provider_message_handle?: string | null | null,
>   id?: string | null,
>   conversation_id?: string | null,
>   assignment_id?: string | null | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null | null,
>   is_group?: boolean | null,
>   content?: string | null | null,
>   message_type?: string | null,
>   service?: string | null,
>   send_style?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null | null,
>     size?: number | null | null,
>     url?: string | null
>   }[] | null | null,
>   was_downgraded?: boolean | null | null,
>   status?: string | null | null,
>   error_code?: string | null | null,
>   error_message?: string | null | null,
>   error_reason?: string | null | null,
>   error_detail?: string | null | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null | null,
>     service?: string | null | null,
>     error_code?: string | null | null,
>     error_message?: string | null | null,
>     error_reason?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   reactions?: {
>     id?: string | null,
>     direction?: string | null,
>     reaction?: string | null,
>     custom_emoji?: string | null | null,
>     remote_number?: string | null,
>     part_index?: number | null,
>     created_at?: string | null
>   }[] | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### messages.send

`imessage.messages.send`

Sends an iMessage from an identity to `to` (1 to 8 E.164 numbers; 2 or more is a group) or into `conversation_id`, with `text`, media, optional reply target, send style or voice note.

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

```ts theme={null}
await corsair.inkbox.api.imessage.messages.send({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', to: '+14155550123', text: 'Your table for two is booked for 7pm.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Agent identity to send as. Required for org-wide callers when sending by `to`; ignored for agent-scoped keys. |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `prefer` | `string \| null` | No | Use idempotency-replay with Idempotency-Key to replay the original send result. |
| `to` | `string \| string[] \| null` | No | One recipient or a list of 1–8 recipients. Lists with two or more members start or select a best-known exact-membership group. Mutually exclusive with conversation\_id. |
| `conversation_id` | `string \| null` | No | Existing conversation to reply into. Mutually exclusive with to. |
| `reply_to_message_id` | `string \| null` | No | Message to reply to within conversation\_id. Omit for an ordinary message. |
| `plain_reply_fallback` | `boolean` | No | Allow an ordinary message in the same conversation when, before sending, the reply target is known to use SMS, RCS, or downgraded transport, or is a text-only inbound reaction notice that cannot anchor a native reply. Set false to require a native reply. A native reply the provider definitely rejects is resent once as an ordinary message; an uncertain one is not. Ignored without reply\_to\_message\_id. |
| `text` | `string \| null` | No | — |
| `media_urls` | `string[] \| null` | No | — |
| `staged_media` | `object[]` | No | — |
| `send_style` | `celebration \| shooting_star \| fireworks \| lasers \| love \| confetti \| balloons \| spotlight \| echo \| invisible \| gentle \| loud \| slam \| null` | No | — |
| `send_as_voice_note` | `boolean` | No | Speak text in the agent's hosted voice and send it as a native iMessage voice note instead of text. Text is required, is limited to 600 characters, and cannot be combined with media. |
| `fallback_to_text` | `boolean` | No | When a voice note can't be produced before the message is accepted, for example because the text is longer than 600 characters, send the text as an ordinary message instead. Set false to fail the request. Ignored unless send\_as\_voice\_note is true. |

> [accordion] staged\_media full type
>
> ```ts theme={null}
> {
>   handle: string,
>   content_hash: string
> }[]
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   message?: {
>     provider_message_handle?: string | null | null,
>     id?: string | null,
>     conversation_id?: string | null,
>     assignment_id?: string | null | null,
>     reply_to_message_id?: string | null | null,
>     thread_id?: string | null | null,
>     thread_root_message_id?: string | null | null,
>     direction?: string | null,
>     remote_number?: string | null | null,
>     sender_number?: string | null | null,
>     participants?: string[] | null | null,
>     is_group?: boolean | null,
>     content?: string | null | null,
>     message_type?: string | null,
>     service?: string | null,
>     send_style?: string | null | null,
>     media?: {
>       transcription?: {
>         status?: string | null,
>         text?: string | null | null,
>         error_code?: string | null | null
>       } | null | null,
>       id?: string | null | null,
>       content_type?: string | null | null,
>       size?: number | null | null,
>       url?: string | null
>     }[] | null | null,
>     was_downgraded?: boolean | null | null,
>     status?: string | null | null,
>     error_code?: string | null | null,
>     error_message?: string | null | null,
>     error_reason?: string | null | null,
>     error_detail?: string | null | null,
>     is_read?: boolean | null,
>     is_blocked?: boolean | null,
>     recipients?: {
>       remote_number?: string | null,
>       delivery_status?: string | null | null,
>       service?: string | null | null,
>       error_code?: string | null | null,
>       error_message?: string | null | null,
>       error_reason?: string | null | null,
>       error_detail?: string | null | null,
>       sent_at?: string | null | null,
>       delivered_at?: string | null | null,
>       failed_at?: string | null | null
>     }[] | null | null,
>     reactions?: {
>       id?: string | null,
>       direction?: string | null,
>       reaction?: string | null,
>       custom_emoji?: string | null | null,
>       remote_number?: string | null,
>       part_index?: number | null,
>       created_at?: string | null
>     }[] | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null
> } | {
>   message_id?: string | null,
>   conversation_id?: string | null,
>   recipient?: string | null,
>   status?: string | null
> } | {
>   message_id?: string | null,
>   conversation_id?: string | null,
>   recipients?: string[] | null,
>   is_group?: boolean | null,
>   group_creation_status?: string | null,
>   status?: string | null
> }
> ```

***

### numbers.claim

`imessage.numbers.claim`

Claims one unattached dedicated iMessage line for the organization. Requires an admin API key; the plugin sends a fresh `idempotencyKey` unless you pass one.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.imessage.numbers.claim({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `number` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `line_role` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `inbound_only` | `boolean \| null` | No | Deprecated compatibility field; dedicated lines can initiate. |
| `agent_identity_id` | `string \| null \| null` | No | — |
| `agent_handle` | `string \| null \| null` | No | — |

***

### numbers.list

`imessage.numbers.list`

Lists the organization's dedicated iMessage lines, attached or not, with the identity each is attached to.

**Risk:** `read`

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

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   line_role?: string | null,
>   status?: string | null,
>   inbound_only?: boolean | null,
>   agent_identity_id?: string | null | null,
>   agent_handle?: string | null | null
> }[]
> ```

***

### reactions.remove

`imessage.reactions.remove`

Removes a tapback the agent sent (`reaction_id`) from the person's message.

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

```ts theme={null}
await corsair.inkbox.api.imessage.reactions.remove({ reaction_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `reaction_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

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

***

### reactions.send

`imessage.reactions.send`

Sends a tapback (`reaction`) on a message a person sent the agent (`message_id`). The agent cannot react to its own messages.

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

```ts theme={null}
await corsair.inkbox.api.imessage.reactions.send({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', reaction: 'love' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `message_id` | `string` | Yes | Received message ID. A media-only attachment resolves to its original multipart message and part; the response identifies that canonical target. For text with attachments, use the original message ID and an explicit part\_index. |
| `reaction` | `love \| like \| dislike \| laugh \| emphasize \| question \| eyes` | Yes | — |
| `part_index` | `number` | No | Part of the original multipart message. Use 0 for an individual attachment message ID; its part is resolved automatically. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   provider_message_handle?: string | null | null,
>   id?: string | null,
>   conversation_id?: string | null,
>   assignment_id?: string | null | null,
>   target_message_id?: string | null,
>   direction?: string | null,
>   reaction?: string | null,
>   custom_emoji?: string | null | null,
>   remote_number?: string | null,
>   part_index?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | {
>   reaction_id?: string | null,
>   message_id?: string | null,
>   reaction?: string | null,
>   target_message_id?: string | null | null,
>   part_index?: number | null | null
> }
> ```

***

### router.get

`imessage.router.get`

Returns the organization's own iMessage router line and its settings. Returns 404 when the organization has no router line.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.router.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `line` | `object \| null` | No | — |
| `config` | `object \| null` | No | — |

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

> [accordion] config full type
>
> ```ts theme={null}
> {
>   vcard_display_name?: string | null,
>   vcard_company_name?: string | null,
>   vcard_email_address?: string | null | null,
>   vcard_note?: string | null | null,
>   contact_sharing_enabled?: boolean | null,
>   welcome_message?: string | null,
>   help_message?: string | null,
>   send_first_contact_onboarding_on_connect?: boolean | null,
>   include_agent_email_in_contact_card?: boolean | null,
>   include_agent_note_in_contact_card?: boolean | null,
>   connect_reply_template?: string | null,
>   reconnect_reply_template?: string | null,
>   has_custom_avatar?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

### router.getAvatar

`imessage.router.getAvatar`

Downloads the avatar image of the organization's iMessage router.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.router.getAvatar({});
```

**Input:** *empty object*

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

***

### router.getConversation

`imessage.router.getConversation`

Returns one conversation on the organization's iMessage router line.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.router.getConversation({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `local_number` | `string \| null` | No | — |
| `remote_number` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### router.listConversations

`imessage.router.listConversations`

Lists conversations people have had with the organization's iMessage router line.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.router.listConversations({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   local_number?: string | null,
>   remote_number?: string | null,
>   latest_text?: string | null | null,
>   latest_direction?: string | null | null,
>   latest_message_at?: string | null | null,
>   total_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### router.listMessages

`imessage.router.listMessages`

Lists the messages of one conversation on the organization's iMessage router line.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.imessage.router.listMessages({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   conversation_id?: string | null,
>   direction?: string | null,
>   content?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

***

### router.update

`imessage.router.update`

Updates the organization's iMessage router settings: contact card fields, `contact_sharing_enabled`, welcome and help messages, and connect/reconnect reply templates.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.router.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `vcard_display_name` | `string \| null` | No | — |
| `vcard_company_name` | `string \| null` | No | — |
| `vcard_email_address` | `string \| null` | No | — |
| `vcard_note` | `string \| null` | No | — |
| `contact_sharing_enabled` | `boolean \| null` | No | — |
| `welcome_message` | `string \| null` | No | — |
| `help_message` | `string \| null` | No | — |
| `include_agent_email_in_contact_card` | `boolean \| null` | No | — |
| `include_agent_note_in_contact_card` | `boolean \| null` | No | — |
| `connect_reply_template` | `string \| null` | No | — |
| `reconnect_reply_template` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `line` | `object \| null` | No | — |
| `config` | `object \| null` | No | — |

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

> [accordion] config full type
>
> ```ts theme={null}
> {
>   vcard_display_name?: string | null,
>   vcard_company_name?: string | null,
>   vcard_email_address?: string | null | null,
>   vcard_note?: string | null | null,
>   contact_sharing_enabled?: boolean | null,
>   welcome_message?: string | null,
>   help_message?: string | null,
>   send_first_contact_onboarding_on_connect?: boolean | null,
>   include_agent_email_in_contact_card?: boolean | null,
>   include_agent_note_in_contact_card?: boolean | null,
>   connect_reply_template?: string | null,
>   reconnect_reply_template?: string | null,
>   has_custom_avatar?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

### router.updateConnectOnboarding

`imessage.router.updateConnectOnboarding`

Sets whether the organization's iMessage router sends first-contact onboarding when someone connects (`send_first_contact_onboarding_on_connect`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.router.updateConnectOnboarding({ send_first_contact_onboarding_on_connect: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `send_first_contact_onboarding_on_connect` | `boolean` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `line` | `object \| null` | No | — |
| `config` | `object \| null` | No | — |

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

> [accordion] config full type
>
> ```ts theme={null}
> {
>   vcard_display_name?: string | null,
>   vcard_company_name?: string | null,
>   vcard_email_address?: string | null | null,
>   vcard_note?: string | null | null,
>   contact_sharing_enabled?: boolean | null,
>   welcome_message?: string | null,
>   help_message?: string | null,
>   send_first_contact_onboarding_on_connect?: boolean | null,
>   include_agent_email_in_contact_card?: boolean | null,
>   include_agent_note_in_contact_card?: boolean | null,
>   connect_reply_template?: string | null,
>   reconnect_reply_template?: string | null,
>   has_custom_avatar?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

### sendTyping

`imessage.sendTyping`

Shows a typing indicator to the person in a 1:1 iMessage conversation (`conversation_id`). Groups are not supported.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.sendTyping({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |

**Output:** `Record<string, string>`

***

### uploadMedia

`imessage.uploadMedia`

Uploads a file (`file`, multipart) and returns a `media_url` to pass in `media_urls` when sending an iMessage.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.imessage.uploadMedia({
	file: { base64: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', filename: 'avatar.png', contentType: 'image/png' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file` | `string \| object \| custom` | Yes | A file: a public URL to it, or \{url, filename?, contentType?}, or \{base64, filename?, contentType?} for a small one. |

> [accordion] file full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `media_url` | `string \| null` | No | — |
| `content_type` | `string \| null \| null` | No | — |
| `size` | `number \| null \| null` | No | — |

***

## Inbound

### checkSignature

`inbound.checkSignature`

Tests whether a sample request (`headers`, `body`) passes signature settings (`signature`) or a saved source's settings (`source_id`). Stores nothing.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.inbound.checkSignature({
	agent_handle: 'support-agent',
	headers: {},
	body: 'Customer prefers email over phone calls.',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `signature` | `object \| null` | No | — |
| `source_id` | `string \| null` | No | Check against this source's saved settings instead. |
| `headers` | `Record<string, string>` | Yes | — |
| `body` | `string` | Yes | — |
| `body_encoding` | `utf8 \| base64` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: text | base64,
>   header: string,
>   format?: whole | prefix | list,
>   format_value?: string | null,
>   algorithm?: sha256 | sha1 | sha512,
>   encoding?: hex | base64,
>   signed_content?: string,
>   timestamp_from?: none | header | list,
>   timestamp_value?: string | null,
>   max_age_seconds?: number | null,
>   secret: string
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `verified` | `boolean \| null` | No | — |
| `reason` | `string \| null \| null` | No | Why verification failed; null when it passed. |

***

### events.get

`inbound.events.get`

Returns one inbound event received by a source, with delivery status, attempts, signature result and the request as received.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.inbound.events.get({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', event_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `event_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `source_id` | `string \| null` | No | — |
| `received_at` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `attempts` | `number \| null` | No | — |
| `last_error` | `string \| null \| null` | No | — |
| `signature_verified` | `boolean \| null` | No | — |
| `content_type` | `string \| null \| null` | No | — |
| `size_bytes` | `number \| null` | No | — |
| `request` | `object \| null` | No | — |

> [accordion] request full type
>
> ```ts theme={null}
> {
>   method?: string | null,
>   query?: Record<string, string> | null,
>   headers?: Record<string, string> | null,
>   content_type?: string | null | null,
>   body?: string | null,
>   body_encoding?: string | null
> } | null
> ```

***

### events.list

`inbound.events.list`

Lists events received by one inbound source, newest first, with delivery status.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.inbound.events.list({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `events` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] events full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   source_id?: string | null,
>   received_at?: string | null,
>   status?: string | null,
>   attempts?: number | null,
>   last_error?: string | null | null,
>   signature_verified?: boolean | null,
>   content_type?: string | null | null,
>   size_bytes?: number | null
> }[] | null
> ```

***

### events.replay

`inbound.events.replay`

Delivers an inbound event to the hosted agent again with a new delivery ID and resets its status to pending.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.inbound.events.replay({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', event_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `event_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `source_id` | `string \| null` | No | — |
| `received_at` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `attempts` | `number \| null` | No | — |
| `last_error` | `string \| null \| null` | No | — |
| `signature_verified` | `boolean \| null` | No | — |
| `content_type` | `string \| null \| null` | No | — |
| `size_bytes` | `number \| null` | No | — |

***

### events.reportResult

`inbound.events.reportResult`

Reports that the agent could not handle an inbound event delivery (`status` failed, `error`, `delivery_id`) so it can be found and replayed. Needs the identity's own key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.inbound.events.reportResult({
	source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	event_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	agent_handle: 'support-agent',
	status: 'failed',
	error: 'example',
	delivery_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `event_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `status` | `failed` | Yes | — |
| `error` | `string` | Yes | — |
| `delivery_id` | `string` | Yes | The `delivery_id` of the delivery being reported. |

**Output**

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

***

### sources.create

`inbound.sources.create`

Creates an inbound webhook source (`name`) for a hosted agent and returns the URL third parties post events to, with optional `signature` checking and `handler` (agent or script).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.inbound.sources.create({ agent_handle: 'support-agent', name: 'Support inbox' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `signature` | `object \| null` | No | — |
| `handler` | `object` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: text | base64,
>   header: string,
>   format?: whole | prefix | list,
>   format_value?: string | null,
>   algorithm?: sha256 | sha1 | sha512,
>   encoding?: hex | base64,
>   signed_content?: string,
>   timestamp_from?: none | header | list,
>   timestamp_value?: string | null,
>   max_age_seconds?: number | null,
>   secret: string
> } | null
> ```

> [accordion] handler full type
>
> ```ts theme={null}
> {
>   type?: agent,
>   instructions?: string | null
> } | {
>   type: script,
>   command: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `url` | `string \| null` | No | Give this URL to the sender. Anyone with it can post events. |
| `signature` | `object \| null` | No | — |
| `handler` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: string | null,
>   header?: string | null,
>   format?: string | null,
>   format_value?: string | null | null,
>   algorithm?: string | null,
>   encoding?: string | null,
>   signed_content?: string | null,
>   timestamp_from?: string | null,
>   timestamp_value?: string | null | null,
>   max_age_seconds?: number | null | null
> } | null | null
> ```

> [accordion] handler full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   instructions?: string | null | null
> } | {
>   type?: string | null,
>   command?: string | null
> } | null
> ```

***

### sources.delete

`inbound.sources.delete`

Deletes an inbound source and all its events; its URL stops working.

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

```ts theme={null}
await corsair.inkbox.api.inbound.sources.delete({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

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

***

### sources.get

`inbound.sources.get`

Returns one inbound source with its URL, signature settings (without the secret) and handler.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.inbound.sources.get({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `url` | `string \| null` | No | Give this URL to the sender. Anyone with it can post events. |
| `signature` | `object \| null` | No | — |
| `handler` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: string | null,
>   header?: string | null,
>   format?: string | null,
>   format_value?: string | null | null,
>   algorithm?: string | null,
>   encoding?: string | null,
>   signed_content?: string | null,
>   timestamp_from?: string | null,
>   timestamp_value?: string | null | null,
>   max_age_seconds?: number | null | null
> } | null | null
> ```

> [accordion] handler full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   instructions?: string | null | null
> } | {
>   type?: string | null,
>   command?: string | null
> } | null
> ```

***

### sources.list

`inbound.sources.list`

Lists an identity's inbound webhook sources, oldest first.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.inbound.sources.list({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | — |

**Output**

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

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   url?: string | null,
>   signature?: {
>     secret_encoding?: string | null,
>     header?: string | null,
>     format?: string | null,
>     format_value?: string | null | null,
>     algorithm?: string | null,
>     encoding?: string | null,
>     signed_content?: string | null,
>     timestamp_from?: string | null,
>     timestamp_value?: string | null | null,
>     max_age_seconds?: number | null | null
>   } | null | null,
>   handler?: {
>     type?: string | null,
>     instructions?: string | null | null
>   } | {
>     type?: string | null,
>     command?: string | null
>   } | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### sources.rotate

`inbound.sources.rotate`

Issues a new URL for an inbound source; the old URL stops working immediately, so senders must be updated.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.inbound.sources.rotate({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `url` | `string \| null` | No | Give this URL to the sender. Anyone with it can post events. |
| `signature` | `object \| null` | No | — |
| `handler` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: string | null,
>   header?: string | null,
>   format?: string | null,
>   format_value?: string | null | null,
>   algorithm?: string | null,
>   encoding?: string | null,
>   signed_content?: string | null,
>   timestamp_from?: string | null,
>   timestamp_value?: string | null | null,
>   max_age_seconds?: number | null | null
> } | null | null
> ```

> [accordion] handler full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   instructions?: string | null | null
> } | {
>   type?: string | null,
>   command?: string | null
> } | null
> ```

***

### sources.update

`inbound.sources.update`

Updates an inbound source's `name`, `signature` settings (null removes verification) or `handler`. The URL does not change.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.inbound.sources.update({ source_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_id` | `string` | Yes | — |
| `agent_handle` | `string` | Yes | — |
| `name` | `string \| null` | No | — |
| `signature` | `object \| null` | No | — |
| `handler` | `object \| null` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: text | base64,
>   header: string,
>   format?: whole | prefix | list,
>   format_value?: string | null,
>   algorithm?: sha256 | sha1 | sha512,
>   encoding?: hex | base64,
>   signed_content?: string,
>   timestamp_from?: none | header | list,
>   timestamp_value?: string | null,
>   max_age_seconds?: number | null,
>   secret: string
> } | null
> ```

> [accordion] handler full type
>
> ```ts theme={null}
> {
>   type?: agent,
>   instructions?: string | null
> } | {
>   type: script,
>   command: string
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `url` | `string \| null` | No | Give this URL to the sender. Anyone with it can post events. |
| `signature` | `object \| null` | No | — |
| `handler` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] signature full type
>
> ```ts theme={null}
> {
>   secret_encoding?: string | null,
>   header?: string | null,
>   format?: string | null,
>   format_value?: string | null | null,
>   algorithm?: string | null,
>   encoding?: string | null,
>   signed_content?: string | null,
>   timestamp_from?: string | null,
>   timestamp_value?: string | null | null,
>   max_age_seconds?: number | null | null
> } | null | null
> ```

> [accordion] handler full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   instructions?: string | null | null
> } | {
>   type?: string | null,
>   command?: string | null
> } | null
> ```

***

## Mail

### drafts.addAttachments

`mail.drafts.addAttachments`

Adds `attachments` to a draft in a mailbox at its current `generation`, returning the updated draft and a new generation.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.addAttachments({
	draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	email_address: 'support-agent@inkboxmail.com',
	generation: 1,
	attachments: [{ filename: 'invoice.pdf', content_type: 'example', content_base64: 'example' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |
| `attachments` | `object[]` | Yes | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   content_type: string,
>   content_base64: string,
>   content_id?: string | null
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null` | No | — |
| `bcc_addresses` | `string[] \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `attachment_count` | `number \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `send_state` | `string \| null` | No | — |
| `track_opens` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `forward_source_message_id` | `string \| null \| null` | No | — |
| `forward_note_text` | `string \| null \| null` | No | — |
| `forward_note_html` | `string \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
>   part_index?: number | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null,
>   content_id?: string | null | null,
>   is_inline?: boolean | null
> }[] | null
> ```

***

### drafts.create

`mail.drafts.create`

Creates an email draft in a mailbox (`email_address`) with optional `recipients`, subject, text/HTML body, attachments, or reply/forward fields. Does not send.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.create({
	email_address: 'support-agent@inkboxmail.com',
	recipients: {
		to: ['ada@example.com'],
	},
	subject: 'Quote for 20 seats',
	body_text: 'Hi Ada, here is the quote you asked for.',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `recipients` | `object` | No | — |
| `subject` | `string \| null` | No | — |
| `body_text` | `string \| null` | No | — |
| `body_html` | `string \| null` | No | — |
| `reply_to` | `string \| null` | No | — |
| `thread_id` | `string \| null` | No | — |
| `in_reply_to_message_id` | `string \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `attachments` | `object[] \| null` | No | — |
| `track_opens` | `boolean` | No | — |
| `forward_message_id` | `string \| null` | No | — |
| `forward_mode` | `inline \| wrapped` | No | — |
| `include_original_attachments` | `boolean` | No | — |
| `forward_note_text` | `string \| null` | No | — |
| `forward_note_html` | `string \| null` | No | — |

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   to?: string[] | null,
>   cc?: string[] | null,
>   bcc?: string[] | null
> }
> ```

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   content_type: string,
>   content_base64: string,
>   content_id?: string | null
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null` | No | — |
| `bcc_addresses` | `string[] \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `attachment_count` | `number \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `send_state` | `string \| null` | No | — |
| `track_opens` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `forward_source_message_id` | `string \| null \| null` | No | — |
| `forward_note_text` | `string \| null \| null` | No | — |
| `forward_note_html` | `string \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
>   part_index?: number | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null,
>   content_id?: string | null | null,
>   is_inline?: boolean | null
> }[] | null
> ```

***

### drafts.delete

`mail.drafts.delete`

Deletes a draft at the given `generation` permanently and frees its storage. A draft that is being sent cannot be deleted.

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

```ts theme={null}
await corsair.inkbox.api.mail.drafts.delete({ draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com', generation: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |

**Output**

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

***

### drafts.duplicate

`mail.drafts.duplicate`

Copies a draft revision (`generation`) into a new editable draft with a new ID and Message-ID.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.duplicate({ draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com', generation: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null` | No | — |
| `bcc_addresses` | `string[] \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `attachment_count` | `number \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `send_state` | `string \| null` | No | — |
| `track_opens` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `forward_source_message_id` | `string \| null \| null` | No | — |
| `forward_note_text` | `string \| null \| null` | No | — |
| `forward_note_html` | `string \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
>   part_index?: number | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null,
>   content_id?: string | null | null,
>   is_inline?: boolean | null
> }[] | null
> ```

***

### drafts.get

`mail.drafts.get`

Returns one draft with its recipients, bodies, attachment descriptors, `generation` and send state.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.get({ draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null` | No | — |
| `bcc_addresses` | `string[] \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `attachment_count` | `number \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `send_state` | `string \| null` | No | — |
| `track_opens` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `forward_source_message_id` | `string \| null \| null` | No | — |
| `forward_note_text` | `string \| null \| null` | No | — |
| `forward_note_html` | `string \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
>   part_index?: number | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null,
>   content_id?: string | null | null,
>   is_inline?: boolean | null
> }[] | null
> ```

***

### drafts.getAttachment

`mail.drafts.getAttachment`

Downloads one attachment of a draft by `part_index` at a given `generation`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.getAttachment({
	draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	part_index: 1,
	email_address: 'support-agent@inkboxmail.com',
	generation: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `part_index` | `number` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |

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

***

### drafts.list

`mail.drafts.list`

Lists a mailbox's drafts, most recently updated first.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.list({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   from_address?: string | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null,
>   bcc_addresses?: string[] | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   has_attachments?: boolean | null,
>   attachment_count?: number | null,
>   generation?: number | null,
>   send_state?: string | null,
>   track_opens?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### drafts.removeAttachment

`mail.drafts.removeAttachment`

Removes one attachment (`part_index`) from a draft at the given `generation`, returning the updated draft.

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

```ts theme={null}
await corsair.inkbox.api.mail.drafts.removeAttachment({
	draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	part_index: 1,
	email_address: 'support-agent@inkboxmail.com',
	generation: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `part_index` | `number` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null` | No | — |
| `bcc_addresses` | `string[] \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `attachment_count` | `number \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `send_state` | `string \| null` | No | — |
| `track_opens` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `forward_source_message_id` | `string \| null \| null` | No | — |
| `forward_note_text` | `string \| null \| null` | No | — |
| `forward_note_html` | `string \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
>   part_index?: number | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null,
>   content_id?: string | null | null,
>   is_inline?: boolean | null
> }[] | null
> ```

***

### drafts.send

`mail.drafts.send`

Sends a draft revision (`generation`) as an email to its recipients, applying the mailbox signature at send time. Delivers to outside recipients and cannot be undone.

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

```ts theme={null}
await corsair.inkbox.api.mail.drafts.send({ draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com', generation: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |

***

### drafts.update

`mail.drafts.update`

Updates fields of a draft at its current `generation` (recipients, subject, bodies, reply fields); omitted fields are kept and null clears one.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.drafts.update({ draft_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com', generation: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `generation` | `number` | Yes | — |
| `recipients` | `object \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `body_text` | `string \| null` | No | — |
| `body_html` | `string \| null` | No | — |
| `reply_to` | `string \| null` | No | — |
| `thread_id` | `string \| null` | No | — |
| `in_reply_to_message_id` | `string \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `track_opens` | `boolean` | No | — |
| `forward_note_text` | `string \| null` | No | — |
| `forward_note_html` | `string \| null` | No | — |

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   to?: string[] | null,
>   cc?: string[] | null,
>   bcc?: string[] | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null` | No | — |
| `bcc_addresses` | `string[] \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `attachment_count` | `number \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `send_state` | `string \| null` | No | — |
| `track_opens` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `forward_source_message_id` | `string \| null \| null` | No | — |
| `forward_note_text` | `string \| null \| null` | No | — |
| `forward_note_html` | `string \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
>   part_index?: number | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null,
>   content_id?: string | null | null,
>   is_inline?: boolean | null
> }[] | null
> ```

***

### imports.cancel

`mail.imports.cancel`

Cancels a pending, queued or running mail import job; messages already imported stay in the mailbox.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.imports.cancel({ job_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `job_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `source_format` | `string \| null` | No | — |
| `original_addresses` | `string[] \| null \| null` | No | — |
| `mark_as_read` | `boolean \| null` | No | — |
| `upload_size_bytes` | `number \| null \| null` | No | — |
| `messages_processed` | `number \| null` | No | — |
| `messages_imported` | `number \| null` | No | — |
| `messages_skipped_duplicate` | `number \| null` | No | — |
| `messages_failed` | `number \| null` | No | — |
| `messages_rejected_unsafe` | `number \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `started_at` | `string \| null \| null` | No | — |
| `finished_at` | `string \| null \| null` | No | — |

***

### imports.create

`mail.imports.create`

Creates an email import job for a mailbox (MBOX, EML or ZIP via `source_format`) and returns an upload target for the file.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.imports.create({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `source_format` | `mbox \| eml \| zip \| auto` | No | — |
| `original_addresses` | `string[] \| null` | No | — |
| `mark_as_read` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `job` | `object \| null` | No | — |
| `upload` | `object \| null` | No | — |

> [accordion] job full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   status?: string | null,
>   source_format?: string | null,
>   original_addresses?: string[] | null | null,
>   mark_as_read?: boolean | null,
>   upload_size_bytes?: number | null | null,
>   messages_processed?: number | null,
>   messages_imported?: number | null,
>   messages_skipped_duplicate?: number | null,
>   messages_failed?: number | null,
>   messages_rejected_unsafe?: number | null,
>   error_detail?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   started_at?: string | null | null,
>   finished_at?: string | null | null
> } | null
> ```

> [accordion] upload full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   fields?: Record<string, string> | null,
>   expires_in_seconds?: number | null
> } | null
> ```

***

### imports.get

`mail.imports.get`

Returns a mail import job's status and counters (processed, imported, duplicates, failed).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.imports.get({ job_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `job_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `source_format` | `string \| null` | No | — |
| `original_addresses` | `string[] \| null \| null` | No | — |
| `mark_as_read` | `boolean \| null` | No | — |
| `upload_size_bytes` | `number \| null \| null` | No | — |
| `messages_processed` | `number \| null` | No | — |
| `messages_imported` | `number \| null` | No | — |
| `messages_skipped_duplicate` | `number \| null` | No | — |
| `messages_failed` | `number \| null` | No | — |
| `messages_rejected_unsafe` | `number \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `started_at` | `string \| null \| null` | No | — |
| `finished_at` | `string \| null \| null` | No | — |

***

### imports.list

`mail.imports.list`

Lists a mailbox's email import jobs, newest first.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.imports.list({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   status?: string | null,
>   source_format?: string | null,
>   original_addresses?: string[] | null | null,
>   mark_as_read?: boolean | null,
>   upload_size_bytes?: number | null | null,
>   messages_processed?: number | null,
>   messages_imported?: number | null,
>   messages_skipped_duplicate?: number | null,
>   messages_failed?: number | null,
>   messages_rejected_unsafe?: number | null,
>   error_detail?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   started_at?: string | null | null,
>   finished_at?: string | null | null
> }[] | null
> ```

***

### imports.reissueUploadUrl

`mail.imports.reissueUploadUrl`

Issues a fresh upload target for a mail import job whose previous upload URL expired before the file was uploaded.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.imports.reissueUploadUrl({ job_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `job_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `fields` | `Record<string, string> \| null` | No | — |
| `expires_in_seconds` | `number \| null` | No | — |

***

### imports.start

`mail.imports.start`

Validates the uploaded file and queues a mail import job to run.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.imports.start({ job_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `job_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `source_format` | `string \| null` | No | — |
| `original_addresses` | `string[] \| null \| null` | No | — |
| `mark_as_read` | `boolean \| null` | No | — |
| `upload_size_bytes` | `number \| null \| null` | No | — |
| `messages_processed` | `number \| null` | No | — |
| `messages_imported` | `number \| null` | No | — |
| `messages_skipped_duplicate` | `number \| null` | No | — |
| `messages_failed` | `number \| null` | No | — |
| `messages_rejected_unsafe` | `number \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `started_at` | `string \| null \| null` | No | — |
| `finished_at` | `string \| null \| null` | No | — |

***

### listOrgContactRules

`mail.listOrgContactRules`

Lists email contact rules across every identity in the organization, optionally for one `agent_identity_id`, filterable by `action`, `match_type` and `direction`. Admin API key only.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.listOrgContactRules({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Narrow to a single agent identity. Omit to list across every identity in the org. |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_email \| domain \| null` | No | Filter by exact\_email or domain. |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | Max rules to return. |
| `offset` | `number` | No | Number of rules to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### mailboxes.get

`mail.mailboxes.get`

Returns one mailbox by `email_address`: status, sending domain, filter modes, storage use and signature, optionally with its unread count.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.mailboxes.get({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `include_unread_count` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `email_address` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sending_domain` | `string \| null` | No | Bare domain the mailbox sends from, derived from email\_address. Matches the platform default (inkboxmail.com) or the customer's verified custom domain. |
| `filter_mode` | `string \| null` | No | — |
| `inbound_filter_mode` | `string \| null` | No | — |
| `outbound_filter_mode` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | ID of the agent identity that owns this mailbox, or null on tombstones / system mailboxes. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `storage_used_bytes` | `number \| null` | No | Live storage used by this inbox, in bytes. |
| `storage_limit_bytes` | `number \| null \| null` | No | Resolved plan-tiered storage cap in bytes; null when the route did not resolve it (the ORM does not carry the cap). |
| `signature_html` | `string \| null \| null` | No | — |
| `signature_text` | `string \| null \| null` | No | — |
| `signature_enabled` | `boolean \| null` | No | — |
| `filter_mode_change_notice` | `object \| null` | No | — |
| `unread_count` | `number \| null \| null` | No | — |

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

> [accordion] filter\_mode\_change\_notice full type
>
> ```ts theme={null}
> {
>   new_filter_mode?: string | null,
>   redundant_rule_action?: string | null,
>   redundant_rule_count?: number | null
> } | null | null
> ```

***

### mailboxes.getById

`mail.mailboxes.getById`

Returns one mailbox by its UUID (`mailbox_id`), optionally with its unread count.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.mailboxes.getById({ mailbox_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mailbox_id` | `string` | Yes | — |
| `include_unread_count` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `email_address` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sending_domain` | `string \| null` | No | Bare domain the mailbox sends from, derived from email\_address. Matches the platform default (inkboxmail.com) or the customer's verified custom domain. |
| `filter_mode` | `string \| null` | No | — |
| `inbound_filter_mode` | `string \| null` | No | — |
| `outbound_filter_mode` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | ID of the agent identity that owns this mailbox, or null on tombstones / system mailboxes. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `storage_used_bytes` | `number \| null` | No | Live storage used by this inbox, in bytes. |
| `storage_limit_bytes` | `number \| null \| null` | No | Resolved plan-tiered storage cap in bytes; null when the route did not resolve it (the ORM does not carry the cap). |
| `signature_html` | `string \| null \| null` | No | — |
| `signature_text` | `string \| null \| null` | No | — |
| `signature_enabled` | `boolean \| null` | No | — |
| `filter_mode_change_notice` | `object \| null` | No | — |
| `unread_count` | `number \| null \| null` | No | — |

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

> [accordion] filter\_mode\_change\_notice full type
>
> ```ts theme={null}
> {
>   new_filter_mode?: string | null,
>   redundant_rule_action?: string | null,
>   redundant_rule_count?: number | null
> } | null | null
> ```

***

### mailboxes.list

`mail.mailboxes.list`

Lists the organization's active mailboxes, newest first, optionally with unread counts.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.mailboxes.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number \| null` | No | — |
| `offset` | `number` | No | — |
| `include_unread_count` | `boolean` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   email_address?: string | null,
>   status?: string | null,
>   sending_domain?: string | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   storage_used_bytes?: number | null,
>   storage_limit_bytes?: number | null | null,
>   signature_html?: string | null | null,
>   signature_text?: string | null | null,
>   signature_enabled?: boolean | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null,
>   unread_count?: number | null | null
> }[]
> ```

***

### mailboxes.update

`mail.mailboxes.update`

Updates a mailbox's contact-rule `filter_mode` and email signature (`signature_html`, `signature_text`, `signature_enabled`). The address cannot change.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.mailboxes.update({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `filter_mode` | `whitelist \| blacklist \| null` | No | Contact-rule filter mode. 'whitelist' = only counterparties matching an active rule are allowed; 'blacklist' = all counterparties are allowed except those matching an active rule. Applies symmetrically to inbound receipt and outbound send. Modifying this field requires an admin-scoped API key. Omit to leave unchanged; explicit null is rejected. |
| `signature_html` | `string \| null` | No | HTML signature fragment. Sanitized before saving. Null clears it; omitted fields are unchanged. When supplied without signature\_text, a plain-text fallback is generated. Images require absolute HTTPS URLs. |
| `signature_text` | `string \| null` | No | Plain-text signature. Null clears it; omitted fields are unchanged unless HTML is updated. When null, sending derives text from signature\_html if present. |
| `signature_enabled` | `boolean \| null` | No | Automatically insert the saved signature when the organization has custom signatures enabled. Defaults to false. Omit to leave unchanged; null is rejected. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `email_address` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sending_domain` | `string \| null` | No | Bare domain the mailbox sends from, derived from email\_address. Matches the platform default (inkboxmail.com) or the customer's verified custom domain. |
| `filter_mode` | `string \| null` | No | — |
| `inbound_filter_mode` | `string \| null` | No | — |
| `outbound_filter_mode` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | ID of the agent identity that owns this mailbox, or null on tombstones / system mailboxes. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `storage_used_bytes` | `number \| null` | No | Live storage used by this inbox, in bytes. |
| `storage_limit_bytes` | `number \| null \| null` | No | Resolved plan-tiered storage cap in bytes; null when the route did not resolve it (the ORM does not carry the cap). |
| `signature_html` | `string \| null \| null` | No | — |
| `signature_text` | `string \| null \| null` | No | — |
| `signature_enabled` | `boolean \| null` | No | — |
| `filter_mode_change_notice` | `object \| null` | No | — |
| `unread_count` | `number \| null \| null` | No | — |

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

> [accordion] filter\_mode\_change\_notice full type
>
> ```ts theme={null}
> {
>   new_filter_mode?: string | null,
>   redundant_rule_action?: string | null,
>   redundant_rule_count?: number | null
> } | null | null
> ```

***

### messages.delete

`mail.messages.delete`

Deletes one message from a mailbox (`email_address`).

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

```ts theme={null}
await corsair.inkbox.api.mail.messages.delete({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

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

***

### messages.forward

`mail.messages.forward`

Forwards a stored message from a mailbox to `recipients` as a new thread, with optional note, extra attachments and original attachments. Sends real email.

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

```ts theme={null}
await corsair.inkbox.api.mail.messages.forward({
	message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	email_address: 'support-agent@inkboxmail.com',
	recipients: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `prefer` | `string \| null` | No | Use idempotency-replay with Idempotency-Key to replay the original send result. |
| `recipients` | `object` | Yes | — |
| `mode` | `inline \| wrapped` | No | — |
| `subject` | `string \| null` | No | — |
| `body_text` | `string \| null` | No | — |
| `body_html` | `string \| null` | No | — |
| `additional_attachments` | `object[] \| null` | No | — |
| `additional_staged_attachments` | `object[] \| null` | No | — |
| `include_original_attachments` | `boolean` | No | — |
| `reply_to` | `string \| null` | No | — |
| `track_opens` | `boolean` | No | Embed an open-tracking pixel in the forward's HTML body. The outgoing forward must have an HTML part (the caller note in wrapped mode; caller note or original HTML in inline mode); rejected with 422 otherwise. |

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   to?: string[] | null,
>   cc?: string[] | null,
>   bcc?: string[] | null
> }
> ```

> [accordion] additional\_attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   content_type: string,
>   content_base64: string,
>   content_id?: string | null
> }[] | null
> ```

> [accordion] additional\_staged\_attachments full type
>
> ```ts theme={null}
> {
>   media_handle: string,
>   filename: string,
>   content_hash: string,
>   content_type: string,
>   content_id?: string | null
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |

***

### messages.get

`mail.messages.get`

Returns one message from a mailbox (`email_address`) with its full plain-text and HTML body.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.messages.get({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `bcc_addresses` | `string[] \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null \| null` | No | — |
| `attachment_metadata` | `object[] \| null` | No | — |
| `ses_message_id` | `string \| null \| null` | No | — |
| `reply_all_recipients` | `object \| null` | No | — |

> [accordion] attachment\_metadata full type
>
> ```ts theme={null}
> {
> }[] | null | null
> ```

> [accordion] reply\_all\_recipients full type
>
> ```ts theme={null}
> {
>   to?: string[] | null,
>   cc?: string[] | null
> } | null | null
> ```

***

### messages.getAttachment

`mail.messages.getAttachment`

Returns JSON with a temporary download URL for a message attachment (`filename` as in `attachment_metadata`). Fetch the file from that URL; the plugin never follows Inkbox's redirect, so the API key stays on inkbox.ai.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.messages.getAttachment({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', filename: 'invoice.pdf', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `filename` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output:** `any`

***

### messages.list

`mail.messages.list`

Lists messages in one mailbox (`email_address`), newest first, filterable by `direction`, `folder` and date range.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.messages.list({ email_address: 'support-agent@inkboxmail.com', limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `direction` | `inbound \| outbound \| null` | No | — |
| `folder` | `inbox \| spam \| blocked \| archive \| null` | No | Filter by thread folder. Omit to list all. |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   thread_id?: string | null | null,
>   message_id?: string | null | null,
>   from_address?: string | null,
>   from_display_name?: string | null | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   direction?: string | null,
>   status?: string | null,
>   is_read?: boolean | null,
>   is_starred?: boolean | null,
>   has_attachments?: boolean | null,
>   reply_to?: string | null | null,
>   first_opened_at?: string | null | null,
>   open_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null | null,
>   sending_domain_warning?: string | null | null,
>   import_job_id?: string | null | null
> }[] | null
> ```

***

### messages.replyAll

`mail.messages.replyAll`

Replies to every participant of a stored message from a mailbox; recipients are resolved server-side and the reply stays in the thread. Sends real email.

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

```ts theme={null}
await corsair.inkbox.api.mail.messages.replyAll({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `prefer` | `string \| null` | No | Use idempotency-replay with Idempotency-Key to replay the original send result. |
| `subject` | `string \| null` | No | — |
| `body_text` | `string \| null` | No | — |
| `body_html` | `string \| null` | No | — |
| `attachments` | `object[] \| null` | No | — |
| `staged_attachments` | `object[] \| null` | No | — |
| `reply_to` | `string \| null` | No | — |
| `approved_recipients` | `object \| null` | No | — |
| `track_opens` | `boolean` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   content_type: string,
>   content_base64: string,
>   content_id?: string | null
> }[] | null
> ```

> [accordion] staged\_attachments full type
>
> ```ts theme={null}
> {
>   media_handle: string,
>   filename: string,
>   content_hash: string,
>   content_type: string,
>   content_id?: string | null
> }[] | null
> ```

> [accordion] approved\_recipients full type
>
> ```ts theme={null}
> {
>   to?: string[] | null,
>   cc?: string[] | null,
>   bcc?: string[] | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |

***

### messages.search

`mail.messages.search`

Searches messages in one mailbox (`email_address`) with full-text query `q`, ranked by relevance then recency.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.messages.search({ email_address: 'support-agent@inkboxmail.com', q: 'invoice' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `q` | `string` | Yes | Search query |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   thread_id?: string | null | null,
>   message_id?: string | null | null,
>   from_address?: string | null,
>   from_display_name?: string | null | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   direction?: string | null,
>   status?: string | null,
>   is_read?: boolean | null,
>   is_starred?: boolean | null,
>   has_attachments?: boolean | null,
>   reply_to?: string | null | null,
>   first_opened_at?: string | null | null,
>   open_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null | null,
>   sending_domain_warning?: string | null | null,
>   import_job_id?: string | null | null
> }[] | null
> ```

***

### messages.send

`mail.messages.send`

Sends an email from a mailbox (`email_address`) to `recipients` (to/cc/bcc) with `subject`, text or HTML body, optional attachments, `reply_to` and threading. Delivers real mail.

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

```ts theme={null}
await corsair.inkbox.api.mail.messages.send({
	email_address: 'support-agent@inkboxmail.com',
	recipients: {
		to: ['ada@example.com'],
	},
	subject: 'Your order has shipped',
	body_text: 'Hi Ada, your order shipped today. Tracking: 1Z999AA10123456784.',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `prefer` | `string \| null` | No | Use idempotency-replay with Idempotency-Key to replay the original send result. |
| `recipients` | `object` | Yes | — |
| `subject` | `string` | Yes | — |
| `body_text` | `string \| null` | No | — |
| `body_html` | `string \| null` | No | — |
| `thread_id` | `string \| null` | No | Attach this message to an existing conversation. Preferred over in\_reply\_to\_message\_id when replying; pass the thread\_id returned by the list/get endpoints. |
| `in_reply_to_message_id` | `string \| null` | No | Message-ID of the email being replied to |
| `attachments` | `object[] \| null` | No | — |
| `staged_attachments` | `object[] \| null` | No | — |
| `reply_to` | `string \| null` | No | Optional Reply-To address. If set, recipients' mail clients route replies here instead of the From mailbox. |
| `track_opens` | `boolean` | No | Embed an open-tracking pixel in the HTML body. Requires body\_html; a send with track\_opens and no HTML body is rejected with 422. Opens surface as first\_opened\_at/open\_count on the message. Note: tracking pixels can raise spam scores. |

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   to?: string[] | null,
>   cc?: string[] | null,
>   bcc?: string[] | null
> }
> ```

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   content_type: string,
>   content_base64: string,
>   content_id?: string | null
> }[] | null
> ```

> [accordion] staged\_attachments full type
>
> ```ts theme={null}
> {
>   media_handle: string,
>   filename: string,
>   content_hash: string,
>   content_type: string,
>   content_id?: string | null
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |

***

### messages.updateFlags

`mail.messages.updateFlags`

Marks a message in a mailbox as read/unread (`is_read`) or starred (`is_starred`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.messages.updateFlags({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |

***

### threads.delete

`mail.threads.delete`

Deletes an email thread and its messages from a mailbox (`email_address`).

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

```ts theme={null}
await corsair.inkbox.api.mail.threads.delete({ thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

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

***

### threads.get

`mail.threads.get`

Returns one email thread from a mailbox with its messages' metadata (no bodies).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.threads.get({ thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `folder` | `string \| null` | No | — |
| `message_count` | `number \| null` | No | — |
| `last_message_at` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `messages` | `object[] \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   thread_id?: string | null | null,
>   message_id?: string | null | null,
>   from_address?: string | null,
>   from_display_name?: string | null | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   direction?: string | null,
>   status?: string | null,
>   is_read?: boolean | null,
>   is_starred?: boolean | null,
>   has_attachments?: boolean | null,
>   reply_to?: string | null | null,
>   first_opened_at?: string | null | null,
>   open_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null | null,
>   sending_domain_warning?: string | null | null,
>   import_job_id?: string | null | null
> }[] | null
> ```

***

### threads.list

`mail.threads.list`

Lists email threads in one mailbox (`email_address`) by latest activity, filterable by `folder`, `participants` or `contact_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.threads.list({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |
| `folder` | `inbox \| spam \| blocked \| archive \| null` | No | Filter by folder. Omit to list all. |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `participants` | `string[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   subject?: string | null | null,
>   folder?: string | null,
>   message_count?: number | null,
>   last_message_at?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### threads.listFolders

`mail.threads.listFolders`

Lists the folder names that contain at least one thread in a mailbox.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.threads.listFolders({ email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | — |

**Output:** `string[]`

***

### threads.update

`mail.threads.update`

Moves an email thread in a mailbox to the `inbox`, `spam` or `archive` `folder`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.threads.update({ thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', email_address: 'support-agent@inkboxmail.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread_id` | `string` | Yes | — |
| `email_address` | `string` | Yes | — |
| `folder` | `inbox \| spam \| blocked \| archive \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `folder` | `string \| null` | No | — |
| `message_count` | `number \| null` | No | — |
| `last_message_at` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |

***

### visibleMessages.delete

`mail.visibleMessages.delete`

Deletes a message by UUID from whichever mailbox visible to the API key holds it.

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

```ts theme={null}
await corsair.inkbox.api.mail.visibleMessages.delete({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

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

***

### visibleMessages.get

`mail.visibleMessages.get`

Returns a message by UUID from any mailbox the API key can see, with its delivery status; `max_body_chars` limits body length.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.visibleMessages.get({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `max_body_chars` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `sender_contact_name` | `string \| null \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `body_text` | `string \| null \| null` | No | — |
| `body_html` | `string \| null \| null` | No | — |
| `body_truncated` | `boolean \| null` | No | — |
| `bcc_addresses` | `string[] \| null \| null` | No | — |
| `in_reply_to` | `string \| null \| null` | No | — |
| `references` | `string[] \| null \| null` | No | — |
| `attachments` | `object[] \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   attachment_ref?: string | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null
> }[] | null
> ```

***

### visibleMessages.getAttachment

`mail.visibleMessages.getAttachment`

Returns a temporary download URL and metadata for a message attachment (`attachment_ref`), across every mailbox the API key can see.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.visibleMessages.getAttachment({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', attachment_ref: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `attachment_ref` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachment_ref` | `string \| null` | No | — |
| `filename` | `string \| null` | No | — |
| `content_type` | `string \| null` | No | — |
| `size` | `number \| null` | No | — |
| `url` | `string \| null` | No | — |
| `expires_in` | `number \| null` | No | — |

***

### visibleMessages.list

`mail.visibleMessages.list`

Lists email messages across every mailbox the API key can see, newest first, filterable by `mailbox_id`, `direction`, `folder` and `unread_only`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.visibleMessages.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mailbox_id` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `direction` | `inbound \| outbound \| null` | No | — |
| `folder` | `inbox \| spam \| blocked \| archive \| null` | No | — |
| `unread_only` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   thread_id?: string | null | null,
>   message_id?: string | null | null,
>   from_address?: string | null,
>   from_display_name?: string | null | null,
>   sender_contact_name?: string | null | null,
>   reply_to?: string | null | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   direction?: string | null,
>   status?: string | null,
>   is_read?: boolean | null,
>   is_starred?: boolean | null,
>   has_attachments?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### visibleMessages.search

`mail.visibleMessages.search`

Searches messages across every mailbox the API key can see with full-text query `q`, optionally narrowed to one `mailbox_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.visibleMessages.search({ q: 'invoice', limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `q` | `string` | Yes | Search query |
| `mailbox_id` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   thread_id?: string | null | null,
>   message_id?: string | null | null,
>   from_address?: string | null,
>   from_display_name?: string | null | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   direction?: string | null,
>   status?: string | null,
>   is_read?: boolean | null,
>   is_starred?: boolean | null,
>   has_attachments?: boolean | null,
>   reply_to?: string | null | null,
>   first_opened_at?: string | null | null,
>   open_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null | null,
>   sending_domain_warning?: string | null | null,
>   import_job_id?: string | null | null
> }[] | null
> ```

***

### visibleMessages.updateFlags

`mail.visibleMessages.updateFlags`

Marks a message read/unread or starred by UUID, across every mailbox the API key can see.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.visibleMessages.updateFlags({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `message_id` | `string \| null \| null` | No | — |
| `from_address` | `string \| null` | No | — |
| `from_display_name` | `string \| null \| null` | No | — |
| `to_addresses` | `string[] \| null` | No | — |
| `cc_addresses` | `string[] \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `snippet` | `string \| null \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_starred` | `boolean \| null` | No | — |
| `has_attachments` | `boolean \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `first_opened_at` | `string \| null \| null` | No | — |
| `open_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `sending_domain_warning` | `string \| null \| null` | No | — |
| `import_job_id` | `string \| null \| null` | No | — |

***

### visibleThreads.delete

`mail.visibleThreads.delete`

Deletes an email thread by UUID from whichever mailbox visible to the API key holds it.

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

```ts theme={null}
await corsair.inkbox.api.mail.visibleThreads.delete({ thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

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

***

### visibleThreads.get

`mail.visibleThreads.get`

Returns an email thread by UUID from any mailbox the API key can see, with its messages.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.visibleThreads.get({ thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `folder` | `string \| null` | No | — |
| `message_count` | `number \| null` | No | — |
| `last_message_at` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `messages_has_more` | `boolean \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   thread_id?: string | null | null,
>   message_id?: string | null | null,
>   from_address?: string | null,
>   from_display_name?: string | null | null,
>   sender_contact_name?: string | null | null,
>   reply_to?: string | null | null,
>   to_addresses?: string[] | null,
>   cc_addresses?: string[] | null | null,
>   subject?: string | null | null,
>   snippet?: string | null | null,
>   direction?: string | null,
>   status?: string | null,
>   is_read?: boolean | null,
>   is_starred?: boolean | null,
>   has_attachments?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### visibleThreads.list

`mail.visibleThreads.list`

Lists email threads across every mailbox the API key can see, filterable by `mailbox_id`, `folder`, `participants` or `contact_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.mail.visibleThreads.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mailbox_id` | `string \| null` | No | — |
| `folder` | `inbox \| spam \| blocked \| archive \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `participants` | `string[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   mailbox_id?: string | null,
>   subject?: string | null | null,
>   folder?: string | null,
>   message_count?: number | null,
>   last_message_at?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### visibleThreads.update

`mail.visibleThreads.update`

Moves an email thread (by UUID, in any mailbox the key can see) to another `folder`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.mail.visibleThreads.update({ thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `folder` | `inbox \| spam \| blocked \| archive \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `folder` | `string \| null` | No | — |
| `message_count` | `number \| null` | No | — |
| `last_message_at` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |

***

## Message Sends

### lookup

`messageSends.lookup`

Recovers the message ID of an earlier send (email, SMS, iMessage or WhatsApp) from its idempotency key, `sender_kind`, `sender_id` and `operation`. Read-only; sends nothing.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.messageSends.lookup({
	sender_kind: 'mailbox',
	sender_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	operation: 'mail.send',
	idempotencyKey: 'send-2026-11-23-001',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sender_kind` | `mailbox \| phone_number \| imessage_identity \| whatsapp_identity` | Yes | — |
| `sender_id` | `string` | Yes | — |
| `operation` | `mail.send \| mail.reply \| mail.reply_all \| mail.forward \| text.send \| imessage.send \| whatsapp.send` | Yes | — |
| `idempotencyKey` | `string` | Yes | The Idempotency-Key the earlier request was sent with. |

**Output**

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

***

## Notes

### access.grant

`notes.access.grant`

Grants an agent identity (`identity_id`) read and edit access to a note.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.notes.access.grant({ note_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `note_id` | `string` | Yes | — |
| `identity_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `note_id` | `string \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |

***

### access.list

`notes.access.list`

Lists the agent identities that have been granted access to a note.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.notes.access.list({ note_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `note_id` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   note_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[]
> ```

***

### access.revoke

`notes.access.revoke`

Revokes an agent identity's access to a note.

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

```ts theme={null}
await corsair.inkbox.api.notes.access.revoke({ note_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `note_id` | `string` | Yes | — |
| `identity_id` | `string` | Yes | — |

**Output**

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

***

### create

`notes.create`

Creates a note with a `body` and optional `title`; the creator is recorded from the API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.notes.create({ title: 'Escalation policy', body: 'Refunds over $500 need a human approval.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `title` | `string \| null` | No | — |
| `body` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `created_by` | `string \| null` | No | — |
| `title` | `string \| null \| null` | No | — |
| `body` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `note_access` rows for this note, inlined so the console can skip a follow-up `GET /notes/{id}/access` per row. Empty when the note has zero grants (typical for human-authored notes); not a 'not loaded' sentinel — every response path populates this field. |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   note_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### delete

`notes.delete`

Deletes a note. Any caller who can see the note can delete it.

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

```ts theme={null}
await corsair.inkbox.api.notes.delete({ note_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `note_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

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

***

### get

`notes.get`

Returns one note by `note_id`, with its body and access grants.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.notes.get({ note_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `note_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `created_by` | `string \| null` | No | — |
| `title` | `string \| null \| null` | No | — |
| `body` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `note_access` rows for this note, inlined so the console can skip a follow-up `GET /notes/{id}/access` per row. Empty when the note has zero grants (typical for human-authored notes); not a 'not loaded' sentinel — every response path populates this field. |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   note_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### list

`notes.list`

Lists notes visible to the caller, with full-text search `q` over title and body, an `identity_id` filter and ordering.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.notes.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `q` | `string \| null` | No | Full-text query against title + body. |
| `identity_id` | `string \| null` | No | Filter to notes granted to this identity (joins against the note\_access table). |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `order` | `recent \| created` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   created_by?: string | null,
>   title?: string | null | null,
>   body?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   access?: {
>     id?: string | null,
>     note_id?: string | null,
>     identity_id?: string | null,
>     created_at?: string | null
>   }[] | null
> }[]
> ```

***

### update

`notes.update`

Updates a note's `title` and/or `body`. Any caller who can see the note can edit it.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.notes.update({ note_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `note_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `title` | `string \| null` | No | — |
| `body` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `created_by` | `string \| null` | No | — |
| `title` | `string \| null \| null` | No | — |
| `body` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | Raw `note_access` rows for this note, inlined so the console can skip a follow-up `GET /notes/{id}/access` per row. Empty when the note has zero grants (typical for human-authored notes); not a 'not loaded' sentinel — every response path populates this field. |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   note_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

## Organization Domains

### create

`organizationDomains.create`

Starts a DNS ownership claim for a `domain` your organization controls (separate from email sending domains) and returns the TXT record to publish. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.organizationDomains.create({ domain: 'mail.example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `dns_record` | `object \| null` | No | — |
| `verified_at` | `string \| null \| null` | No | — |
| `last_checked_at` | `string \| null \| null` | No | — |
| `last_success_at` | `string \| null \| null` | No | — |
| `valid_until` | `string \| null \| null` | No | — |
| `pending_expires_at` | `string \| null \| null` | No | — |
| `next_check_at` | `string \| null \| null` | No | — |
| `last_check_result` | `string \| null \| null` | No | — |
| `ownership_conflict` | `boolean \| null` | No | — |
| `recovery_action` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |

> [accordion] dns\_record full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   name?: string | null,
>   value?: string | null
> } | null
> ```

***

### delete

`organizationDomains.delete`

Releases an organization domain claim (`claim_id`), freeing a slot in the 10-domain limit. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.organizationDomains.delete({ claim_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `claim_id` | `string` | Yes | — |

**Output**

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

***

### get

`organizationDomains.get`

Returns one organization domain claim with its verification state, DNS record and validity dates.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.organizationDomains.get({ claim_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `claim_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `dns_record` | `object \| null` | No | — |
| `verified_at` | `string \| null \| null` | No | — |
| `last_checked_at` | `string \| null \| null` | No | — |
| `last_success_at` | `string \| null \| null` | No | — |
| `valid_until` | `string \| null \| null` | No | — |
| `pending_expires_at` | `string \| null \| null` | No | — |
| `next_check_at` | `string \| null \| null` | No | — |
| `last_check_result` | `string \| null \| null` | No | — |
| `ownership_conflict` | `boolean \| null` | No | — |
| `recovery_action` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |

> [accordion] dns\_record full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   name?: string | null,
>   value?: string | null
> } | null
> ```

***

### list

`organizationDomains.list`

Lists the organization's domain ownership claims (verified domains shown to A2A peers). Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.organizationDomains.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   domain?: string | null,
>   state?: string | null,
>   dns_record?: {
>     type?: string | null,
>     name?: string | null,
>     value?: string | null
>   } | null,
>   verified_at?: string | null | null,
>   last_checked_at?: string | null | null,
>   last_success_at?: string | null | null,
>   valid_until?: string | null | null,
>   pending_expires_at?: string | null | null,
>   next_check_at?: string | null | null,
>   last_check_result?: string | null | null,
>   ownership_conflict?: boolean | null,
>   recovery_action?: string | null | null,
>   created_at?: string | null
> }[] | null
> ```

***

### verify

`organizationDomains.verify`

Checks the DNS record for an organization domain claim now and returns the resulting state, which may still be pending.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.organizationDomains.verify({ claim_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `claim_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `dns_record` | `object \| null` | No | — |
| `verified_at` | `string \| null \| null` | No | — |
| `last_checked_at` | `string \| null \| null` | No | — |
| `last_success_at` | `string \| null \| null` | No | — |
| `valid_until` | `string \| null \| null` | No | — |
| `pending_expires_at` | `string \| null \| null` | No | — |
| `next_check_at` | `string \| null \| null` | No | — |
| `last_check_result` | `string \| null \| null` | No | — |
| `ownership_conflict` | `boolean \| null` | No | — |
| `recovery_action` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |

> [accordion] dns\_record full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   name?: string | null,
>   value?: string | null
> } | null
> ```

***

## Phone

### calls.get

`phone.calls.get`

Returns one phone call by `call_id` (dedicated number or iMessage line), with status, direction, mode, voicemail handling and post-call action items.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.calls.get({ call_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `call_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `local_phone_number` | `string \| null \| null` | No | — |
| `remote_phone_number` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `hosted_agent_authority_mode` | `string \| null` | No | — |
| `voicemail_detection` | `string \| null` | No | — |
| `on_voicemail` | `string \| null \| null` | No | — |
| `reason` | `string \| null \| null` | No | — |
| `post_call_action_items` | `object[] \| null` | No | — |
| `connections` | `object[] \| null` | No | — |
| `forwardings` | `object[] \| null` | No | — |
| `use_inkbox_tts` | `boolean \| null \| null` | No | — |
| `use_inkbox_stt` | `boolean \| null \| null` | No | — |
| `hangup_reason` | `string \| null \| null` | No | — |
| `ended_by` | `string \| null \| null` | No | — |
| `provider_hangup_cause` | `string \| null \| null` | No | — |
| `started_at` | `string \| null \| null` | No | — |
| `ended_at` | `string \| null \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] post\_call\_action\_items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   seq?: number | null,
>   action?: string | null,
>   details?: string | null | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] connections full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   trigger?: string | null,
>   status?: string | null,
>   target_type?: string | null,
>   target?: string | null,
>   requested_at?: string | null,
>   dialing_at?: string | null | null,
>   connected_at?: string | null | null,
>   ended_at?: string | null | null,
>   failure_code?: string | null | null
> }[] | null
> ```

> [accordion] forwardings full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   trigger?: string | null,
>   status?: string | null,
>   target_type?: string | null,
>   target?: string | null,
>   requested_at?: string | null,
>   dialing_at?: string | null | null,
>   forwarded_at?: string | null | null,
>   ended_at?: string | null | null,
>   failure_code?: string | null | null
> }[] | null
> ```

***

### calls.getSettings

`phone.calls.getSettings`

Returns an identity's effective call settings: incoming call action, whether a WebSocket or webhook is configured, forwarding target and Voice AI setup.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.calls.getSettings({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `incoming_call_action` | `string \| null \| null` | No | — |
| `client_websocket_configured` | `boolean \| null` | No | — |
| `incoming_webhook_configured` | `boolean \| null` | No | — |
| `forwarding_target_type` | `string \| null \| null` | No | — |
| `forwarding_target` | `string \| null \| null` | No | — |
| `hosted_agent` | `object \| null` | No | — |

> [accordion] hosted\_agent full type
>
> ```ts theme={null}
> {
>   model?: string | null | null,
>   voice?: string | null | null,
>   effective_model?: string | null,
>   effective_voice?: string | null,
>   instructions_configured?: boolean | null
> } | null
> ```

***

### calls.hangup

`phone.calls.hangup`

Ends a live phone call by `call_id` from outside the call, including Inkbox Voice AI calls.

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

```ts theme={null}
await corsair.inkbox.api.phone.calls.hangup({ call_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `call_id` | `string` | Yes | — |
| `async_command` | `boolean` | No | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   origin?: string | null,
>   local_phone_number?: string | null | null,
>   remote_phone_number?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   client_websocket_url?: string | null | null,
>   mode?: string | null,
>   hosted_agent_authority_mode?: string | null,
>   voicemail_detection?: string | null,
>   on_voicemail?: string | null | null,
>   reason?: string | null | null,
>   post_call_action_items?: {
>     id?: string | null,
>     seq?: number | null,
>     action?: string | null,
>     details?: string | null | null,
>     status?: string | null
>   }[] | null,
>   connections?: {
>     id?: string | null,
>     kind?: string | null,
>     trigger?: string | null,
>     status?: string | null,
>     target_type?: string | null,
>     target?: string | null,
>     requested_at?: string | null,
>     dialing_at?: string | null | null,
>     connected_at?: string | null | null,
>     ended_at?: string | null | null,
>     failure_code?: string | null | null
>   }[] | null,
>   forwardings?: {
>     id?: string | null,
>     trigger?: string | null,
>     status?: string | null,
>     target_type?: string | null,
>     target?: string | null,
>     requested_at?: string | null,
>     dialing_at?: string | null | null,
>     forwarded_at?: string | null | null,
>     ended_at?: string | null | null,
>     failure_code?: string | null | null
>   }[] | null,
>   use_inkbox_tts?: boolean | null | null,
>   use_inkbox_stt?: boolean | null | null,
>   hangup_reason?: string | null | null,
>   ended_by?: string | null | null,
>   provider_hangup_cause?: string | null | null,
>   started_at?: string | null | null,
>   ended_at?: string | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | {
>   call_id?: string | null,
>   state?: string | null
> }
> ```

***

### calls.list

`phone.calls.list`

Lists phone calls for an agent identity, newest first, across its dedicated number and iMessage lines, filterable by blocked state and date range.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Agent identity to list calls for. Agent-scoped keys resolve their own; required for admin/JWT. |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   origin?: string | null,
>   local_phone_number?: string | null | null,
>   remote_phone_number?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   client_websocket_url?: string | null | null,
>   mode?: string | null,
>   hosted_agent_authority_mode?: string | null,
>   voicemail_detection?: string | null,
>   on_voicemail?: string | null | null,
>   reason?: string | null | null,
>   post_call_action_items?: {
>     id?: string | null,
>     seq?: number | null,
>     action?: string | null,
>     details?: string | null | null,
>     status?: string | null
>   }[] | null,
>   connections?: {
>     id?: string | null,
>     kind?: string | null,
>     trigger?: string | null,
>     status?: string | null,
>     target_type?: string | null,
>     target?: string | null,
>     requested_at?: string | null,
>     dialing_at?: string | null | null,
>     connected_at?: string | null | null,
>     ended_at?: string | null | null,
>     failure_code?: string | null | null
>   }[] | null,
>   forwardings?: {
>     id?: string | null,
>     trigger?: string | null,
>     status?: string | null,
>     target_type?: string | null,
>     target?: string | null,
>     requested_at?: string | null,
>     dialing_at?: string | null | null,
>     forwarded_at?: string | null | null,
>     ended_at?: string | null | null,
>     failure_code?: string | null | null
>   }[] | null,
>   use_inkbox_tts?: boolean | null | null,
>   use_inkbox_stt?: boolean | null | null,
>   hangup_reason?: string | null | null,
>   ended_by?: string | null | null,
>   provider_hangup_cause?: string | null | null,
>   started_at?: string | null | null,
>   ended_at?: string | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### calls.listMcpActivity

`phone.calls.listMcpActivity`

Lists the remote MCP tool calls an Inkbox Voice AI agent made during a call. `phone.calls.listToolInvocations` also covers built-in tools.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.calls.listMcpActivity({ call_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

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

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   connection_label?: string | null,
>   tool_name?: string | null,
>   status?: string | null,
>   error_code?: string | null | null,
>   started_at?: string | null | null,
>   completed_at?: string | null | null
> }[] | null
> ```

***

### calls.listToolInvocations

`phone.calls.listToolInvocations`

Lists a call's built-in and remote MCP tool activity by the Inkbox Voice AI agent, in execution order.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.calls.listToolInvocations({ call_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

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

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   call_id?: string | null,
>   tool_name?: string | null,
>   status?: string | null,
>   result?: Record<string, string | number | boolean | null> | null | null,
>   started_at?: string | null | null,
>   completed_at?: string | null | null,
>   source?: string | null,
>   connection_id?: string | null | null,
>   config_version?: number | null | null,
>   connection_label?: string | null | null,
>   server_url?: string | null | null,
>   error_code?: string | null | null,
>   observation_coverage?: string | null | null,
>   arguments_available?: boolean | null | null,
>   result_available?: boolean | null | null,
>   observed_at?: string | null | null
> }[] | null
> ```

***

### calls.listTranscripts

`phone.calls.listTranscripts`

Lists the transcript segments of a call in order, with speaker (`party`) and timestamps.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.calls.listTranscripts({ call_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `call_id` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   call_id?: string | null,
>   seq?: number | null,
>   ts_ms?: number | null,
>   party?: string | null,
>   text?: string | null,
>   phone_number?: string | null | null,
>   created_at?: string | null
> }[]
> ```

***

### calls.place

`phone.calls.place`

Places an outbound phone call to `to_number`, bridged to your `client_websocket_url` or run by Inkbox Voice AI (`mode`). Rings a real phone and uses call minutes.

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

```ts theme={null}
await corsair.inkbox.api.phone.calls.place({ from_number: '+14155550100', to_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `async_command` | `boolean` | No | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `origination` | `dedicated_number \| shared_imessage_number \| dedicated_imessage_number` | No | — |
| `from_number` | `string \| null` | No | Source phone number, in E.164 format. Required for dedicated\_number origination. |
| `to_number` | `string` | Yes | Destination phone number to dial, in E.164 format. |
| `agent_identity_id` | `string \| null` | No | Agent identity placing the call (required for shared\_imessage\_number under admin/JWT). |
| `client_websocket_url` | `string \| null` | No | WebSocket URL (wss\://) for audio bridging. Falls back to phone number's client\_websocket\_url. |
| `mode` | `client_websocket \| hosted_agent` | No | — |
| `hosted_agent_authority_mode` | `contact_scoped \| yolo \| null` | No | Optional hosted-agent data-scope override: contact\_scoped or yolo. Omit to inherit the identity's saved default. |
| `outbound_greeting_wait_seconds` | `number \| null` | No | Seconds to wait for recipient speech before a proactive hosted outbound greeting. Omit or send null for 1.5 seconds; 0 opens immediately. Only valid with mode=hosted\_agent. Recipient speech cancels the proactive greeting; this is not a delay before every reply. |
| `on_voicemail` | `hang_up \| leave_message \| ignore \| null` | No | What to do when the call reaches voicemail. leave\_message (default with mode=hosted\_agent) has the hosted agent leave a message after the beep, then end the call; hang\_up (default otherwise) ends the call once a voicemail beep is detected; ignore turns detection off and treats whatever answers as a person. |
| `voicemail_message` | `string \| null` | No | What the hosted agent should say when leaving a voicemail. Only valid with on\_voicemail=leave\_message; when omitted, the agent composes a short message from reason. |
| `voicemail_detection` | `enabled \| disabled` | No | — |
| `reason` | `string \| null` | No | Task brief for the hosted agent, e.g. what to accomplish on the call. Required with mode=hosted\_agent; invalid otherwise. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   origin?: string | null,
>   local_phone_number?: string | null | null,
>   remote_phone_number?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   client_websocket_url?: string | null | null,
>   mode?: string | null,
>   hosted_agent_authority_mode?: string | null,
>   voicemail_detection?: string | null,
>   on_voicemail?: string | null | null,
>   reason?: string | null | null,
>   post_call_action_items?: {
>     id?: string | null,
>     seq?: number | null,
>     action?: string | null,
>     details?: string | null | null,
>     status?: string | null
>   }[] | null,
>   connections?: {
>     id?: string | null,
>     kind?: string | null,
>     trigger?: string | null,
>     status?: string | null,
>     target_type?: string | null,
>     target?: string | null,
>     requested_at?: string | null,
>     dialing_at?: string | null | null,
>     connected_at?: string | null | null,
>     ended_at?: string | null | null,
>     failure_code?: string | null | null
>   }[] | null,
>   forwardings?: {
>     id?: string | null,
>     trigger?: string | null,
>     status?: string | null,
>     target_type?: string | null,
>     target?: string | null,
>     requested_at?: string | null,
>     dialing_at?: string | null | null,
>     forwarded_at?: string | null | null,
>     ended_at?: string | null | null,
>     failure_code?: string | null | null
>   }[] | null,
>   use_inkbox_tts?: boolean | null | null,
>   use_inkbox_stt?: boolean | null | null,
>   hangup_reason?: string | null | null,
>   ended_by?: string | null | null,
>   provider_hangup_cause?: string | null | null,
>   started_at?: string | null | null,
>   ended_at?: string | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   rate_limit?: {
>     calls_used?: number | null,
>     calls_remaining?: number | null,
>     calls_limit?: number | null,
>     minutes_used?: number | null,
>     minutes_remaining?: number | null,
>     minutes_limit?: number | null
>   } | null
> } | {
>   call_id?: string | null,
>   state?: string | null
> }
> ```

***

### incomingCallAction.get

`phone.incomingCallAction.get`

Returns how an identity handles incoming calls (auto-accept to a WebSocket, reject, webhook, Voice AI or forward) and the related URLs or forwarding target.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.incomingCallAction.get({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `incoming_call_action` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null \| null` | No | — |
| `incoming_call_webhook_url` | `string \| null \| null` | No | — |
| `forwarding_target_type` | `string \| null \| null` | No | — |
| `forwarding_phone_number` | `string \| null \| null` | No | — |
| `forwarding_sip_uri` | `string \| null \| null` | No | — |

***

### incomingCallAction.set

`phone.incomingCallAction.set`

Sets how an identity handles incoming calls (`incoming_call_action`) with its `client_websocket_url`, `incoming_call_webhook_url` or forwarding target.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.phone.incomingCallAction.set({ incoming_call_action: 'auto_accept' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `incoming_call_action` | `auto_accept \| auto_reject \| webhook \| hosted_agent \| forward` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null` | No | — |
| `incoming_call_webhook_url` | `string \| null` | No | — |
| `forwarding_target_type` | `phone \| sip \| null` | No | — |
| `forwarding_phone_number` | `string \| null` | No | Phone number in E.164 format (e.g. '+15551234567'). |
| `forwarding_sip_uri` | `string \| null` | No | Complete SIP destination in sip:user\@host format. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `incoming_call_action` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null \| null` | No | — |
| `incoming_call_webhook_url` | `string \| null \| null` | No | — |
| `forwarding_target_type` | `string \| null \| null` | No | — |
| `forwarding_phone_number` | `string \| null \| null` | No | — |
| `forwarding_sip_uri` | `string \| null \| null` | No | — |

***

### listOrgContactRules

`phone.listOrgContactRules`

Lists phone contact rules across every identity in the organization, optionally for one `agent_identity_id`, filterable by `action` and `direction`. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.listOrgContactRules({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Narrow to a single agent identity. Omit to list across every identity in the org. |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_number \| null` | No | Filter by match type (only 'exact\_number' in v1). |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | Max rules to return. |
| `offset` | `number` | No | Number of rules to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### media.getPlayback

`phone.media.getPlayback`

Returns an audio attachment from a text message (`media_id`) converted for browser playback.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.media.getPlayback({ media_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `media_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | 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. |

***

### numbers.get

`phone.numbers.get`

Returns one phone number with its SMS readiness (`sms_status`) and incoming-call configuration.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.numbers.get({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `number` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sms_status` | `string \| null` | No | — |
| `sms_error_code` | `string \| null \| null` | No | — |
| `sms_error_detail` | `string \| null \| null` | No | — |
| `sms_ready_at` | `string \| null \| null` | No | — |
| `incoming_call_action` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null \| null` | No | — |
| `incoming_call_webhook_url` | `string \| null \| null` | No | — |
| `forwarding_target_type` | `string \| null \| null` | No | — |
| `forwarding_phone_number` | `string \| null \| null` | No | — |
| `forwarding_sip_uri` | `string \| null \| null` | No | — |
| `filter_mode` | `string \| null` | No | — |
| `inbound_filter_mode` | `string \| null` | No | — |
| `outbound_filter_mode` | `string \| null` | No | — |
| `country` | `string \| null` | No | ISO 3166-1 alpha-2 country code (e.g. 'US' or 'GB'). |
| `state` | `string \| null \| null` | No | 2-letter US state abbreviation for LOCAL numbers (e.g. 'NY'). Null when unknown or not applicable, including numbers without a US state. |
| `agent_identity_id` | `string \| null \| null` | No | ID of the agent identity that owns this phone number, or null if the number is standalone (not tied to any agent). |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `filter_mode_change_notice` | `object \| null` | No | — |

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

> [accordion] filter\_mode\_change\_notice full type
>
> ```ts theme={null}
> {
>   new_filter_mode?: string | null,
>   redundant_rule_action?: string | null,
>   redundant_rule_count?: number | null
> } | null | null
> ```

***

### numbers.list

`phone.numbers.list`

Lists the organization's phone numbers with SMS readiness and incoming-call settings.

**Risk:** `read`

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

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   notices?: {
>     code?: string | null,
>     level?: string | null,
>     message?: string | null
>   }[] | null | null,
>   id?: string | null,
>   number?: string | null,
>   type?: string | null,
>   status?: string | null,
>   sms_status?: string | null,
>   sms_error_code?: string | null | null,
>   sms_error_detail?: string | null | null,
>   sms_ready_at?: string | null | null,
>   incoming_call_action?: string | null,
>   client_websocket_url?: string | null | null,
>   incoming_call_webhook_url?: string | null | null,
>   forwarding_target_type?: string | null | null,
>   forwarding_phone_number?: string | null | null,
>   forwarding_sip_uri?: string | null | null,
>   filter_mode?: string | null,
>   inbound_filter_mode?: string | null,
>   outbound_filter_mode?: string | null,
>   country?: string | null,
>   state?: string | null | null,
>   agent_identity_id?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   filter_mode_change_notice?: {
>     new_filter_mode?: string | null,
>     redundant_rule_action?: string | null,
>     redundant_rule_count?: number | null
>   } | null | null
> }[]
> ```

***

### numbers.provision

`phone.numbers.provision`

Provisions a new local phone number from carrier inventory (optional US `state`) and assigns it to an identity (`agent_handle`). Returns 429 once the organization reaches its active-number cap.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.phone.numbers.provision({ agent_handle: 'support-agent' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_handle` | `string` | Yes | Agent identity handle to assign this number to (e.g. 'sales-agent' or '@sales-agent'). |
| `type` | `local \| toll_free` | No | — |
| `state` | `string \| null` | No | US state abbreviation (e.g. 'NY', 'CA'). Only used for local numbers. |
| `incoming_call_action` | `auto_accept \| auto_reject \| webhook \| hosted_agent \| forward` | No | — |
| `client_websocket_url` | `string \| null` | No | WebSocket URL (wss\://) for audio bridging. Required when incoming\_call\_action is 'auto\_accept'. |
| `incoming_call_webhook_url` | `string \| null` | No | Webhook URL for incoming call notifications. Required when incoming\_call\_action is 'webhook'. |
| `forwarding_target_type` | `phone \| sip \| null` | No | — |
| `forwarding_phone_number` | `string \| null` | No | Phone number in E.164 format (e.g. '+15551234567'). |
| `forwarding_sip_uri` | `string \| null` | No | Complete SIP destination in sip:user\@host format. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `number` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sms_status` | `string \| null` | No | — |
| `sms_error_code` | `string \| null \| null` | No | — |
| `sms_error_detail` | `string \| null \| null` | No | — |
| `sms_ready_at` | `string \| null \| null` | No | — |
| `incoming_call_action` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null \| null` | No | — |
| `incoming_call_webhook_url` | `string \| null \| null` | No | — |
| `forwarding_target_type` | `string \| null \| null` | No | — |
| `forwarding_phone_number` | `string \| null \| null` | No | — |
| `forwarding_sip_uri` | `string \| null \| null` | No | — |
| `filter_mode` | `string \| null` | No | — |
| `inbound_filter_mode` | `string \| null` | No | — |
| `outbound_filter_mode` | `string \| null` | No | — |
| `country` | `string \| null` | No | ISO 3166-1 alpha-2 country code (e.g. 'US' or 'GB'). |
| `state` | `string \| null \| null` | No | 2-letter US state abbreviation for LOCAL numbers (e.g. 'NY'). Null when unknown or not applicable, including numbers without a US state. |
| `agent_identity_id` | `string \| null \| null` | No | ID of the agent identity that owns this phone number, or null if the number is standalone (not tied to any agent). |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `filter_mode_change_notice` | `object \| null` | No | — |

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

> [accordion] filter\_mode\_change\_notice full type
>
> ```ts theme={null}
> {
>   new_filter_mode?: string | null,
>   redundant_rule_action?: string | null,
>   redundant_rule_count?: number | null
> } | null | null
> ```

***

### numbers.release

`phone.numbers.release`

Releases a phone number back to the carrier and removes it from your organization. It cannot be recovered.

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

```ts theme={null}
await corsair.inkbox.api.phone.numbers.release({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |

**Output**

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

***

### numbers.searchTranscripts

`phone.numbers.searchTranscripts`

Searches call transcript segments for one phone number with full-text query `q`, optionally by `party` (local or remote).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.numbers.searchTranscripts({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', q: 'invoice' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `q` | `string` | Yes | — |
| `party` | `string \| null` | No | Filter by party: local or remote |
| `limit` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   call_id?: string | null,
>   seq?: number | null,
>   ts_ms?: number | null,
>   party?: string | null,
>   text?: string | null,
>   phone_number?: string | null | null,
>   created_at?: string | null
> }[]
> ```

***

### numbers.update

`phone.numbers.update`

Updates a phone number's incoming-call handling (`incoming_call_action`, WebSocket, webhook or forwarding target) and contact-rule `filter_mode`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.phone.numbers.update({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `incoming_call_action` | `auto_accept \| auto_reject \| webhook \| hosted_agent \| forward \| null` | No | How to handle inbound calls: auto\_accept, auto\_reject, webhook, hosted\_agent, or forward with one phone or SIP destination. |
| `client_websocket_url` | `string \| null` | No | WebSocket URL (wss\://) for audio bridging on auto\_accept. |
| `incoming_call_webhook_url` | `string \| null` | No | Webhook URL for incoming call notifications. Set to null to unsubscribe. |
| `forwarding_target_type` | `phone \| sip \| null` | No | — |
| `forwarding_phone_number` | `string \| null` | No | Phone number in E.164 format (e.g. '+15551234567'). |
| `forwarding_sip_uri` | `string \| null` | No | Complete SIP destination in sip:user\@host format. |
| `filter_mode` | `whitelist \| blacklist \| null` | No | Contact-rule filter mode (single field; covers both voice calls and SMS). 'whitelist' = only counterparties matching an active rule are allowed; 'blacklist' = all counterparties are allowed except those matching an active rule. Applies symmetrically to inbound receipt and outbound dial/send. Modifying this field requires an admin-scoped API key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `notices` | `object[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `number` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sms_status` | `string \| null` | No | — |
| `sms_error_code` | `string \| null \| null` | No | — |
| `sms_error_detail` | `string \| null \| null` | No | — |
| `sms_ready_at` | `string \| null \| null` | No | — |
| `incoming_call_action` | `string \| null` | No | — |
| `client_websocket_url` | `string \| null \| null` | No | — |
| `incoming_call_webhook_url` | `string \| null \| null` | No | — |
| `forwarding_target_type` | `string \| null \| null` | No | — |
| `forwarding_phone_number` | `string \| null \| null` | No | — |
| `forwarding_sip_uri` | `string \| null \| null` | No | — |
| `filter_mode` | `string \| null` | No | — |
| `inbound_filter_mode` | `string \| null` | No | — |
| `outbound_filter_mode` | `string \| null` | No | — |
| `country` | `string \| null` | No | ISO 3166-1 alpha-2 country code (e.g. 'US' or 'GB'). |
| `state` | `string \| null \| null` | No | 2-letter US state abbreviation for LOCAL numbers (e.g. 'NY'). Null when unknown or not applicable, including numbers without a US state. |
| `agent_identity_id` | `string \| null \| null` | No | ID of the agent identity that owns this phone number, or null if the number is standalone (not tied to any agent). |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `filter_mode_change_notice` | `object \| null` | No | — |

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

> [accordion] filter\_mode\_change\_notice full type
>
> ```ts theme={null}
> {
>   new_filter_mode?: string | null,
>   redundant_rule_action?: string | null,
>   redundant_rule_count?: number | null
> } | null | null
> ```

***

### smsOptIns.get

`phone.smsOptIns.get`

Returns the SMS consent state (opted in or out, and source) for one recipient number in your organization.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.smsOptIns.get({ receiver_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `receiver_number` | `string` | Yes | Recipient phone number in E.164 format (e.g. +15551234567). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `receiver_number` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `opted_in_at` | `string \| null \| null` | No | — |
| `opted_out_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### smsOptIns.list

`phone.smsOptIns.list`

Lists SMS consent records for your organization, most recently updated first, optionally by `status`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.smsOptIns.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `opted_in \| opted_out \| null` | No | Filter by consent state. Omit to return both. |
| `limit` | `number` | No | Max rows to return. |
| `offset` | `number` | No | Number of rows to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   receiver_number?: string | null,
>   status?: string | null,
>   source?: string | null,
>   opted_in_at?: string | null | null,
>   opted_out_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### smsOptIns.optIn

`phone.smsOptIns.optIn`

Marks a recipient number as opted in to SMS from your organization, after you collected consent yourself. This overrides an earlier STOP.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.phone.smsOptIns.optIn({ receiver_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `receiver_number` | `string` | Yes | Recipient phone number in E.164 format (e.g. +15551234567). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `receiver_number` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `opted_in_at` | `string \| null \| null` | No | — |
| `opted_out_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### smsOptIns.optOut

`phone.smsOptIns.optOut`

Marks a recipient number as opted out, so further texts to it from your organization are refused.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.phone.smsOptIns.optOut({ receiver_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `receiver_number` | `string` | Yes | Recipient phone number in E.164 format (e.g. +15551234567). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `receiver_number` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `opted_in_at` | `string \| null \| null` | No | — |
| `opted_out_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### textConversations.get

`phone.textConversations.get`

Returns the messages of one SMS/MMS conversation on a phone number, newest first; `key` is the conversation UUID or, for 1:1, the remote number.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.textConversations.get({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', key: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `key` | `string` | Yes | Conversation UUID (canonical for 1:1 + group threads) or a remote phone number / short code / sender ID (transitional fallback — 1:1 only). |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   direction?: string | null,
>   local_phone_number?: string | null,
>   remote_phone_number?: string | null | null,
>   text?: string | null | null,
>   type?: string | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null,
>     size?: number | null,
>     url?: string | null
>   }[] | null | null,
>   is_read?: boolean | null,
>   delivery_status?: string | null | null,
>   origin?: string | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   conversation_id?: string | null | null,
>   sender_phone_number?: string | null | null,
>   recipients?: {
>     recipient_phone_number?: string | null,
>     delivery_status?: string | null | null,
>     carrier?: string | null | null,
>     line_type?: string | null | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### textConversations.list

`phone.textConversations.list`

Lists SMS/MMS conversations on a phone number by most recent message, with previews and unread counts; groups only with `include_groups`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.textConversations.list({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `include_groups` | `boolean` | No | Default `false` hides group conversations from the listing — old clients see only 1:1 threads, byte-for-byte the same as before. Pass `true` to also include group threads. |
| `is_blocked` | `boolean \| null` | No | — |
| `participants` | `string[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   remote_phone_number?: string | null | null,
>   id?: string | null | null,
>   participants?: string[] | null | null,
>   is_group?: boolean | null | null,
>   latest_text?: string | null | null,
>   latest_direction?: string | null,
>   latest_type?: string | null,
>   latest_has_media?: boolean | null,
>   latest_message_at?: string | null,
>   unread_count?: number | null,
>   total_count?: number | null
> }[]
> ```

***

### textConversations.update

`phone.textConversations.update`

Marks all messages in an SMS/MMS conversation on a phone number as read or unread (`is_read`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.phone.textConversations.update({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', key: '+14155550123', is_read: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `is_read` | `boolean` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `remote_phone_number` | `string \| null \| null` | No | — |
| `conversation_id` | `string \| null \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `updated_count` | `number \| null` | No | — |

***

### textConversations.updateById

`phone.textConversations.updateById`

Marks all messages in an SMS/MMS conversation (by `conversation_id`) as read or unread (`is_read`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.phone.textConversations.updateById({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', is_read: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `is_read` | `boolean` | Yes | — |

**Output:** *empty object*

***

### texts.delete

`phone.texts.delete`

Deletes one SMS/MMS message by `message_id`.

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

```ts theme={null}
await corsair.inkbox.api.phone.texts.delete({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output:** *empty object*

***

### texts.get

`phone.texts.get`

Returns one SMS/MMS message on a phone number, with delivery status and media.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.texts.get({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', text_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `text_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `local_phone_number` | `string \| null` | No | — |
| `remote_phone_number` | `string \| null \| null` | No | — |
| `text` | `string \| null \| null` | No | — |
| `type` | `string \| null` | No | — |
| `media` | `object[] \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `delivery_status` | `string \| null \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `delivered_at` | `string \| null \| null` | No | — |
| `failed_at` | `string \| null \| null` | No | — |
| `conversation_id` | `string \| null \| null` | No | — |
| `sender_phone_number` | `string \| null \| null` | No | — |
| `recipients` | `object[] \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] media full type
>
> ```ts theme={null}
> {
>   transcription?: {
>     status?: string | null,
>     text?: string | null | null,
>     error_code?: string | null | null
>   } | null | null,
>   id?: string | null | null,
>   content_type?: string | null,
>   size?: number | null,
>   url?: string | null
> }[] | null | null
> ```

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   recipient_phone_number?: string | null,
>   delivery_status?: string | null | null,
>   carrier?: string | null | null,
>   line_type?: string | null | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null
> }[] | null | null
> ```

***

### texts.list

`phone.texts.list`

Lists SMS/MMS messages on a phone number, newest first, filterable by read and blocked state and date range.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.texts.list({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `is_read` | `boolean \| null` | No | Filter by read state: true for read, false for unread, omit for all. |
| `is_blocked` | `boolean \| null` | No | Filter by blocked state: true for only blocked, false for only non-blocked, omit for all. Agent-scoped callers never see blocked rows regardless of this filter. |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   direction?: string | null,
>   local_phone_number?: string | null,
>   remote_phone_number?: string | null | null,
>   text?: string | null | null,
>   type?: string | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null,
>     size?: number | null,
>     url?: string | null
>   }[] | null | null,
>   is_read?: boolean | null,
>   delivery_status?: string | null | null,
>   origin?: string | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   conversation_id?: string | null | null,
>   sender_phone_number?: string | null | null,
>   recipients?: {
>     recipient_phone_number?: string | null,
>     delivery_status?: string | null | null,
>     carrier?: string | null | null,
>     line_type?: string | null | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### texts.search

`phone.texts.search`

Searches SMS/MMS message bodies on a phone number with full-text query `q`, ranked by relevance.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.phone.texts.search({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', q: 'invoice' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `q` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `is_blocked` | `boolean \| null` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   direction?: string | null,
>   local_phone_number?: string | null,
>   remote_phone_number?: string | null | null,
>   text?: string | null | null,
>   type?: string | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null,
>     size?: number | null,
>     url?: string | null
>   }[] | null | null,
>   is_read?: boolean | null,
>   delivery_status?: string | null | null,
>   origin?: string | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   conversation_id?: string | null | null,
>   sender_phone_number?: string | null | null,
>   recipients?: {
>     recipient_phone_number?: string | null,
>     delivery_status?: string | null | null,
>     carrier?: string | null | null,
>     line_type?: string | null | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### texts.send

`phone.texts.send`

Sends an SMS, or MMS with `media_urls`, from a phone number to `to` (1 to 8 numbers; 2 or more is a group) or into `conversation_id`. Texts real phones and uses SMS allowance.

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

```ts theme={null}
await corsair.inkbox.api.phone.texts.send({
	phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	to: ['+14155550123'],
	text: 'Your appointment is confirmed for 3pm tomorrow.',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `prefer` | `string \| null` | No | Use idempotency-replay with Idempotency-Key to replay the original send result. |
| `to` | `string \| string[] \| null` | No | One recipient (1:1) or a list of 1–8 recipients (1:1 with N=1, or group MMS when N≥2). Each recipient is an E.164 number. Mutually exclusive with `conversation_id`. |
| `conversation_id` | `string \| null` | No | Existing conversation to reply into. The server resolves this to the conversation's participants list and sends to all of them. Mutually exclusive with `to`. |
| `text` | `string \| null` | No | — |
| `media_urls` | `string[] \| null` | No | Publicly-fetchable media URLs to attach |
| `staged_media` | `object[]` | No | — |
| `send_as_voice_note` | `boolean` | No | Speak text in the agent's hosted voice and send it as an MP3 audio file in an MMS instead of text. Text is required, is limited to 600 characters, and cannot be combined with media. |
| `fallback_to_text` | `boolean` | No | When a voice note can't be produced before the message is accepted, for example because the text is longer than 600 characters, send the text as an ordinary message instead. Set false to fail the request. Ignored unless send\_as\_voice\_note is true. |

> [accordion] staged\_media full type
>
> ```ts theme={null}
> {
>   handle: string,
>   content_hash: string
> }[]
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   direction?: string | null,
>   local_phone_number?: string | null,
>   remote_phone_number?: string | null | null,
>   text?: string | null | null,
>   type?: string | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null | null,
>     content_type?: string | null,
>     size?: number | null,
>     url?: string | null
>   }[] | null | null,
>   is_read?: boolean | null,
>   delivery_status?: string | null | null,
>   origin?: string | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   conversation_id?: string | null | null,
>   sender_phone_number?: string | null | null,
>   recipients?: {
>     recipient_phone_number?: string | null,
>     delivery_status?: string | null | null,
>     carrier?: string | null | null,
>     line_type?: string | null | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null | null,
>   is_blocked?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | {
>   message_id?: string | null | null,
>   conversation_id?: string | null | null,
>   recipients?: string[] | null,
>   type?: string | null | null,
>   delivery_status?: string | null,
>   error?: string | null | null,
>   rule?: string | null | null,
>   message?: string | null | null
> }
> ```

***

### texts.update

`phone.texts.update`

Marks an SMS/MMS message read or unread (`is_read`), or deletes it (`status: deleted`).

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.phone.texts.update({ phone_number_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', text_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `phone_number_id` | `string` | Yes | — |
| `text_id` | `string` | Yes | — |
| `is_read` | `boolean \| null` | No | — |
| `status` | `deleted \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `local_phone_number` | `string \| null` | No | — |
| `remote_phone_number` | `string \| null \| null` | No | — |
| `text` | `string \| null \| null` | No | — |
| `type` | `string \| null` | No | — |
| `media` | `object[] \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `delivery_status` | `string \| null \| null` | No | — |
| `origin` | `string \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `delivered_at` | `string \| null \| null` | No | — |
| `failed_at` | `string \| null \| null` | No | — |
| `conversation_id` | `string \| null \| null` | No | — |
| `sender_phone_number` | `string \| null \| null` | No | — |
| `recipients` | `object[] \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] media full type
>
> ```ts theme={null}
> {
>   transcription?: {
>     status?: string | null,
>     text?: string | null | null,
>     error_code?: string | null | null
>   } | null | null,
>   id?: string | null | null,
>   content_type?: string | null,
>   size?: number | null,
>   url?: string | null
> }[] | null | null
> ```

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   recipient_phone_number?: string | null,
>   delivery_status?: string | null | null,
>   carrier?: string | null | null,
>   line_type?: string | null | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null
> }[] | null | null
> ```

***

## Slack

### actions.get

`slack.actions.get`

Returns the recorded result of a Slack message send (`action_id`): status, conversation, message timestamp or error. Does not contact Slack.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.actions.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', action_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `action_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | Immediate retry delay in seconds; null on stored outcomes. |

***

### actions.getByKey

`slack.actions.getByKey`

Looks up a Slack message send by the idempotency key it was sent with, to check whether a timed-out send went through without sending again.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.actions.getByKey({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', idempotencyKey: 'send-2026-11-23-001' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | Yes | The Idempotency-Key the earlier request was sent with. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | Immediate retry delay in seconds; null on stored outcomes. |

***

### applications.getRemoval

`slack.applications.getRemoval`

Returns the progress of a Slack app removal (`operation_id`), including whether the app was deleted from Slack.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.applications.getRemoval({ operation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `operation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `operation_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `deletion_status` | `string \| null` | No | — |
| `deletion_error_code` | `string \| null \| null` | No | — |

***

### applications.prepare

`slack.applications.prepare`

Starts creating the identity's dedicated Slack app in a saved provisioning workspace (`identity_id`, `provisioning_workspace_id`). Runs in the background; repeat calls reuse it.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.applications.prepare({ identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', provisioning_workspace_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string` | Yes | — |
| `provisioning_workspace_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `provisioning_workspace_id` | `string \| null \| null` | No | — |
| `retry_at` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |

***

### applications.remove

`slack.applications.remove`

Removes an identity's Slack app from Inkbox and tries to delete it from Slack (`expected_application_generation`, `request_id`); its connection and history become inaccessible. Admin key.

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

```ts theme={null}
await corsair.inkbox.api.slack.applications.remove({ identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', expected_application_generation: 1, request_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string` | Yes | — |
| `expected_application_generation` | `number` | Yes | — |
| `request_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `operation_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `deletion_status` | `string \| null` | No | — |
| `deletion_error_code` | `string \| null \| null` | No | — |

***

### archive.backfill

`slack.archive.backfill`

Imports accessible past Slack history for one conversation (`conversation_id`) or thread (`thread_ts`) into a connection's retained archive.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.archive.backfill({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `restart` | `boolean` | No | — |
| `conversation_id` | `string` | Yes | — |
| `thread_ts` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `imported_count` | `number \| null` | No | — |
| `oldest_ts` | `string \| null \| null` | No | — |
| `newest_ts` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `includes_all_threads` | `boolean \| null` | No | — |
| `access_revoked` | `boolean \| null` | No | Last observed membership callback, not current access authority. |

***

### archive.getCoverage

`slack.archive.getCoverage`

Shows which Slack conversations and threads a connection's archive has imported history for, and how far back.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.archive.getCoverage({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `coverage` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] coverage full type
>
> ```ts theme={null}
> {
>   conversation_id?: string | null,
>   thread_ts?: string | null | null,
>   status?: string | null,
>   imported_count?: number | null,
>   oldest_ts?: string | null | null,
>   newest_ts?: string | null | null,
>   error_code?: string | null | null,
>   updated_at?: string | null,
>   includes_all_threads?: boolean | null,
>   access_revoked?: boolean | null
> }[] | null
> ```

***

### archive.getSettings

`slack.archive.getSettings`

Returns the retention period (`retention_days`; null means no age limit) for a Slack connection's retained message archive.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.archive.getSettings({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `retention_days` | `number \| null \| null` | No | — |
| `revision` | `number \| null` | No | — |

***

### archive.listMessages

`slack.archive.listMessages`

Lists retained Slack messages from a connection's archive, newest first, by conversation, thread or timestamp range, with optional cached sender, reaction and file details.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.archive.listMessages({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string \| null` | No | — |
| `thread_ts` | `string \| null` | No | — |
| `before_ts` | `string \| null` | No | — |
| `after_ts` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `latest_per_conversation` | `boolean` | No | Return only the latest matching message per conversation; limit counts conversations. |
| `roots_only` | `boolean` | No | Page roots, broadcasts, and replies with no retained parent. |
| `include` | `string \| null` | No | Optional cached expansions: conversation,sender,reactions,files. |
| `message_id` | `string \| null` | No | Return only this retained message, such as a received event's data.message\_id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `page_boundary` | `object \| null` | No | Oldest scanned position for a nonterminal chronological page, before access filtering. Not necessarily a visible message; null for search and exhausted pages. |
| `source` | `string \| null` | No | — |
| `included` | `object \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   sender_access?: string | null | null,
>   id?: string | null,
>   connection_id?: string | null,
>   conversation_id?: string | null,
>   message_ts?: string | null,
>   thread_ts?: string | null | null,
>   user_id?: string | null | null,
>   bot_id?: string | null | null,
>   subtype?: string | null | null,
>   edited_ts?: string | null | null,
>   reply_count?: number | null | null,
>   text?: string | null,
>   files?: {
>   }[] | null,
>   mentioned?: boolean | null,
>   source?: string | null,
>   captured_at?: string | null,
>   blocks?: {
>   }[] | null | null,
>   attachments?: {
>   }[] | null | null,
>   latest_reply?: string | null | null,
>   reactions?: {
>     name?: string | null,
>     count?: number | null | null,
>     users?: string[] | null,
>     users_complete?: boolean | null,
>     reacted?: boolean | null | null
>   }[] | null | null,
>   reactions_complete?: boolean | null | null
> }[] | null
> ```

> [accordion] page\_boundary full type
>
> ```ts theme={null}
> {
>   message_ts?: string | null,
>   id?: string | null
> } | null | null
> ```

> [accordion] included full type
>
> ```ts theme={null}
> {
>   conversations?: Record<string, {
>     id?: string | null,
>     name?: string | null | null,
>     title?: string | null | null,
>     type?: string | null | null,
>     topic?: string | null | null,
>     purpose?: string | null | null,
>     counterpart_user_id?: string | null | null,
>     member_ids?: string[] | null | null,
>     members_complete?: boolean | null | null,
>     is_archived?: boolean | null | null,
>     is_private?: boolean | null | null,
>     status?: string | null,
>     fetched_at?: string | null | null
>   }> | null,
>   actors?: Record<string, {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null | null,
>     avatar_url?: string | null | null,
>     avatar_cached?: boolean | null,
>     deleted?: boolean | null | null,
>     status?: string | null,
>     fetched_at?: string | null | null
>   }> | null,
>   emoji?: Record<string, {
>     name?: string | null,
>     alias_of?: string | null | null,
>     image_url?: string | null | null,
>     image_cached?: boolean | null,
>     status?: string | null
>   }> | null,
>   files?: Record<string, {
>     id?: string | null,
>     name?: string | null | null,
>     title?: string | null | null,
>     mimetype?: string | null | null,
>     size?: number | null | null,
>     content_cached?: boolean | null,
>     preview_cached?: boolean | null,
>     preview_url?: string | null | null,
>     status?: string | null,
>     error_code?: string | null | null
>   }> | null
> } | null | null
> ```

***

### archive.purge

`slack.archive.purge`

Deletes all retained Slack messages in a connection's archive and cannot be undone; new messages keep being captured. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.slack.archive.purge({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output:** `Record<string, string>`

***

### archive.search

`slack.archive.search`

Searches retained Slack messages in one connection's archive by keyword (`q`), optionally by conversation, user or time range. Not semantic search.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.archive.search({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', q: 'invoice' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `q` | `string` | Yes | — |
| `conversation_id` | `string \| null` | No | — |
| `user_id` | `string \| null` | No | — |
| `after_ts` | `string \| null` | No | — |
| `before_ts` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `page_boundary` | `object \| null` | No | Oldest scanned position for a nonterminal chronological page, before access filtering. Not necessarily a visible message; null for search and exhausted pages. |
| `source` | `string \| null` | No | — |
| `included` | `object \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   sender_access?: string | null | null,
>   id?: string | null,
>   connection_id?: string | null,
>   conversation_id?: string | null,
>   message_ts?: string | null,
>   thread_ts?: string | null | null,
>   user_id?: string | null | null,
>   bot_id?: string | null | null,
>   subtype?: string | null | null,
>   edited_ts?: string | null | null,
>   reply_count?: number | null | null,
>   text?: string | null,
>   files?: {
>   }[] | null,
>   mentioned?: boolean | null,
>   source?: string | null,
>   captured_at?: string | null,
>   blocks?: {
>   }[] | null | null,
>   attachments?: {
>   }[] | null | null,
>   latest_reply?: string | null | null,
>   reactions?: {
>     name?: string | null,
>     count?: number | null | null,
>     users?: string[] | null,
>     users_complete?: boolean | null,
>     reacted?: boolean | null | null
>   }[] | null | null,
>   reactions_complete?: boolean | null | null
> }[] | null
> ```

> [accordion] page\_boundary full type
>
> ```ts theme={null}
> {
>   message_ts?: string | null,
>   id?: string | null
> } | null | null
> ```

> [accordion] included full type
>
> ```ts theme={null}
> {
>   conversations?: Record<string, {
>     id?: string | null,
>     name?: string | null | null,
>     title?: string | null | null,
>     type?: string | null | null,
>     topic?: string | null | null,
>     purpose?: string | null | null,
>     counterpart_user_id?: string | null | null,
>     member_ids?: string[] | null | null,
>     members_complete?: boolean | null | null,
>     is_archived?: boolean | null | null,
>     is_private?: boolean | null | null,
>     status?: string | null,
>     fetched_at?: string | null | null
>   }> | null,
>   actors?: Record<string, {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null | null,
>     avatar_url?: string | null | null,
>     avatar_cached?: boolean | null,
>     deleted?: boolean | null | null,
>     status?: string | null,
>     fetched_at?: string | null | null
>   }> | null,
>   emoji?: Record<string, {
>     name?: string | null,
>     alias_of?: string | null | null,
>     image_url?: string | null | null,
>     image_cached?: boolean | null,
>     status?: string | null
>   }> | null,
>   files?: Record<string, {
>     id?: string | null,
>     name?: string | null | null,
>     title?: string | null | null,
>     mimetype?: string | null | null,
>     size?: number | null | null,
>     content_cached?: boolean | null,
>     preview_cached?: boolean | null,
>     preview_url?: string | null | null,
>     status?: string | null,
>     error_code?: string | null | null
>   }> | null
> } | null | null
> ```

***

### archive.updateSettings

`slack.archive.updateSettings`

Sets how many days a Slack connection keeps retained messages (`retention_days`; null for no limit); shortening it schedules older messages for deletion. Admin API key only.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.slack.archive.updateSettings({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `retention_days` | `number \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `retention_days` | `number \| null \| null` | No | — |
| `revision` | `number \| null` | No | — |

***

### connections.disconnect

`slack.connections.disconnect`

Disconnects a Slack workspace connection from its identity; live Slack operations stop. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.slack.connections.disconnect({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `workspace_id` | `string \| null` | No | — |
| `workspace_name` | `string \| null` | No | — |
| `bot_user_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `generation` | `number \| null` | No | Installation version; invalidate local display caches when it changes. |

***

### connections.getCapabilities

`slack.connections.getCapabilities`

Returns a Slack connection's granted and missing scopes, the features they enable, native status and task-streaming support, and the upload size limit.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.connections.getCapabilities({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `missing_scopes` | `string[] \| null` | No | — |
| `capabilities` | `object \| null` | No | — |
| `native_processing_status` | `string \| null` | No | — |
| `native_task_streaming` | `string \| null` | No | — |
| `max_upload_bytes` | `number \| null` | No | — |

> [accordion] capabilities full type
>
> ```ts theme={null}
> Record<string, {
>   required_scopes?: string[] | null,
>   missing_scopes?: string[] | null,
>   scopes_satisfied?: boolean | null
> }> | null
> ```

***

### connections.importContacts

`slack.connections.importContacts`

Imports Slack users the connection can see (workspace directory, DMs, shared channels, or one `conversation_id`) as Inkbox contacts, one page per call. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.connections.importContacts({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `conversation_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `imported_count` | `number \| null` | No | — |
| `skipped_count` | `number \| null` | No | — |
| `contact_ids` | `string[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

***

### connections.list

`slack.connections.list`

Lists an identity's Slack workspace connections (`identity_id`) with status, scopes, and app setup and installation state.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.connections.list({ identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `connections` | `object[] \| null` | No | — |
| `application_generation` | `number \| null \| null` | No | — |
| `provisioning_workspace` | `object \| null` | No | — |
| `installation_available` | `boolean \| null` | No | — |
| `application_created` | `boolean \| null` | No | A provider app is known to exist, even when Slack is disabled. |
| `setup` | `object \| null` | No | — |

> [accordion] connections full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   identity_id?: string | null,
>   workspace_id?: string | null,
>   workspace_name?: string | null,
>   bot_user_id?: string | null,
>   status?: string | null,
>   scopes?: string[] | null,
>   created_at?: string | null,
>   generation?: number | null
> }[] | null
> ```

> [accordion] provisioning\_workspace full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   workspace_id?: string | null,
>   workspace_name?: string | null,
>   user_id?: string | null,
>   user_name?: string | null | null,
>   status?: string | null,
>   token_expires_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null | null
> ```

> [accordion] setup full type
>
> ```ts theme={null}
> {
>   status?: string | null,
>   provisioning_workspace_id?: string | null | null,
>   retry_at?: string | null | null,
>   error_code?: string | null | null
> } | null | null
> ```

***

### connections.listAvailable

`slack.connections.listAvailable`

Lists connected Slack workspaces across the organization, optionally for one `identity_id`, from saved metadata. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.connections.listAvailable({});
```

**Input**

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

**Output**

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

> [accordion] connections full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   identity_id?: string | null,
>   agent_handle?: string | null,
>   workspace_id?: string | null,
>   workspace_name?: string | null
> }[] | null
> ```

***

### conversations.get

`slack.conversations.get`

Returns one Slack channel, DM or group DM (`conversation_id`) visible to the connection.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |

**Output:** *empty object*

***

### conversations.join

`slack.conversations.join`

Makes the identity's Slack bot join a public channel (`conversation_id`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.join({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### conversations.leave

`slack.conversations.leave`

Makes the identity's Slack bot leave a channel (`conversation_id`).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.leave({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### conversations.list

`slack.conversations.list`

Lists Slack conversations the bot is a member of through a connection, including Slack Connect channels; `include_unjoined` adds channels it has not joined.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.list({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |
| `include_unjoined` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversations` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

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

***

### conversations.listMembers

`slack.conversations.listMembers`

Lists the member user IDs of a Slack conversation.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.listMembers({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `members` | `string[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

***

### conversations.open

`slack.conversations.open`

Opens or resumes a Slack DM or group DM with `user_ids` and returns the conversation. Sends no message.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.open({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	user_ids: ['U0123456789'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `user_ids` | `string[]` | Yes | — |

**Output:** *empty object*

***

### conversations.setProcessingStatus

`slack.conversations.setProcessingStatus`

Sets Slack's native agent status (`status`: active, processing, suspended or closed) on a thread (`thread_ts`). Not a message; fails where unsupported.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.conversations.setProcessingStatus({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	thread_ts: '1732377600.000100',
	status: 'active',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `thread_ts` | `string` | Yes | — |
| `status` | `active \| processing \| suspended \| closed` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### files.download

`slack.files.download`

Downloads the bytes of a Slack file (`file_id`) through a connection.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.files.download({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', file_id: 'F0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `file_id` | `string` | Yes | — |

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

***

### files.get

`slack.files.get`

Returns metadata for a Slack file (`file_id`): name, title, MIME type, size and whether it can be downloaded.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.files.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', file_id: 'F0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `file_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null \| null` | No | — |
| `title` | `string \| null \| null` | No | — |
| `mimetype` | `string \| null \| null` | No | — |
| `size` | `number \| null \| null` | No | — |
| `downloadable` | `boolean \| null` | No | — |

***

### files.getPreview

`slack.files.getPreview`

Downloads a cached preview image of a Slack file, when one has been captured.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.files.getPreview({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', file_id: 'F0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `file_id` | `string` | Yes | — |

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

***

### files.upload

`slack.files.upload`

Uploads a file (`filename`, `content_base64`) to a Slack conversation, optionally in a thread with an `initial_comment`. Posts to Slack.

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

```ts theme={null}
await corsair.inkbox.api.slack.files.upload({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	filename: 'invoice.pdf',
	content_base64: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `conversation_id` | `string` | Yes | — |
| `filename` | `string` | Yes | — |
| `content_base64` | `string` | Yes | — |
| `title` | `string \| null` | No | — |
| `initial_comment` | `string \| null` | No | — |
| `thread_ts` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### getCachedMedia

`slack.getCachedMedia`

Downloads a cached Slack display image: a user or bot avatar or a custom emoji (`kind`, `resource_id`).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.getCachedMedia({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', kind: 'user', resource_id: 'U0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `kind` | `string` | Yes | — |
| `resource_id` | `string` | Yes | — |

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

***

### installations.start

`slack.installations.start`

Returns a Slack `authorization_url` to open in a browser to install or reconnect the identity's Slack app in a workspace.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.installations.start({ identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identity_id` | `string` | Yes | — |
| `workspace_id` | `string \| null` | No | — |
| `return_url` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `authorization_url` | `string \| null` | No | — |
| `expires_at` | `string \| null` | No | — |

***

### listEmoji

`slack.listEmoji`

Lists a Slack workspace's cached custom emoji, optionally filtered by name `q`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.listEmoji({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `q` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `emoji` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |

> [accordion] emoji full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   alias_of?: string | null | null,
>   image_url?: string | null | null,
>   image_cached?: boolean | null,
>   status?: string | null
> }[] | null
> ```

***

### listOrgContactRules

`slack.listOrgContactRules`

Lists Slack contact rules across every identity in the organization, optionally for one `agent_identity_id`, filterable by `action`, `match_type` and `direction`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.listOrgContactRules({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Narrow to a single agent identity. Omit to list across every identity in the org. |
| `action` | `allow \| block \| null` | No | Filter by allow or block. |
| `match_type` | `exact_user \| workspace \| null` | No | Filter by exact\_user or workspace. |
| `direction` | `inbound \| outbound \| both \| null` | No | Filter by applicable direction; both selects only bidirectional rules. |
| `limit` | `number` | No | Max rules to return. |
| `offset` | `number` | No | Number of rules to skip. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   contact?: {
>     id?: string | null,
>     organization_id?: string | null,
>     preferred_name?: string | null | null,
>     name_prefix?: string | null | null,
>     given_name?: string | null | null,
>     middle_name?: string | null | null,
>     family_name?: string | null | null,
>     name_suffix?: string | null | null,
>     company_name?: string | null | null,
>     job_title?: string | null | null,
>     birthday?: string | null | null,
>     notes?: string | null | null,
>     emails?: {
>       value?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     phones?: {
>       value_e164?: string | null,
>       label?: string | null | null,
>       is_primary?: boolean | null
>     }[] | null,
>     slack_accounts?: {
>       workspace_id?: string | null,
>       user_id?: string | null,
>       workspace_name?: string | null | null
>     }[] | null,
>     websites?: {
>       url?: string | null,
>       label?: string | null | null
>     }[] | null,
>     dates?: {
>       date?: string | null,
>       label?: string | null
>     }[] | null,
>     addresses?: {
>       street?: string | null | null,
>       city?: string | null | null,
>       region?: string | null | null,
>       postal?: string | null | null,
>       country?: string | null | null,
>       label?: string | null | null
>     }[] | null,
>     custom_fields?: {
>       label?: string | null,
>       value?: string | null
>     }[] | null,
>     creation_source?: string | null,
>     review_status?: string | null,
>     reviewed_at?: string | null | null,
>     reviewed_by?: string | null | null,
>     preferred_name_source?: string | null,
>     preferred_name_locked_at?: string | null | null,
>     created_by_identity_id?: string | null | null,
>     merged_into_contact_id?: string | null | null,
>     is_auto_created?: boolean | null,
>     is_confirmed?: boolean | null,
>     status?: string | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     access?: {
>       id?: string | null,
>       contact_id?: string | null,
>       identity_id?: string | null | null,
>       created_at?: string | null
>     }[] | null
>   } | null | null,
>   id?: string | null,
>   agent_identity_id?: string | null,
>   action?: string | null,
>   match_type?: string | null,
>   match_target?: string | null,
>   direction?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### messages.delete

`slack.messages.delete`

Deletes a bot message (`message_ts`) from a Slack conversation; other users' messages cannot be deleted.

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

```ts theme={null}
await corsair.inkbox.api.slack.messages.delete({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### messages.get

`slack.messages.get`

Returns one Slack message (`message_ts`) from a conversation, under the same permission and retained-history rules as `slack.messages.list`; pass `thread_ts` for a reply.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.messages.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `thread_ts` | `string \| null` | No | — |

**Output:** *empty object*

***

### messages.getContext

`slack.messages.getContext`

Returns the Slack messages around one message (`message_ts`), in its conversation or thread, up to 15 per side.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.messages.getContext({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `thread_ts` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |
| `window` | `string \| null` | No | — |
| `complete` | `boolean \| null` | No | — |

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

***

### messages.getPermalink

`slack.messages.getPermalink`

Returns a Slack permalink URL for a message. The link does not grant its recipient access to the conversation.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.messages.getPermalink({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null` | No | — |
| `permalink` | `string \| null` | No | — |

***

### messages.list

`slack.messages.list`

Reads a Slack conversation's history, or a thread's replies with `thread_ts`: live from Slack with current read permission, otherwise only previously retained messages.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.messages.list({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |
| `thread_ts` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

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

***

### messages.send

`slack.messages.send`

Posts a message (`text`) as the identity's Slack bot to a conversation, optionally in a thread (`thread_ts`) or as a voice note. Pass `idempotencyKey` to make a retry safe; otherwise the plugin sends a fresh one.

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

```ts theme={null}
await corsair.inkbox.api.slack.messages.send({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', text: 'Thanks, your order ships tomorrow.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `conversation_id` | `string` | Yes | — |
| `text` | `string` | Yes | — |
| `thread_ts` | `string \| null` | No | — |
| `send_as_voice_note` | `boolean` | No | Speak text in the agent's hosted voice and send it as an MP3 audio file instead of text. Text is required, is limited to 600 characters, and cannot be combined with media. |
| `fallback_to_text` | `boolean` | No | When a voice note can't be produced before the message is accepted, for example because the text is longer than 600 characters, send the text as an ordinary message instead. Set false to fail the request. Ignored unless send\_as\_voice\_note is true. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | Immediate retry delay in seconds; null on stored outcomes. |

***

### messages.update

`slack.messages.update`

Edits the `text` of a bot message in a Slack conversation; other users' messages cannot be edited.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.messages.update({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	message_ts: '1732377600.000100',
	text: 'Thanks, your order ships tomorrow.',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `text` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### operations.get

`slack.operations.get`

Returns the result of a Slack operation (edit, delete, reaction, pin, join, file upload, task stream) by `operation_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.operations.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', operation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `operation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### operations.getByKey

`slack.operations.getByKey`

Looks up a Slack operation (edit, reaction, pin, file upload, task stream) by its idempotency key, to check a timed-out request without repeating it.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.operations.getByKey({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', idempotencyKey: 'send-2026-11-23-001' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | Yes | The Idempotency-Key the earlier request was sent with. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### pins.add

`slack.pins.add`

Pins a message (`message_ts`) in a Slack conversation.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.pins.add({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `message_ts` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### pins.list

`slack.pins.list`

Lists the pinned items in a Slack conversation.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.pins.list({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `truncated` | `boolean \| null` | No | — |

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

***

### pins.remove

`slack.pins.remove`

Unpins a message (`message_ts`) in a Slack conversation.

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

```ts theme={null}
await corsair.inkbox.api.slack.pins.remove({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### provisioningWorkspaces.list

`slack.provisioningWorkspaces.list`

Lists the Slack workspaces saved for creating identity apps, with their saved-record `id` (not the Slack workspace ID).

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.provisioningWorkspaces.list({});
```

**Input:** *empty object*

**Output**

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

> [accordion] workspaces full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   workspace_id?: string | null,
>   workspace_name?: string | null,
>   user_id?: string | null,
>   user_name?: string | null | null,
>   status?: string | null,
>   token_expires_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### provisioningWorkspaces.save

`slack.provisioningWorkspaces.save`

Saves a Slack workspace's app-configuration tokens (`access_token`, `refresh_token`) so Inkbox can create identity apps there. Tokens are never returned.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.provisioningWorkspaces.save({ access_token: 'example', refresh_token: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `access_token` | `string` | Yes | — |
| `refresh_token` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `workspace_id` | `string \| null` | No | — |
| `workspace_name` | `string \| null` | No | — |
| `user_id` | `string \| null` | No | — |
| `user_name` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `token_expires_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### reactions.add

`slack.reactions.add`

Adds an emoji reaction (`name`) from the bot to a Slack message.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.reactions.add({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	message_ts: '1732377600.000100',
	name: 'white_check_mark',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### reactions.list

`slack.reactions.list`

Lists the emoji reactions on a Slack message, with counts and reacting users.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.reactions.list({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', message_ts: '1732377600.000100' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null` | No | — |
| `reactions` | `object[] \| null` | No | — |

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

***

### reactions.remove

`slack.reactions.remove`

Removes the bot's emoji reaction (`name`) from a Slack message.

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

```ts theme={null}
await corsair.inkbox.api.slack.reactions.remove({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	message_ts: '1732377600.000100',
	name: 'white_check_mark',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `message_ts` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### search

`slack.search`

Searches retained Slack messages by keyword (`q`) across all workspace connections of one identity, optionally narrowed by connection, conversation, user or time.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.search({ q: 'invoice' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `q` | `string` | Yes | — |
| `identity_id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `user_id` | `string \| null` | No | — |
| `after_ts` | `string \| null` | No | — |
| `before_ts` | `string \| null` | No | — |
| `cursor` | `string \| null` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `page_boundary` | `object \| null` | No | Oldest scanned position for a nonterminal chronological page, before access filtering. Not necessarily a visible message; null for search and exhausted pages. |
| `source` | `string \| null` | No | — |
| `included` | `object \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   sender_access?: string | null | null,
>   id?: string | null,
>   connection_id?: string | null,
>   conversation_id?: string | null,
>   message_ts?: string | null,
>   thread_ts?: string | null | null,
>   user_id?: string | null | null,
>   bot_id?: string | null | null,
>   subtype?: string | null | null,
>   edited_ts?: string | null | null,
>   reply_count?: number | null | null,
>   text?: string | null,
>   files?: {
>   }[] | null,
>   mentioned?: boolean | null,
>   source?: string | null,
>   captured_at?: string | null,
>   blocks?: {
>   }[] | null | null,
>   attachments?: {
>   }[] | null | null,
>   latest_reply?: string | null | null,
>   reactions?: {
>     name?: string | null,
>     count?: number | null | null,
>     users?: string[] | null,
>     users_complete?: boolean | null,
>     reacted?: boolean | null | null
>   }[] | null | null,
>   reactions_complete?: boolean | null | null
> }[] | null
> ```

> [accordion] page\_boundary full type
>
> ```ts theme={null}
> {
>   message_ts?: string | null,
>   id?: string | null
> } | null | null
> ```

> [accordion] included full type
>
> ```ts theme={null}
> {
>   conversations?: Record<string, {
>     id?: string | null,
>     name?: string | null | null,
>     title?: string | null | null,
>     type?: string | null | null,
>     topic?: string | null | null,
>     purpose?: string | null | null,
>     counterpart_user_id?: string | null | null,
>     member_ids?: string[] | null | null,
>     members_complete?: boolean | null | null,
>     is_archived?: boolean | null | null,
>     is_private?: boolean | null | null,
>     status?: string | null,
>     fetched_at?: string | null | null
>   }> | null,
>   actors?: Record<string, {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null | null,
>     avatar_url?: string | null | null,
>     avatar_cached?: boolean | null,
>     deleted?: boolean | null | null,
>     status?: string | null,
>     fetched_at?: string | null | null
>   }> | null,
>   emoji?: Record<string, {
>     name?: string | null,
>     alias_of?: string | null | null,
>     image_url?: string | null | null,
>     image_cached?: boolean | null,
>     status?: string | null
>   }> | null,
>   files?: Record<string, {
>     id?: string | null,
>     name?: string | null | null,
>     title?: string | null | null,
>     mimetype?: string | null | null,
>     size?: number | null | null,
>     content_cached?: boolean | null,
>     preview_cached?: boolean | null,
>     preview_url?: string | null | null,
>     status?: string | null,
>     error_code?: string | null | null
>   }> | null
> } | null | null
> ```

***

### streams.append

`slack.streams.append`

Adds task-update `chunks` to an open Slack task stream (`stream_id`) to show progress in a thread.

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

```ts theme={null}
await corsair.inkbox.api.slack.streams.append({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	stream_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	chunks: [{
		type: 'task_update',
		id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
		title: 'example',
		status: 'in_progress',
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `stream_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `chunks` | `object[]` | Yes | — |

> [accordion] chunks full type
>
> ```ts theme={null}
> (
>   {
>     type: task_update,
>     id: string,
>     title: string,
>     status: in_progress | complete | error,
>     details?: string | null,
>     output?: string | null
>   } | {
>     type: plan_update,
>     title: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### streams.start

`slack.streams.start`

Starts a native Slack task stream in a thread (`thread_ts`) for a recipient user, with initial task-update `chunks`, to show work progress. Does not start any work.

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

```ts theme={null}
await corsair.inkbox.api.slack.streams.start({
	connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	conversation_id: 'C0123456789',
	thread_ts: '1732377600.000100',
	recipient_user_id: 'U0123456789',
	recipient_team_id: 'T0123456789',
	chunks: [{
		type: 'task_update',
		id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
		title: 'example',
		status: 'in_progress',
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `thread_ts` | `string` | Yes | — |
| `recipient_user_id` | `string` | Yes | — |
| `recipient_team_id` | `string` | Yes | — |
| `task_display_mode` | `timeline \| plan` | No | — |
| `chunks` | `object[]` | Yes | — |

> [accordion] chunks full type
>
> ```ts theme={null}
> (
>   {
>     type: task_update,
>     id: string,
>     title: string,
>     status: in_progress | complete | error,
>     details?: string | null,
>     output?: string | null
>   } | {
>     type: plan_update,
>     title: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### streams.stop

`slack.streams.stop`

Closes a Slack task stream (`stream_id`), optionally with final task-update `chunks`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.slack.streams.stop({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', conversation_id: 'C0123456789', stream_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `conversation_id` | `string` | Yes | — |
| `stream_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `chunks` | `object[]` | No | — |

> [accordion] chunks full type
>
> ```ts theme={null}
> (
>   {
>     type: task_update,
>     id: string,
>     title: string,
>     status: in_progress | complete | error,
>     details?: string | null,
>     output?: string | null
>   } | {
>     type: plan_update,
>     title: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `operation` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `message_ts` | `string \| null \| null` | No | — |
| `thread_ts` | `string \| null \| null` | No | — |
| `file_id` | `string \| null \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `retry_after` | `number \| null \| null` | No | — |
| `processing_status` | `string \| null \| null` | No | — |
| `agent_status` | `string \| null \| null` | No | — |

***

### users.get

`slack.users.get`

Returns one Slack user's profile (`user_id`) through a connection.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.users.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', user_id: 'U0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `user_id` | `string` | Yes | — |

**Output:** *empty object*

***

### users.list

`slack.users.list`

Lists users in the connected Slack workspace, paged with `cursor`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.slack.users.list({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `users` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

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

***

## Tunnels

### get

`tunnels.get`

Returns one tunnel by `tunnel_id`, with its public host, TLS mode, certificate details and whether it is connected right now.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.tunnels.get({ tunnel_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tunnel_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `tunnel_name` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | Identifier of the identity associated with this tunnel, when available. |
| `tls_mode` | `string \| null` | No | — |
| `cert_pem` | `string \| null \| null` | No | — |
| `cert_fingerprint_sha256` | `string \| null \| null` | No | — |
| `cert_expires_at` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `last_connected_at` | `string \| null \| null` | No | — |
| `last_connected_ip_addr` | `string \| null \| null` | No | Caller IP (leftmost X-Forwarded-For hop, falling back to the direct peer) recorded at the most recent /\_system/hello. |
| `last_disconnected_at` | `string \| null \| null` | No | Best-effort timestamp of the most recently observed transition from connected to disconnected. Null means no disconnect has been recorded. Use `currently_connected` for current liveness. |
| `currently_connected` | `boolean \| null` | No | Live agent-connection state at read time: true if at least one agent connection is registered in Redis. Always resolved live on every tunnels endpoint — runtime state never appears as a stale placeholder. Identity payloads embed `TunnelSummaryResponse` instead, which carries no liveness. |
| `public_host` | `string \| null` | No | Per-tunnel public hostname, e.g. `my-agent.inkboxwire.com` in production (non-production environments include the environment label in the tunnel zone, e.g. `my-agent.beta.inkboxwire.com`). Use this for constructing the public URL the third party hits. |
| `zone` | `string \| null` | No | Tunnel zone host, e.g. `inkboxwire.com` in production. Use this as the data-plane h2 endpoint — the agent connects to `https://{zone}/_system/connect`, not to `https://{public_host}/_system/connect`. |
| `metadata` | `object \| null` | No | Customer-supplied free-form metadata, set via `PATCH /tunnels/{id}` with `metadata={...}`. Returned as-is on read. Empty dict (`{}`) when unset or cleared. Capped at 4 KB serialized JSON; over-limit writes return 422. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

### list

`tunnels.list`

Lists all tunnels in the organization, each with its public host and whether it is connected right now.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.tunnels.list({});
```

**Input:** *empty object*

**Output**

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

> [accordion] tunnels full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   tunnel_name?: string | null,
>   agent_identity_id?: string | null | null,
>   tls_mode?: string | null,
>   cert_pem?: string | null | null,
>   cert_fingerprint_sha256?: string | null | null,
>   cert_expires_at?: string | null | null,
>   status?: string | null,
>   last_connected_at?: string | null | null,
>   last_connected_ip_addr?: string | null | null,
>   last_disconnected_at?: string | null | null,
>   currently_connected?: boolean | null,
>   public_host?: string | null,
>   zone?: string | null,
>   metadata?: {
>   } | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### signCsr

`tunnels.signCsr`

Signs a certificate signing request (`csr_pem`, CN = tunnel hostname) for a passthrough-TLS tunnel and returns the certificate and chain.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.tunnels.signCsr({ tunnel_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', csr_pem: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tunnel_id` | `string` | Yes | — |
| `csr_pem` | `string` | Yes | PEM-encoded CSR. CN must equal the tunnel hostname. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `cert_pem` | `string \| null` | No | — |
| `chain_pem` | `string \| null` | No | — |
| `cert_fingerprint_sha256` | `string \| null` | No | — |
| `cert_expires_at` | `string \| null` | No | — |

***

### update

`tunnels.update`

Updates a tunnel's free-form `metadata` (null or \{} clears it). The tunnel name and TLS mode cannot change.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.tunnels.update({ tunnel_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tunnel_id` | `string` | Yes | — |
| `metadata` | `object \| null` | No | Free-form metadata dict; pass `null` or `{}` to clear (both clear to `{}` since the underlying column is non-nullable). Capped at 4 KB serialized JSON. |

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `tunnel_name` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | Identifier of the identity associated with this tunnel, when available. |
| `tls_mode` | `string \| null` | No | — |
| `cert_pem` | `string \| null \| null` | No | — |
| `cert_fingerprint_sha256` | `string \| null \| null` | No | — |
| `cert_expires_at` | `string \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `last_connected_at` | `string \| null \| null` | No | — |
| `last_connected_ip_addr` | `string \| null \| null` | No | Caller IP (leftmost X-Forwarded-For hop, falling back to the direct peer) recorded at the most recent /\_system/hello. |
| `last_disconnected_at` | `string \| null \| null` | No | Best-effort timestamp of the most recently observed transition from connected to disconnected. Null means no disconnect has been recorded. Use `currently_connected` for current liveness. |
| `currently_connected` | `boolean \| null` | No | Live agent-connection state at read time: true if at least one agent connection is registered in Redis. Always resolved live on every tunnels endpoint — runtime state never appears as a stale placeholder. Identity payloads embed `TunnelSummaryResponse` instead, which carries no liveness. |
| `public_host` | `string \| null` | No | Per-tunnel public hostname, e.g. `my-agent.inkboxwire.com` in production (non-production environments include the environment label in the tunnel zone, e.g. `my-agent.beta.inkboxwire.com`). Use this for constructing the public URL the third party hits. |
| `zone` | `string \| null` | No | Tunnel zone host, e.g. `inkboxwire.com` in production. Use this as the data-plane h2 endpoint — the agent connects to `https://{zone}/_system/connect`, not to `https://{public_host}/_system/connect`. |
| `metadata` | `object \| null` | No | Customer-supplied free-form metadata, set via `PATCH /tunnels/{id}` with `metadata={...}`. Returned as-is on read. Empty dict (`{}`) when unset or cleared. Capped at 4 KB serialized JSON; over-limit writes return 422. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

## Vault

### getInfo

`vault.getInfo`

Returns metadata about the organization's vault: ID, key count, secret count and recovery key count. No secret material.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.vault.getInfo({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `key_count` | `number \| null` | No | — |
| `secret_count` | `number \| null` | No | — |
| `recovery_key_count` | `number \| null` | No | — |

***

### getUnlockBundle

`vault.getUnlockBundle`

Returns the vault's wrapped encryption keys and all encrypted secrets for client-side decryption. Inkbox only stores ciphertext; decrypt locally with the SDK or CLI.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.vault.getUnlockBundle({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `wrapped_org_encryption_key` | `string \| null \| null` | No | — |
| `wrapped_org_encryption_keys` | `object[] \| null` | No | — |
| `encrypted_secrets` | `object[] \| null` | No | — |

> [accordion] wrapped\_org\_encryption\_keys full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   auth_hash?: string | null,
>   wrapped_org_encryption_key?: string | null
> }[] | null | null
> ```

> [accordion] encrypted\_secrets full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null | null,
>   secret_type?: string | null,
>   access?: {
>     id?: string | null,
>     vault_secret_id?: string | null,
>     identity_id?: string | null,
>     created_at?: string | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   encrypted_payload?: string | null
> }[] | null
> ```

***

### initialize

`vault.initialize`

Creates the organization's zero-knowledge vault from client-generated key material (`vault_key`, exactly four `recovery_keys`). Use the SDK or CLI to generate it.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.vault.initialize({
	vault_key: { id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', wrapped_org_encryption_key: 'example', auth_hash: '0000000000000000000000000000000000000000000000000000000000000000' },
	recovery_keys: [{ id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', wrapped_org_encryption_key: 'example', auth_hash: '0000000000000000000000000000000000000000000000000000000000000000' }, { id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', wrapped_org_encryption_key: 'example', auth_hash: '0000000000000000000000000000000000000000000000000000000000000000' }, { id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', wrapped_org_encryption_key: 'example', auth_hash: '0000000000000000000000000000000000000000000000000000000000000000' }, { id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', wrapped_org_encryption_key: 'example', auth_hash: '0000000000000000000000000000000000000000000000000000000000000000' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `vault_key` | `object` | Yes | — |
| `recovery_keys` | `object[]` | Yes | Exactly four recovery keys, each wrapping the same org encryption key with a different recovery-code-derived master key. |

> [accordion] vault\_key full type
>
> ```ts theme={null}
> {
>   id: string,
>   wrapped_org_encryption_key: string,
>   auth_hash: string,
>   key_type?: primary | recovery
> }
> ```

> [accordion] recovery\_keys full type
>
> ```ts theme={null}
> {
>   id: string,
>   wrapped_org_encryption_key: string,
>   auth_hash: string,
>   key_type?: primary | recovery
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `vault_id` | `string \| null` | No | — |
| `vault_key_id` | `string \| null` | No | — |
| `recovery_key_count` | `number \| null` | No | — |

***

### keys.list

`vault.keys.list`

Lists the vault's keys (primary and recovery) as metadata only, optionally filtered by `type`. No wrapped key material.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.vault.keys.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `primary \| recovery \| null` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   key_type?: string | null,
>   created_by?: string | null | null,
>   invalidated_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### keys.updatePrimary

`vault.keys.updatePrimary`

Replaces the vault's primary key with a new wrapped key (`wrapped_org_encryption_key`, `auth_hash`), proven by the current key or a recovery code, which is then used up.

**Risk:** `destructive`

```ts theme={null}
await corsair.inkbox.api.vault.keys.updatePrimary({ id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', wrapped_org_encryption_key: 'example', auth_hash: '0000000000000000000000000000000000000000000000000000000000000000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `wrapped_org_encryption_key` | `string` | Yes | AES-256-GCM ciphertext wrapping the org encryption key (base64) |
| `auth_hash` | `string` | Yes | SHA-256(newMasterKey) hex digest for the new primary key |
| `current_auth_hash` | `string \| null` | No | Stored auth hash of the current primary vault key |
| `recovery_auth_hash` | `string \| null` | No | Stored auth hash of a recovery code |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `key_type` | `string \| null` | No | — |
| `created_by` | `string \| null \| null` | No | — |
| `invalidated_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### secrets.create

`vault.secrets.create`

Stores a new vault secret: plaintext `name`, `description` and `secret_type`, plus an `encrypted_payload` encrypted client-side. Inkbox cannot read the payload.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.vault.secrets.create({
	id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	name: 'Support inbox',
	secret_type: 'api_key',
	encrypted_payload: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `name` | `string` | Yes | Plaintext display name for listing the secret, such as 'AWS Production'. |
| `description` | `string \| null` | No | Optional freeform context describing when and how to use this credential. |
| `secret_type` | `api_key \| key_pair \| login \| ssh_key \| other` | Yes | — |
| `encrypted_payload` | `string` | Yes | AES-256-GCM ciphertext (base64), opaque to server |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `secret_type` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   vault_secret_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### secrets.get

`vault.secrets.get`

Returns one vault secret with its access rules and client-side encrypted `encrypted_payload` (ciphertext); decrypt it locally with the vault key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.vault.secrets.get({ secret_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `secret_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `secret_type` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `encrypted_payload` | `string \| null` | No | — |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   vault_secret_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### secrets.grantAccess

`vault.secrets.grantAccess`

Grants an agent identity (`identity_id`) access to one vault secret. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.vault.secrets.grantAccess({ secret_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `secret_id` | `string` | Yes | — |
| `identity_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `vault_secret_id` | `string \| null` | No | — |
| `identity_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |

***

### secrets.list

`vault.secrets.list`

Lists vault secrets (names, types, descriptions, access) without their encrypted payloads, optionally filtered by `secret_type`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.vault.secrets.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `secret_type` | `api_key \| key_pair \| login \| ssh_key \| other \| null` | No | — |
| `limit` | `number \| null` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null | null,
>   secret_type?: string | null,
>   access?: {
>     id?: string | null,
>     vault_secret_id?: string | null,
>     identity_id?: string | null,
>     created_at?: string | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### secrets.listAccess

`vault.secrets.listAccess`

Lists the agent identities that have access to one vault secret.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.vault.secrets.listAccess({ secret_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `secret_id` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   vault_secret_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[]
> ```

***

### secrets.revokeAccess

`vault.secrets.revokeAccess`

Revokes an agent identity's access to one vault secret.

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

```ts theme={null}
await corsair.inkbox.api.vault.secrets.revokeAccess({ secret_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `secret_id` | `string` | Yes | — |
| `identity_id` | `string` | Yes | — |

**Output**

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

***

### secrets.update

`vault.secrets.update`

Updates a vault secret's `name`, `description` or `encrypted_payload` (new ciphertext encrypted client-side). Only supplied fields change.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.vault.secrets.update({ secret_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `secret_id` | `string` | Yes | — |
| `name` | `string \| null` | No | Optional new plaintext display name for the secret. |
| `description` | `string \| null` | No | Optional new freeform description for the secret. |
| `encrypted_payload` | `string \| null` | No | Optional replacement AES-256-GCM ciphertext payload (base64). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `secret_type` | `string \| null` | No | — |
| `access` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   vault_secret_id?: string | null,
>   identity_id?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

## Voice Agent

### getConfig

`voiceAgent.getConfig`

Returns an identity's Inkbox Voice AI settings: voice, instructions, effective voice and model, and authority mode.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.getConfig({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Target identity. Agent-scoped keys resolve their own; required for admin/JWT. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `voice` | `string \| null \| null` | No | — |
| `model` | `string \| null \| null` | No | Compatibility field; accepted values are not stored or used. |
| `effective_voice` | `string \| null` | No | — |
| `effective_model` | `string \| null` | No | Informational platform-selected runtime identifier; not a configurable model. |
| `instructions` | `string \| null \| null` | No | — |
| `authority_mode` | `string \| null` | No | — |

***

### listVoices

`voiceAgent.listVoices`

Lists the voices available for Inkbox Voice AI calls and the default voice.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.listVoices({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `voices` | `object[] \| null` | No | — |
| `default_voice` | `string \| null` | No | — |

> [accordion] voices full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   provider?: string | null,
>   available?: boolean | null,
>   preview_url?: string | null | null,
>   mcp_supported?: boolean | null
> }[] | null
> ```

***

### mcpServers.cancelAuthorization

`voiceAgent.mcpServers.cancelAuthorization`

Cancels an unfinished OAuth approval (`transaction_id`) for a Voice AI MCP server connection.

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

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.cancelAuthorization({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', transaction_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `transaction_id` | `string` | Yes | — |

**Output**

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

***

### mcpServers.create

`voiceAgent.mcpServers.create`

Adds a remote MCP server (`label`, `url`, `transport`, `auth`) whose tools an identity's Voice AI agent can use on calls, optionally limited to `allowed_tools`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.create({ label: 'support-agent key', url: 'https://example.com/inkbox/webhooks' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `agent_identity_id` | `string \| null` | No | — |
| `label` | `string` | Yes | — |
| `url` | `string` | Yes | — |
| `transport` | `streamable_http \| sse` | No | — |
| `auth` | `object` | No | — |
| `enabled` | `boolean` | No | — |
| `allowed_tools` | `string[] \| null` | No | — |
| `context` | `object` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   type?: none
> } | {
>   type: bearer,
>   token: string
> } | {
>   type: header,
>   token: string,
>   header_name: string,
>   value_prefix?: string
> } | {
>   type: oauth,
>   issuer?: string | null,
>   scopes?: string[],
>   client_id?: string | null,
>   client_secret?: string | null,
>   token_endpoint_auth_method?: none | client_secret_basic | client_secret_post,
>   profile?: standard | offline_consent
> }
> ```

> [accordion] context full type
>
> ```ts theme={null}
> {
>   mode?: selected | all,
>   prompts?: {
>     name: string,
>     arguments?: Record<string, string>
>   }[],
>   resources?: string[],
>   skills?: {
>     uri: string,
>     manifest_digest: string
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `label` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `auth` | `object \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `allowed_tools` | `string[] \| null \| null` | No | — |
| `context` | `object \| null` | No | — |
| `config_version` | `number \| null` | No | — |
| `preparation_status` | `string \| null` | No | — |
| `health_code` | `string \| null \| null` | No | — |
| `capabilities` | `Record<string, boolean> \| null` | No | — |
| `catalog_version` | `string \| null \| null` | No | — |
| `catalog_fetched_at` | `string \| null \| null` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   configured?: boolean | null,
>   header_name?: string | null | null,
>   value_prefix?: string | null | null,
>   status?: string | null | null,
>   expires_at?: string | null | null,
>   refresh_supported?: boolean | null,
>   requested_scopes?: string[] | null,
>   granted_scopes?: string[] | null,
>   error_code?: string | null | null,
>   issuer?: string | null | null,
>   callback_uri?: string | null | null
> } | null
> ```

> [accordion] context full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   prompts?: {
>     name?: string | null,
>     arguments?: Record<string, string> | null
>   }[] | null,
>   resources?: string[] | null,
>   skills?: {
>     uri?: string | null,
>     manifest_digest?: string | null
>   }[] | null
> } | null
> ```

***

### mcpServers.delete

`voiceAgent.mcpServers.delete`

Deletes a Voice AI MCP server connection; new calls can no longer use its tools.

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

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.delete({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output**

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

***

### mcpServers.disconnect

`voiceAgent.mcpServers.disconnect`

Disconnects the OAuth account from a Voice AI MCP server connection (`expected_version`), keeping its other settings.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.disconnect({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', expected_version: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `expected_version` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `code` | `string \| null` | No | — |
| `config_version` | `number \| null` | No | — |

***

### mcpServers.get

`voiceAgent.mcpServers.get`

Returns one Voice AI MCP server connection with its settings, auth state, preparation status and health.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.get({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `label` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `auth` | `object \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `allowed_tools` | `string[] \| null \| null` | No | — |
| `context` | `object \| null` | No | — |
| `config_version` | `number \| null` | No | — |
| `preparation_status` | `string \| null` | No | — |
| `health_code` | `string \| null \| null` | No | — |
| `capabilities` | `Record<string, boolean> \| null` | No | — |
| `catalog_version` | `string \| null \| null` | No | — |
| `catalog_fetched_at` | `string \| null \| null` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   configured?: boolean | null,
>   header_name?: string | null | null,
>   value_prefix?: string | null | null,
>   status?: string | null | null,
>   expires_at?: string | null | null,
>   refresh_supported?: boolean | null,
>   requested_scopes?: string[] | null,
>   granted_scopes?: string[] | null,
>   error_code?: string | null | null,
>   issuer?: string | null | null,
>   callback_uri?: string | null | null
> } | null
> ```

> [accordion] context full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   prompts?: {
>     name?: string | null,
>     arguments?: Record<string, string> | null
>   }[] | null,
>   resources?: string[] | null,
>   skills?: {
>     uri?: string | null,
>     manifest_digest?: string | null
>   }[] | null
> } | null
> ```

***

### mcpServers.getAuthorization

`voiceAgent.mcpServers.getAuthorization`

Returns the status of an OAuth approval for a Voice AI MCP server connection, with its `connect_url` and requested scopes.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.getAuthorization({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', transaction_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `transaction_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `expires_at` | `string \| null` | No | — |
| `connect_url` | `string \| null \| null` | No | — |
| `config_version` | `number \| null \| null` | No | — |
| `requested_scopes` | `string[] \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |

***

### mcpServers.getCatalog

`voiceAgent.mcpServers.getCatalog`

Lists the tools, prompts, resources and skills a Voice AI MCP server connection exposes.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.getCatalog({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `cursor` | `number` | No | — |
| `limit` | `number` | No | — |
| `skill_uri` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tools` | `object[] \| null` | No | — |
| `prompts` | `object[] \| null` | No | — |
| `resources` | `object[] \| null` | No | — |
| `skills` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |
| `config_version` | `number \| null` | No | — |
| `catalog_version` | `string \| null \| null` | No | — |

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

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

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

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

***

### mcpServers.list

`voiceAgent.mcpServers.list`

Lists the remote MCP server connections of an identity's Voice AI agent.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.list({});
```

**Input**

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

**Output**

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

> [accordion] connections full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_identity_id?: string | null,
>   label?: string | null,
>   url?: string | null,
>   transport?: string | null,
>   auth?: {
>     type?: string | null,
>     configured?: boolean | null,
>     header_name?: string | null | null,
>     value_prefix?: string | null | null,
>     status?: string | null | null,
>     expires_at?: string | null | null,
>     refresh_supported?: boolean | null,
>     requested_scopes?: string[] | null,
>     granted_scopes?: string[] | null,
>     error_code?: string | null | null,
>     issuer?: string | null | null,
>     callback_uri?: string | null | null
>   } | null,
>   enabled?: boolean | null,
>   allowed_tools?: string[] | null | null,
>   context?: {
>     mode?: string | null,
>     prompts?: {
>       name?: string | null,
>       arguments?: Record<string, string> | null
>     }[] | null,
>     resources?: string[] | null,
>     skills?: {
>       uri?: string | null,
>       manifest_digest?: string | null
>     }[] | null
>   } | null,
>   config_version?: number | null,
>   preparation_status?: string | null,
>   health_code?: string | null | null,
>   capabilities?: Record<string, boolean> | null,
>   catalog_version?: string | null | null,
>   catalog_fetched_at?: string | null | null
> }[] | null
> ```

***

### mcpServers.refresh

`voiceAgent.mcpServers.refresh`

Queues a refresh of a Voice AI MCP server connection's tool catalog.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.refresh({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `code` | `string \| null` | No | — |
| `config_version` | `number \| null` | No | — |

***

### mcpServers.startAuthorization

`voiceAgent.mcpServers.startAuthorization`

Starts OAuth for a Voice AI MCP server connection (`expected_version`) and returns a `connect_url` a person must open to approve access.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.startAuthorization({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', expected_version: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `expected_version` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connection_id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `expires_at` | `string \| null` | No | — |
| `connect_url` | `string \| null \| null` | No | — |
| `config_version` | `number \| null \| null` | No | — |
| `requested_scopes` | `string[] \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |

***

### mcpServers.test

`voiceAgent.mcpServers.test`

Tests that a Voice AI MCP server connection can be reached and its tools discovered, without running any tool.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.test({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `code` | `string \| null` | No | — |
| `config_version` | `number \| null` | No | — |

***

### mcpServers.update

`voiceAgent.mcpServers.update`

Updates a Voice AI MCP server connection (`label`, `url`, `auth`, `enabled`, `allowed_tools`, `context`), given its `expected_version`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.mcpServers.update({ connection_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', expected_version: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connection_id` | `string` | Yes | — |
| `expected_version` | `number` | Yes | — |
| `label` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `transport` | `streamable_http \| sse \| null` | No | — |
| `auth` | `object \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `allowed_tools` | `string[] \| null` | No | — |
| `context` | `object \| null` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   type?: none
> } | {
>   type: bearer,
>   token: string
> } | {
>   type: header,
>   token: string,
>   header_name: string,
>   value_prefix?: string
> } | {
>   type: oauth,
>   issuer?: string | null,
>   scopes?: string[],
>   client_id?: string | null,
>   client_secret?: string | null,
>   token_endpoint_auth_method?: none | client_secret_basic | client_secret_post,
>   profile?: standard | offline_consent
> } | null
> ```

> [accordion] context full type
>
> ```ts theme={null}
> {
>   mode?: selected | all,
>   prompts?: {
>     name: string,
>     arguments?: Record<string, string>
>   }[],
>   resources?: string[],
>   skills?: {
>     uri: string,
>     manifest_digest: string
>   }[]
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `label` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `transport` | `string \| null` | No | — |
| `auth` | `object \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `allowed_tools` | `string[] \| null \| null` | No | — |
| `context` | `object \| null` | No | — |
| `config_version` | `number \| null` | No | — |
| `preparation_status` | `string \| null` | No | — |
| `health_code` | `string \| null \| null` | No | — |
| `capabilities` | `Record<string, boolean> \| null` | No | — |
| `catalog_version` | `string \| null \| null` | No | — |
| `catalog_fetched_at` | `string \| null \| null` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   configured?: boolean | null,
>   header_name?: string | null | null,
>   value_prefix?: string | null | null,
>   status?: string | null | null,
>   expires_at?: string | null | null,
>   refresh_supported?: boolean | null,
>   requested_scopes?: string[] | null,
>   granted_scopes?: string[] | null,
>   error_code?: string | null | null,
>   issuer?: string | null | null,
>   callback_uri?: string | null | null
> } | null
> ```

> [accordion] context full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   prompts?: {
>     name?: string | null,
>     arguments?: Record<string, string> | null
>   }[] | null,
>   resources?: string[] | null,
>   skills?: {
>     uri?: string | null,
>     manifest_digest?: string | null
>   }[] | null
> } | null
> ```

***

### setAuthorityMode

`voiceAgent.setAuthorityMode`

Sets what an identity's Voice AI agent can access on calls (`authority_mode`): `contact_scoped` (the caller only) or `yolo` (all the identity's contacts and messages).

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.setAuthorityMode({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', authority_mode: 'contact_scoped' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string` | Yes | — |
| `authority_mode` | `contact_scoped \| yolo` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `voice` | `string \| null \| null` | No | — |
| `model` | `string \| null \| null` | No | Compatibility field; accepted values are not stored or used. |
| `effective_voice` | `string \| null` | No | — |
| `effective_model` | `string \| null` | No | Informational platform-selected runtime identifier; not a configurable model. |
| `instructions` | `string \| null \| null` | No | — |
| `authority_mode` | `string \| null` | No | — |

***

### setConfig

`voiceAgent.setConfig`

Replaces an identity's Voice AI `voice` and `instructions`; omitted fields reset to platform defaults. The authority mode is unchanged.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.voiceAgent.setConfig({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `agent_identity_id` | `string \| null` | No | — |
| `voice` | `string \| null` | No | — |
| `model` | `string \| null` | No | Compatibility field; accepted but ignored. |
| `instructions` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `voice` | `string \| null \| null` | No | — |
| `model` | `string \| null \| null` | No | Compatibility field; accepted values are not stored or used. |
| `effective_voice` | `string \| null` | No | — |
| `effective_model` | `string \| null` | No | Informational platform-selected runtime identifier; not a configurable model. |
| `instructions` | `string \| null \| null` | No | — |
| `authority_mode` | `string \| null` | No | — |

***

## Webhooks

### deliveries.list

`webhooks.deliveries.list`

Lists logged webhook delivery attempts, newest first, filterable by identity, subscription, phone number, `event_type` and `success`.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `subscription_id` | `string \| null` | No | — |
| `phone_number_id` | `string \| null` | No | — |
| `event_type` | `string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output**

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

> [accordion] deliveries full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   replayable?: boolean | null,
>   replay_unavailable_reason?: string | null | null,
>   webhook_subscription_id?: string | null | null,
>   phone_number_id?: string | null | null,
>   event_id?: string | null,
>   event_type?: string | null,
>   url?: string | null,
>   request_payload?: string | null,
>   response_status?: number | null | null,
>   response_body?: string | null | null,
>   error_detail?: string | null | null,
>   duration_ms?: number | null | null,
>   is_replay?: boolean | null,
>   created_at?: string | null
> }[] | null
> ```

***

### deliveries.replay

`webhooks.deliveries.replay`

Re-sends a logged webhook event to its subscription's current URL and auth token, recording a new delivery.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.webhooks.deliveries.replay({ delivery_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `delivery_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `replayable` | `boolean \| null` | No | — |
| `replay_unavailable_reason` | `string \| null \| null` | No | — |
| `webhook_subscription_id` | `string \| null \| null` | No | Subscription this delivery targeted; null for incoming-call deliveries. |
| `phone_number_id` | `string \| null \| null` | No | Phone number for incoming-call deliveries (which have no subscription). |
| `event_id` | `string \| null` | No | Envelope event id (evt\_...), or the call id for incoming-call rows. |
| `event_type` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `request_payload` | `string \| null` | No | Delivered request body; contact enrichment is omitted from identity-scoped history. |
| `response_status` | `number \| null \| null` | No | HTTP status returned by the endpoint; null on transport failure. |
| `response_body` | `string \| null \| null` | No | Truncated response snippet; omitted when contact enrichment is removed from scoped history. |
| `error_detail` | `string \| null \| null` | No | Transport error summary, if any. |
| `duration_ms` | `number \| null \| null` | No | — |
| `is_replay` | `boolean \| null` | No | True if this row was produced by a manual replay. |
| `created_at` | `string \| null` | No | — |

***

### getCatalog

`webhooks.getCatalog`

Lists the webhook event types you can subscribe to, with example signature headers.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.webhooks.getCatalog({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supports_identity_subscriptions` | `boolean \| null` | No | — |
| `events` | `object[] \| null` | No | — |
| `example_signature_headers` | `string \| null` | No | — |

> [accordion] events full type
>
> ```ts theme={null}
> {
>   event_type?: string | null,
>   resource_type?: string | null,
>   delivery_path?: string | null,
>   payload_schema?: string | null,
>   summary?: string | null,
>   description?: string | null,
>   trigger_text?: string | null,
>   delivery_text?: string | null,
>   response_text?: string | null,
>   response_required?: boolean | null,
>   example_payload?: string | null,
>   example_response?: string | null | null
> }[] | null
> ```

***

### subscriptions.create

`webhooks.subscriptions.create`

Subscribes a `url` to webhook `event_types` (mail, SMS, calls, iMessage and more) for an identity, mailbox or phone number. Returns the identity's signing key once if new.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.webhooks.subscriptions.create({
	agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
	url: 'https://example.com/inkbox/webhooks',
	event_types: ['message.received', 'text.received'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mailbox_id` | `string \| null` | No | — |
| `phone_number_id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `url` | `string` | Yes | — |
| `event_types` | `(message.received \| message.sent \| message.forwarded \| message.delivered \| message.bounced \| message.failed \| text.received \| text.sent \| text.delivered \| text.delivery_failed \| text.delivery_unconfirmed \| call.ended \| imessage.received \| imessage.reaction_received \| imessage.sent \| imessage.delivered \| imessage.delivery_failed \| message.transcription_finished \| whatsapp.reaction_received \| whatsapp.received \| whatsapp.sent \| whatsapp.delivered \| whatsapp.delivery_failed \| whatsapp.delivery_unconfirmed \| a2a.task.created \| a2a.task.message \| a2a.task.canceled \| a2a.sent_task.updated \| slack.dm_received \| slack.group_dm_received \| slack.channel_message_received \| slack.mention_received \| slack.thread_reply_received \| slack.message_updated \| slack.message_deleted \| slack.reaction_added \| slack.reaction_removed \| slack.member_joined \| slack.member_left \| slack.channel_updated \| slack.file_shared \| slack.file_changed \| slack.file_deleted \| slack.pin_added \| slack.pin_removed \| slack.connection_changed \| slack.message_sent \| slack.message_send_failed \| slack.message_send_unknown \| slack.interaction \| slack.session_stopped)[]` | Yes | — |
| `context_config` | `object \| null` | No | Optional per-class conversation context (email/texts/calls) included in received-event payloads. Omit or null for none. |
| `auth_token` | `string \| null` | No | Optional bearer token for endpoints that require it; sent as 'Authorization: Bearer \<token>' on every delivery and returned on subscription reads. |

> [accordion] context\_config full type
>
> ```ts theme={null}
> {
>   email?: {
>     mode: count,
>     count: number
>   } | {
>     mode: window,
>     hours: number
>   } | null,
>   texts?: {
>     mode: count,
>     count: number
>   } | {
>     mode: window,
>     hours: number
>   } | null,
>   calls?: {
>     mode: count,
>     count: number
>   } | {
>     mode: window,
>     hours: number
>   } | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null \| null` | No | — |
| `phone_number_id` | `string \| null \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | — |
| `owner_identity_id` | `string \| null \| null` | No | — |
| `url` | `string \| null` | No | — |
| `event_types` | `(string \| string \| string \| string \| string \| string \| string \| string)[] \| null` | No | — |
| `context_config` | `object \| null` | No | — |
| `auth_token` | `string \| null \| null` | No | — |
| `has_auth_token` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `signing_key` | `string \| null \| null` | No | — |

> [accordion] context\_config full type
>
> ```ts theme={null}
> {
>   email?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null,
>   texts?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null,
>   calls?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null
> } | null | null
> ```

***

### subscriptions.delete

`webhooks.subscriptions.delete`

Deletes a webhook subscription, stopping all its event notifications.

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

```ts theme={null}
await corsair.inkbox.api.webhooks.subscriptions.delete({ sub_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sub_id` | `string` | Yes | — |
| `scope` | `identity \| null` | No | — |

**Output**

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

***

### subscriptions.get

`webhooks.subscriptions.get`

Returns one webhook subscription with its URL, event types and status.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.webhooks.subscriptions.get({ sub_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sub_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null \| null` | No | — |
| `phone_number_id` | `string \| null \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | — |
| `owner_identity_id` | `string \| null \| null` | No | — |
| `url` | `string \| null` | No | — |
| `event_types` | `(string \| string \| string \| string \| string \| string \| string \| string)[] \| null` | No | — |
| `context_config` | `object \| null` | No | — |
| `auth_token` | `string \| null \| null` | No | — |
| `has_auth_token` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] context\_config full type
>
> ```ts theme={null}
> {
>   email?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null,
>   texts?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null,
>   calls?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null
> } | null | null
> ```

***

### subscriptions.list

`webhooks.subscriptions.list`

Lists active webhook subscriptions, newest first, filterable by identity, mailbox, phone number, `url` or `event_type`.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mailbox_id` | `string \| null` | No | — |
| `phone_number_id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `event_type` | `message.received \| message.sent \| message.forwarded \| message.delivered \| message.bounced \| message.failed \| text.received \| text.sent \| text.delivered \| text.delivery_failed \| text.delivery_unconfirmed \| call.ended \| imessage.received \| imessage.reaction_received \| imessage.sent \| imessage.delivered \| imessage.delivery_failed \| message.transcription_finished \| whatsapp.reaction_received \| whatsapp.received \| whatsapp.sent \| whatsapp.delivered \| whatsapp.delivery_failed \| whatsapp.delivery_unconfirmed \| a2a.task.created \| a2a.task.message \| a2a.task.canceled \| a2a.sent_task.updated \| slack.dm_received \| slack.group_dm_received \| slack.channel_message_received \| slack.mention_received \| slack.thread_reply_received \| slack.message_updated \| slack.message_deleted \| slack.reaction_added \| slack.reaction_removed \| slack.member_joined \| slack.member_left \| slack.channel_updated \| slack.file_shared \| slack.file_changed \| slack.file_deleted \| slack.pin_added \| slack.pin_removed \| slack.connection_changed \| slack.message_sent \| slack.message_send_failed \| slack.message_send_unknown \| slack.interaction \| slack.session_stopped \| null` | No | — |
| `limit` | `number \| null` | No | — |
| `offset` | `number` | No | — |
| `scope` | `identity \| null` | No | — |

**Output**

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

> [accordion] subscriptions full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   organization_id?: string | null,
>   mailbox_id?: string | null | null,
>   phone_number_id?: string | null | null,
>   agent_identity_id?: string | null | null,
>   owner_identity_id?: string | null | null,
>   url?: string | null,
>   event_types?: (string | string | string | string | string | string | string | string)[] | null,
>   context_config?: {
>     email?: {
>       mode?: string | null,
>       count?: number | null
>     } | {
>       mode?: string | null,
>       hours?: number | null
>     } | null | null,
>     texts?: {
>       mode?: string | null,
>       count?: number | null
>     } | {
>       mode?: string | null,
>       hours?: number | null
>     } | null | null,
>     calls?: {
>       mode?: string | null,
>       count?: number | null
>     } | {
>       mode?: string | null,
>       hours?: number | null
>     } | null | null
>   } | null | null,
>   auth_token?: string | null | null,
>   has_auth_token?: boolean | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### subscriptions.update

`webhooks.subscriptions.update`

Updates a webhook subscription's `url`, `event_types` (replaces the whole selection), `context_config` or `auth_token`.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.webhooks.subscriptions.update({ sub_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sub_id` | `string` | Yes | — |
| `scope` | `identity \| null` | No | — |
| `url` | `string \| null` | No | — |
| `event_types` | `(message.received \| message.sent \| message.forwarded \| message.delivered \| message.bounced \| message.failed \| text.received \| text.sent \| text.delivered \| text.delivery_failed \| text.delivery_unconfirmed \| call.ended \| imessage.received \| imessage.reaction_received \| imessage.sent \| imessage.delivered \| imessage.delivery_failed \| message.transcription_finished \| whatsapp.reaction_received \| whatsapp.received \| whatsapp.sent \| whatsapp.delivered \| whatsapp.delivery_failed \| whatsapp.delivery_unconfirmed \| a2a.task.created \| a2a.task.message \| a2a.task.canceled \| a2a.sent_task.updated \| slack.dm_received \| slack.group_dm_received \| slack.channel_message_received \| slack.mention_received \| slack.thread_reply_received \| slack.message_updated \| slack.message_deleted \| slack.reaction_added \| slack.reaction_removed \| slack.member_joined \| slack.member_left \| slack.channel_updated \| slack.file_shared \| slack.file_changed \| slack.file_deleted \| slack.pin_added \| slack.pin_removed \| slack.connection_changed \| slack.message_sent \| slack.message_send_failed \| slack.message_send_unknown \| slack.interaction \| slack.session_stopped)[] \| null` | No | — |
| `context_config` | `object \| null` | No | — |
| `auth_token` | `string \| null` | No | — |

> [accordion] context\_config full type
>
> ```ts theme={null}
> {
>   email?: {
>     mode: count,
>     count: number
>   } | {
>     mode: window,
>     hours: number
>   } | null,
>   texts?: {
>     mode: count,
>     count: number
>   } | {
>     mode: window,
>     hours: number
>   } | null,
>   calls?: {
>     mode: count,
>     count: number
>   } | {
>     mode: window,
>     hours: number
>   } | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `organization_id` | `string \| null` | No | — |
| `mailbox_id` | `string \| null \| null` | No | — |
| `phone_number_id` | `string \| null \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | — |
| `owner_identity_id` | `string \| null \| null` | No | — |
| `url` | `string \| null` | No | — |
| `event_types` | `(string \| string \| string \| string \| string \| string \| string \| string)[] \| null` | No | — |
| `context_config` | `object \| null` | No | — |
| `auth_token` | `string \| null \| null` | No | — |
| `has_auth_token` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] context\_config full type
>
> ```ts theme={null}
> {
>   email?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null,
>   texts?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null,
>   calls?: {
>     mode?: string | null,
>     count?: number | null
>   } | {
>     mode?: string | null,
>     hours?: number | null
>   } | null | null
> } | null | null
> ```

***

## Whatsapp

### assignments.list

`whatsapp.assignments.list`

Lists active WhatsApp connections (one per recipient connected to an agent through a shared number or the router), newest first, optionally for one `agent_identity_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.assignments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Narrow to one agent identity. Ignored for agent-scoped keys (always their own identity). |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   remote_number?: string | null,
>   agent_identity_id?: string | null,
>   organization_id?: string | null,
>   status?: string | null,
>   released_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### assignments.release

`whatsapp.assignments.release`

Disconnects a recipient from an agent over WhatsApp (`assignment_id`): their messages stop reaching the agent and sends fail. Requires an admin API key.

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

```ts theme={null}
await corsair.inkbox.api.whatsapp.assignments.release({ assignment_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `assignment_id` | `string` | Yes | — |

**Output**

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

***

### connect

`whatsapp.connect`

Reserves a shared WhatsApp number linking a recipient (`recipient_number`) to an agent identity without sending anything; the agent can reply once they message it. Admin API key only.

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

```ts theme={null}
await corsair.inkbox.api.whatsapp.connect({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', recipient_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `agent_identity_id` | `string` | Yes | — |
| `recipient_number` | `string` | Yes | Phone number in E.164 format (e.g. '+15551234567'). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `assignment` | `object \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `assigned_number` | `string \| null \| null` | No | The organization-owned shared number the recipient should message; null on Inkbox's global shared numbers, which the recipient learns from the router. |
| `already_connected` | `boolean \| null` | No | — |
| `awaiting_inbound` | `boolean \| null` | No | True until the recipient sends a message; replies are rejected until then. |

> [accordion] assignment full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   remote_number?: string | null,
>   agent_identity_id?: string | null,
>   organization_id?: string | null,
>   status?: string | null,
>   released_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

### conversations.get

`whatsapp.conversations.get`

Returns one WhatsApp 1:1 or group conversation by `conversation_id`, with participants and connection status.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.conversations.get({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `active_conversation_id` | `string \| null \| null` | No | Existing conversation on the current route, or null when no current conversation exists. |
| `assignment_id` | `string \| null \| null` | No | The shared-number connection this conversation runs on; null on a dedicated number. |
| `assignment_status` | `string \| null \| null` | No | Whether that connection is still active; null on a dedicated number. |
| `local_number` | `string \| null \| null` | No | This agent's WhatsApp number; null on Inkbox's global shared numbers. |
| `remote_number` | `string \| null \| null` | No | — |
| `participants` | `string[] \| null` | No | — |
| `is_group` | `boolean \| null` | No | — |
| `group_name` | `string \| null \| null` | No | — |
| `unresolved_participant_count` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### conversations.getThread

`whatsapp.conversations.getThread`

Returns the messages of one reply thread (`thread_id`) inside a WhatsApp conversation, paged with `cursor`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.conversations.getThread({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', thread_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | — |
| `thread_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `thread_root_message_id` | `string \| null \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_identity_id?: string | null,
>   conversation_id?: string | null,
>   logical_conversation_id?: string | null | null,
>   direction?: string | null,
>   local_number?: string | null | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null,
>   sender_access?: string | null,
>   is_group?: boolean | null,
>   agent_mentioned?: boolean | null,
>   mentions?: {
>     text?: string | null | null,
>     phone_number?: string | null | null,
>     is_agent?: boolean | null
>   }[] | null,
>   group_name?: string | null | null,
>   unresolved_participant_count?: number | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   reactions?: {
>     id?: string | null,
>     target_message_id?: string | null,
>     conversation_id?: string | null,
>     agent_identity_id?: string | null,
>     direction?: string | null,
>     remote_number?: string | null | null,
>     reaction?: string | string | null,
>     custom_emoji?: string | null | null,
>     emoji?: string | null,
>     status?: string | null,
>     revision?: number | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     removed_at?: string | null | null
>   }[] | null,
>   content?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null,
>     filename?: string | null,
>     content_type?: string | null,
>     size?: number | null | null,
>     status?: string | null,
>     url?: string | null | null
>   }[] | null,
>   status?: string | null,
>   delivery_state?: string | null | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null,
>     delivery_state?: string | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   source_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   status_observed_at?: string | null | null,
>   status_refresh_pending?: boolean | null
> }[] | null
> ```

***

### conversations.list

`whatsapp.conversations.list`

Lists WhatsApp conversations by most recent message, filterable by identity, participants, contact, blocked state, groups and date range.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `participants` | `string[] \| null` | No | — |
| `contact_id` | `string \| null` | No | — |
| `include_groups` | `boolean` | No | — |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_identity_id?: string | null,
>   active_conversation_id?: string | null | null,
>   assignment_id?: string | null | null,
>   assignment_status?: string | null | null,
>   local_number?: string | null | null,
>   remote_number?: string | null | null,
>   participants?: string[] | null,
>   is_group?: boolean | null,
>   group_name?: string | null | null,
>   unresolved_participant_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   latest_text?: string | null | null,
>   latest_message_at?: string | null | null,
>   latest_direction?: string | null | null,
>   latest_has_media?: boolean | null,
>   unread_count?: number | null,
>   total_count?: number | null
> }[]
> ```

***

### disconnect

`whatsapp.disconnect`

Disconnects the active WhatsApp connection between an agent identity (`agent_identity_id`) and a recipient (`recipient_number`). Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.whatsapp.disconnect({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', recipient_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `agent_identity_id` | `string` | Yes | — |
| `recipient_number` | `string` | Yes | Phone number in E.164 format (e.g. '+15551234567'). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `assignment_id` | `string \| null \| null` | No | — |
| `disconnected` | `boolean \| null` | No | — |

***

### getLimits

`whatsapp.getLimits`

Returns an agent's effective WhatsApp limits (such as media size and opening-message rules) and usage counters for the rolling 24 hours.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.getLimits({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `limits` | `Record<string, number> \| null` | No | — |
| `usage` | `Record<string, number> \| null` | No | — |

***

### getOnboarding

`whatsapp.getOnboarding`

Returns instructions a person follows to reach an agent on WhatsApp (connect command, links and QR codes) and whether the channel is ready. Sends nothing.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.getOnboarding({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `triage_number` | `string \| null` | No | The router number the person messages. |
| `connect_command` | `string \| null` | No | The text the person sends, for example `connect @handle`. |
| `connect_link` | `string \| null` | No | A wa.me link that opens the connect command as a draft to the router. |
| `connect_qr_png_data_url` | `string \| null` | No | A PNG data URL of a QR code for the same link. |
| `ready` | `boolean \| null` | No | Whether WhatsApp is enabled for this agent. |
| `number` | `string \| null` | No | Compatibility alias for the router number. |
| `message_text` | `string \| null` | No | Compatibility alias for the recipient's connect command. |
| `message_link` | `string \| null` | No | Compatibility alias for the router connect link. |
| `message_qr_png_data_url` | `string \| null` | No | Compatibility alias for the router connect QR code. |

***

### getTriageNumber

`whatsapp.getTriageNumber`

Returns the WhatsApp router number and the `connect @handle` command, with a tap link and QR code, for people to reach an agent.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.getTriageNumber({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | Resolve the connect command, link and QR for this agent identity. Organization-wide callers may pass any identity in the organization; agent-scoped keys only their own. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `number` | `string \| null` | No | — |
| `connect_command` | `string \| null` | No | `connect @handle` for a selected agent; a generic placeholder otherwise. |
| `whatsapp_link` | `string \| null` | No | A wa.me link that opens the connect command as a draft to the router. |
| `connect_qr_png_data_url` | `string \| null` | No | A PNG data URL of a QR code for the same link. |

***

### markRead

`whatsapp.markRead`

Marks a WhatsApp conversation's inbound messages as read, optionally only up to `through_message_id`, and sends read receipts the person can see.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.whatsapp.markRead({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `conversation_id` | `string` | Yes | — |
| `through_message_id` | `string \| null` | No | Mark only messages up to and including this one; omit to mark every unread message. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `updated_count` | `number \| null` | No | — |
| `read_receipts_sent` | `boolean \| null` | No | True when WhatsApp read receipts were sent for the marked messages. False when there was nothing to acknowledge, the conversation is a group, or this number does not support read receipts yet; local read state is updated either way. |

***

### media.get

`whatsapp.media.get`

Returns metadata and a fresh temporary download URL for a WhatsApp media item (`media_id`), including any audio transcription.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.media.get({ media_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `media_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `transcription` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `filename` | `string \| null` | No | — |
| `content_type` | `string \| null` | No | — |
| `size` | `number \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `url` | `string \| null \| null` | No | — |

> [accordion] transcription full type
>
> ```ts theme={null}
> {
>   status?: string | null,
>   text?: string | null | null,
>   error_code?: string | null | null
> } | null | null
> ```

***

### media.getPlayback

`whatsapp.media.getPlayback`

Returns a WhatsApp audio attachment (`media_id`) converted for browser playback.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.media.getPlayback({ media_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `media_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | 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. |

***

### media.upload

`whatsapp.media.upload`

Uploads a file (`file`, multipart) for an agent and returns a media ID to send in `media_ids`; pass `recipient_number` when replying through a shared number.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.whatsapp.media.upload({
	file: { base64: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', filename: 'avatar.png', contentType: 'image/png' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `recipient_number` | `string \| null` | No | Recipient this attachment is for. Required when the agent replies through a shared number instead of its own dedicated number. |
| `file` | `string \| object \| custom` | Yes | A file: a public URL to it, or \{url, filename?, contentType?}, or \{base64, filename?, contentType?} for a small one. |

> [accordion] file full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `transcription` | `object \| null` | No | — |
| `id` | `string \| null` | No | — |
| `filename` | `string \| null` | No | — |
| `content_type` | `string \| null` | No | — |
| `size` | `number \| null \| null` | No | — |
| `status` | `string \| null` | No | — |
| `url` | `string \| null \| null` | No | — |

> [accordion] transcription full type
>
> ```ts theme={null}
> {
>   status?: string | null,
>   text?: string | null | null,
>   error_code?: string | null | null
> } | null | null
> ```

***

### messages.get

`whatsapp.messages.get`

Returns one WhatsApp message by `message_id`, with sender, direction, participants and mentions.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.messages.get({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `logical_conversation_id` | `string \| null \| null` | No | Stable direct-history ID across number changes; conversation\_id retains its physical source. |
| `direction` | `string \| null` | No | — |
| `local_number` | `string \| null \| null` | No | This agent's WhatsApp number; null on Inkbox's global shared numbers. |
| `remote_number` | `string \| null \| null` | No | — |
| `sender_number` | `string \| null \| null` | No | — |
| `participants` | `string[] \| null` | No | — |
| `sender_access` | `string \| null` | No | Admission of this inbound message at receipt: direct passed contact rules (including allowed by default); sponsored was default-filtered and is delivered under conversation sponsorship. Not sender trust or command permission. Absent when unknown or inapplicable, including outbound and system-generated messages. |
| `is_group` | `boolean \| null` | No | — |
| `agent_mentioned` | `boolean \| null` | No | — |
| `mentions` | `object[] \| null` | No | — |
| `group_name` | `string \| null \| null` | No | — |
| `unresolved_participant_count` | `number \| null` | No | — |
| `reply_to_message_id` | `string \| null \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `thread_root_message_id` | `string \| null \| null` | No | — |
| `reactions` | `object[] \| null` | No | — |
| `content` | `string \| null \| null` | No | — |
| `media` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `delivery_state` | `string \| null \| null` | No | — |
| `recipients` | `object[] \| null` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `error_code` | `string \| null \| null` | No | — |
| `error_detail` | `string \| null \| null` | No | — |
| `source_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `delivered_at` | `string \| null \| null` | No | — |
| `failed_at` | `string \| null \| null` | No | — |
| `status_observed_at` | `string \| null \| null` | No | — |
| `status_refresh_pending` | `boolean \| null` | No | — |

> [accordion] mentions full type
>
> ```ts theme={null}
> {
>   text?: string | null | null,
>   phone_number?: string | null | null,
>   is_agent?: boolean | null
> }[] | null
> ```

> [accordion] reactions full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   target_message_id?: string | null,
>   conversation_id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   reaction?: string | string | null,
>   custom_emoji?: string | null | null,
>   emoji?: string | null,
>   status?: string | null,
>   revision?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   removed_at?: string | null | null
> }[] | null
> ```

> [accordion] media full type
>
> ```ts theme={null}
> {
>   transcription?: {
>     status?: string | null,
>     text?: string | null | null,
>     error_code?: string | null | null
>   } | null | null,
>   id?: string | null,
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null | null,
>   status?: string | null,
>   url?: string | null | null
> }[] | null
> ```

> [accordion] recipients full type
>
> ```ts theme={null}
> {
>   remote_number?: string | null,
>   delivery_status?: string | null,
>   delivery_state?: string | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null
> }[] | null
> ```

***

### messages.getThread

`whatsapp.messages.getThread`

Returns the reply thread containing a WhatsApp message (root and replies), using any message in the thread.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.messages.getThread({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |
| `limit` | `number` | No | — |
| `cursor` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `thread_id` | `string \| null \| null` | No | — |
| `thread_root_message_id` | `string \| null \| null` | No | — |
| `messages` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null \| null` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_identity_id?: string | null,
>   conversation_id?: string | null,
>   logical_conversation_id?: string | null | null,
>   direction?: string | null,
>   local_number?: string | null | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null,
>   sender_access?: string | null,
>   is_group?: boolean | null,
>   agent_mentioned?: boolean | null,
>   mentions?: {
>     text?: string | null | null,
>     phone_number?: string | null | null,
>     is_agent?: boolean | null
>   }[] | null,
>   group_name?: string | null | null,
>   unresolved_participant_count?: number | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   reactions?: {
>     id?: string | null,
>     target_message_id?: string | null,
>     conversation_id?: string | null,
>     agent_identity_id?: string | null,
>     direction?: string | null,
>     remote_number?: string | null | null,
>     reaction?: string | string | null,
>     custom_emoji?: string | null | null,
>     emoji?: string | null,
>     status?: string | null,
>     revision?: number | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     removed_at?: string | null | null
>   }[] | null,
>   content?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null,
>     filename?: string | null,
>     content_type?: string | null,
>     size?: number | null | null,
>     status?: string | null,
>     url?: string | null | null
>   }[] | null,
>   status?: string | null,
>   delivery_state?: string | null | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null,
>     delivery_state?: string | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   source_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   status_observed_at?: string | null | null,
>   status_refresh_pending?: boolean | null
> }[] | null
> ```

***

### messages.list

`whatsapp.messages.list`

Lists WhatsApp messages, filterable by identity, `conversation_id`, `thread_id`, read and blocked state, groups and date range.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.messages.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `is_read` | `boolean \| null` | No | — |
| `is_blocked` | `boolean \| null` | No | — |
| `thread_id` | `string \| null` | No | — |
| `include_groups` | `boolean` | No | — |
| `start_datetime` | `string \| null` | No | Filter created\_at >= this date/datetime. Bare date => whole day in tz. |
| `end_datetime` | `string \| null` | No | Filter created\_at \<= this date/datetime. Bare date => whole day inclusive. |
| `tz` | `string \| null` | No | IANA zone (e.g. America/New\_York) for zone-less values; default UTC. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_identity_id?: string | null,
>   conversation_id?: string | null,
>   logical_conversation_id?: string | null | null,
>   direction?: string | null,
>   local_number?: string | null | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null,
>   sender_access?: string | null,
>   is_group?: boolean | null,
>   agent_mentioned?: boolean | null,
>   mentions?: {
>     text?: string | null | null,
>     phone_number?: string | null | null,
>     is_agent?: boolean | null
>   }[] | null,
>   group_name?: string | null | null,
>   unresolved_participant_count?: number | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   reactions?: {
>     id?: string | null,
>     target_message_id?: string | null,
>     conversation_id?: string | null,
>     agent_identity_id?: string | null,
>     direction?: string | null,
>     remote_number?: string | null | null,
>     reaction?: string | string | null,
>     custom_emoji?: string | null | null,
>     emoji?: string | null,
>     status?: string | null,
>     revision?: number | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     removed_at?: string | null | null
>   }[] | null,
>   content?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null,
>     filename?: string | null,
>     content_type?: string | null,
>     size?: number | null | null,
>     status?: string | null,
>     url?: string | null | null
>   }[] | null,
>   status?: string | null,
>   delivery_state?: string | null | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null,
>     delivery_state?: string | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   source_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   status_observed_at?: string | null | null,
>   status_refresh_pending?: boolean | null
> }[]
> ```

***

### messages.send

`whatsapp.messages.send`

Sends a WhatsApp message from an identity to one E.164 number (`to`) or into `conversation_id`, with `text`, media, a reply target or a voice note. Usually allowed only after the person messaged first.

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

```ts theme={null}
await corsair.inkbox.api.whatsapp.messages.send({ agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', to: '+14155550123', text: 'Your order shipped today. Reply here with any questions.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `to` | `string \| null` | No | Phone number in E.164 format (e.g. '+15551234567'). |
| `conversation_id` | `string \| null` | No | — |
| `reply_to_message_id` | `string \| null` | No | — |
| `plain_reply_fallback` | `boolean` | No | Allow a plain reply only when the target is known before sending to lack native reply support. All currently supported WhatsApp targets support native replies, so this option does not bypass unavailable targets or quote evidence. Rejected or uncertain sends are never retried as plain messages. Ignored without reply\_to\_message\_id. |
| `text` | `string \| null` | No | — |
| `gif_playback` | `boolean` | No | Play an attached MP4 video as an animation. |
| `media_ids` | `string[]` | No | — |
| `staged_media` | `object[]` | No | — |
| `send_as_voice_note` | `boolean` | No | Speak text in the agent's hosted voice and send it as a native WhatsApp voice note instead of text. Text is required, is limited to 600 characters, and cannot be combined with media. |
| `fallback_to_text` | `boolean` | No | When a voice note can't be produced before the message is accepted, for example because the text is longer than 600 characters, send the text as an ordinary message instead. Set false to fail the request. Ignored unless send\_as\_voice\_note is true. |

> [accordion] staged\_media full type
>
> ```ts theme={null}
> {
>   handle: string,
>   content_hash: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `object \| null` | No | — |

> [accordion] message full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_identity_id?: string | null,
>   conversation_id?: string | null,
>   logical_conversation_id?: string | null | null,
>   direction?: string | null,
>   local_number?: string | null | null,
>   remote_number?: string | null | null,
>   sender_number?: string | null | null,
>   participants?: string[] | null,
>   sender_access?: string | null,
>   is_group?: boolean | null,
>   agent_mentioned?: boolean | null,
>   mentions?: {
>     text?: string | null | null,
>     phone_number?: string | null | null,
>     is_agent?: boolean | null
>   }[] | null,
>   group_name?: string | null | null,
>   unresolved_participant_count?: number | null,
>   reply_to_message_id?: string | null | null,
>   thread_id?: string | null | null,
>   thread_root_message_id?: string | null | null,
>   reactions?: {
>     id?: string | null,
>     target_message_id?: string | null,
>     conversation_id?: string | null,
>     agent_identity_id?: string | null,
>     direction?: string | null,
>     remote_number?: string | null | null,
>     reaction?: string | string | null,
>     custom_emoji?: string | null | null,
>     emoji?: string | null,
>     status?: string | null,
>     revision?: number | null,
>     created_at?: string | null,
>     updated_at?: string | null,
>     removed_at?: string | null | null
>   }[] | null,
>   content?: string | null | null,
>   media?: {
>     transcription?: {
>       status?: string | null,
>       text?: string | null | null,
>       error_code?: string | null | null
>     } | null | null,
>     id?: string | null,
>     filename?: string | null,
>     content_type?: string | null,
>     size?: number | null | null,
>     status?: string | null,
>     url?: string | null | null
>   }[] | null,
>   status?: string | null,
>   delivery_state?: string | null | null,
>   recipients?: {
>     remote_number?: string | null,
>     delivery_status?: string | null,
>     delivery_state?: string | null,
>     error_code?: string | null | null,
>     error_detail?: string | null | null,
>     sent_at?: string | null | null,
>     delivered_at?: string | null | null,
>     failed_at?: string | null | null
>   }[] | null,
>   is_read?: boolean | null,
>   is_blocked?: boolean | null,
>   error_code?: string | null | null,
>   error_detail?: string | null | null,
>   source_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   status_observed_at?: string | null | null,
>   status_refresh_pending?: boolean | null
> } | null
> ```

***

### numbers.assign

`whatsapp.numbers.assign`

Attaches a dedicated WhatsApp number (`account_id`) to an agent (`agent_identity_id`), or detaches it with null, given `expected_revision`. Requires an admin API key.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.whatsapp.numbers.assign({ account_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', agent_identity_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', expected_revision: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | Yes | — |
| `expected_revision` | `number` | Yes | — |
| `confirmed_imessage_number` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `number` | `string \| null` | No | — |
| `agent_identity_id` | `string \| null \| null` | No | — |
| `revision` | `number \| null` | No | — |
| `state` | `string \| null` | No | — |
| `binding_state` | `string \| null \| null` | No | — |
| `assignable` | `boolean \| null` | No | — |
| `unavailable_reason` | `string \| null \| null` | No | — |

***

### numbers.list

`whatsapp.numbers.list`

Lists the organization's dedicated WhatsApp numbers with the agent each is assigned to, 100 per page. Requires an admin API key.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `offset` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `numbers` | `object[] \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] numbers full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   agent_identity_id?: string | null | null,
>   revision?: number | null,
>   state?: string | null,
>   binding_state?: string | null | null,
>   assignable?: boolean | null,
>   unavailable_reason?: string | null | null
> }[] | null
> ```

***

### reactions.delete

`whatsapp.reactions.delete`

Removes a WhatsApp reaction the agent sent (`reaction_id`).

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

```ts theme={null}
await corsair.inkbox.api.whatsapp.reactions.delete({ reaction_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `reaction_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reaction` | `object \| null` | No | — |

> [accordion] reaction full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   target_message_id?: string | null,
>   conversation_id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   reaction?: string | string | null,
>   custom_emoji?: string | null | null,
>   emoji?: string | null,
>   status?: string | null,
>   revision?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   removed_at?: string | null | null
> } | null
> ```

***

### reactions.get

`whatsapp.reactions.get`

Returns one WhatsApp reaction by `reaction_id`.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.reactions.get({ reaction_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `reaction_id` | `string` | Yes | — |
| `agent_identity_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reaction` | `object \| null` | No | — |

> [accordion] reaction full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   target_message_id?: string | null,
>   conversation_id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   reaction?: string | string | null,
>   custom_emoji?: string | null | null,
>   emoji?: string | null,
>   status?: string | null,
>   revision?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   removed_at?: string | null | null
> } | null
> ```

***

### reactions.send

`whatsapp.reactions.send`

Sends an emoji reaction (`reaction` or `custom_emoji`) on a WhatsApp message a person sent (`message_id`).

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

```ts theme={null}
await corsair.inkbox.api.whatsapp.reactions.send({ message_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `idempotencyKey` | `string \| null` | No | Idempotency-Key header: a retry with the same key and body returns what this key already did instead of doing it again. Leave it out and the plugin sends a new random key. |
| `message_id` | `string` | Yes | — |
| `reaction` | `love \| like \| dislike \| laugh \| emphasize \| question \| eyes \| null` | No | — |
| `custom_emoji` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reaction` | `object \| null` | No | — |

> [accordion] reaction full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   target_message_id?: string | null,
>   conversation_id?: string | null,
>   agent_identity_id?: string | null,
>   direction?: string | null,
>   remote_number?: string | null | null,
>   reaction?: string | string | null,
>   custom_emoji?: string | null | null,
>   emoji?: string | null,
>   status?: string | null,
>   revision?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   removed_at?: string | null | null
> } | null
> ```

***

### router.get

`whatsapp.router.get`

Returns the organization's own WhatsApp router (number, revision, profile name, whether it accepts new connections), or null if it has none. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.router.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `router` | `object \| null` | No | — |

> [accordion] router full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   revision?: number | null,
>   state?: string | null,
>   profile_display_name?: string | null | null,
>   accepting_new_connections?: boolean | null
> } | null | null
> ```

***

### router.listConversations

`whatsapp.router.listConversations`

Lists conversations on the organization's own WhatsApp router, newest first. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.router.listConversations({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   remote_number?: string | null,
>   last_message_at?: string | null,
>   latest_text?: string | null,
>   message_count?: number | null
> }[] | null
> ```

***

### router.listMessages

`whatsapp.router.listMessages`

Lists messages exchanged with one person (`remote_number`) on the organization's WhatsApp router, newest first. Requires an admin API key.

**Risk:** `read`

```ts theme={null}
await corsair.inkbox.api.whatsapp.router.listMessages({ remote_number: '+14155550123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `remote_number` | `string` | Yes | Phone number in E.164 format (e.g. '+15551234567'). |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   direction?: string | null,
>   content?: string | null,
>   status?: string | null,
>   created_at?: string | null
> }[] | null
> ```

***

### router.update

`whatsapp.router.update`

Updates the organization's WhatsApp router `profile_display_name` or `accepting_new_connections`, given `expected_router_id` and `expected_revision`. Admin API key only.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.whatsapp.router.update({ expected_router_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7', expected_revision: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `expected_router_id` | `string` | Yes | — |
| `expected_revision` | `number` | Yes | — |
| `profile_display_name` | `string \| null` | No | — |
| `accepting_new_connections` | `boolean \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `router` | `object \| null` | No | — |

> [accordion] router full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   number?: string | null,
>   revision?: number | null,
>   state?: string | null,
>   profile_display_name?: string | null | null,
>   accepting_new_connections?: boolean | null
> } | null | null
> ```

***

### sendTyping

`whatsapp.sendTyping`

Shows a typing indicator to the person in a WhatsApp conversation (`conversation_id`); returns 409 where unsupported.

**Risk:** `write`

```ts theme={null}
await corsair.inkbox.api.whatsapp.sendTyping({ conversation_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_identity_id` | `string \| null` | No | — |
| `conversation_id` | `string` | Yes | — |

**Output:** `Record<string, string>`

***


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