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

# SendFox API reference

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

## Account

### me

`account.me`

The account the token belongs to: name, contact count and limit.

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.account.me({});
```

**Input:** *empty object*

GET /me

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `contacts_count` | `number \| null` | No | — |
| `contact_limit` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

## Automation Email Actions

### delete

`automationEmailActions.delete`

Remove an action from an automation email

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.automationEmailActions.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /automation-email-actions/\{id}

**Output**

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

***

## Automation Emails

### addAction

`automationEmails.addAction`

Add an action to an automation email

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.automationEmails.addAction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `event` | `send \| open \| click` | Yes | — |
| `action` | `add \| remove` | Yes | — |
| `contact_tag_id` | `number` | No | — |
| `list_id` | `number` | No | — |
| `link_url` | `string` | No | Click event only. Run for this link, as written in the email. Omit for any link. |
| `ends_automation` | `boolean` | No | — |

POST /automation-emails/\{id}/actions

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `automation_email_id` | `number \| null` | No | — |
| `event` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `contact_tag_id` | `number \| null \| null` | No | — |
| `list_id` | `number \| null \| null` | No | — |
| `link_url` | `string \| null \| null` | No | For a click action, the only link that runs it. Null means any link. |
| `ends_automation` | `boolean \| null` | No | Whether this also takes the contact out of the automation. |

***

### delete

`automationEmails.delete`

Remove an email from an automation

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.automationEmails.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /automation-emails/\{id}

**Output**

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

***

### update

`automationEmails.update`

Update an automation email

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.automationEmails.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `subject` | `string` | No | Can use personalization tags, such as `{{contact.first_name \| there}}`. |
| `preview_text` | `string \| null` | No | Inbox preview text |
| `html` | `string` | No | Can use personalization tags. SendFox adds the unsubscribe footer. Paragraphs are spaced on save the same way as when creating a campaign. |
| `from_name` | `string` | No | — |
| `from_email` | `string` | No | — |
| `reply_to_email` | `string \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `delay_hours` | `number` | No | — |
| `send_order` | `number` | No | — |

PATCH /automation-emails/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `type` | `string \| null` | No | — |
| `automation_id` | `number \| null` | No | — |
| `campaign_id` | `number \| null \| null` | No | The step's email. Null for a condition. |
| `parent_item_id` | `number \| null \| null` | No | The condition this step's path belongs to. Null for a step in the main flow. |
| `branch` | `string \| null \| null` | No | — |
| `delay_hours` | `number \| null` | No | Hours to wait before this step. For a condition, the wait before the contact is checked. |
| `send_order` | `number \| null` | No | — |
| `condition_type` | `string \| null \| null` | No | What a condition checks. "Previous" is the nearest email before the condition. |
| `condition_list_id` | `number \| null \| null` | No | — |
| `condition_contact_tag_id` | `number \| null \| null` | No | — |
| `condition_email_link_id` | `number \| null \| null` | No | For clicked\_previous, the link that must be clicked. Null means any link. |
| `yes_path_ends` | `boolean \| null` | No | Whether contacts leave the automation at the end of the Yes path, instead of continuing after the condition. |
| `no_path_ends` | `boolean \| null` | No | Whether contacts leave the automation at the end of the No path, instead of continuing after the condition. |
| `campaign` | `object \| null` | No | — |
| `actions` | `object[] \| null` | No | Returned by GET /automations/\{id}. What runs when this email is sent, opened or clicked. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] campaign full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   title?: string | null,
>   subject?: string | null,
>   preview_text?: string | null | null,
>   html?: string | null,
>   from_name?: string | null,
>   from_email?: string | null,
>   reply_to_email?: string | null | null,
>   scheduled_at?: string | null | null,
>   sent_at?: string | null | null,
>   timezone?: string | null,
>   lists?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null,
>   is_web_gated?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   automation_email_id?: number | null,
>   event?: string | null,
>   action?: string | null,
>   contact_tag_id?: number | null | null,
>   list_id?: number | null | null,
>   link_url?: string | null | null,
>   ends_automation?: boolean | null
> }[] | null
> ```

***

## Automations

### addEmail

`automations.addEmail`

Add an email to an automation

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.automations.addEmail({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `subject` | `string` | Yes | Can use personalization tags, such as `{{contact.first_name \| there}}`. |
| `preview_text` | `string \| null` | No | Inbox preview text |
| `html` | `string` | Yes | Can use personalization tags. SendFox adds the unsubscribe footer. Paragraphs are spaced on save the same way as when creating a campaign. |
| `from_name` | `string` | No | Required unless the account has saved a default sender in Account Settings. |
| `from_email` | `string` | No | Required unless the account has saved a default sender in Account Settings. |
| `reply_to_email` | `string \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `delay_hours` | `number` | No | Hours to wait before sending (default 24, first email defaults to 0) |

POST /automations/\{id}/emails

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `type` | `string \| null` | No | — |
| `automation_id` | `number \| null` | No | — |
| `campaign_id` | `number \| null \| null` | No | The step's email. Null for a condition. |
| `parent_item_id` | `number \| null \| null` | No | The condition this step's path belongs to. Null for a step in the main flow. |
| `branch` | `string \| null \| null` | No | — |
| `delay_hours` | `number \| null` | No | Hours to wait before this step. For a condition, the wait before the contact is checked. |
| `send_order` | `number \| null` | No | — |
| `condition_type` | `string \| null \| null` | No | What a condition checks. "Previous" is the nearest email before the condition. |
| `condition_list_id` | `number \| null \| null` | No | — |
| `condition_contact_tag_id` | `number \| null \| null` | No | — |
| `condition_email_link_id` | `number \| null \| null` | No | For clicked\_previous, the link that must be clicked. Null means any link. |
| `yes_path_ends` | `boolean \| null` | No | Whether contacts leave the automation at the end of the Yes path, instead of continuing after the condition. |
| `no_path_ends` | `boolean \| null` | No | Whether contacts leave the automation at the end of the No path, instead of continuing after the condition. |
| `campaign` | `object \| null` | No | — |
| `actions` | `object[] \| null` | No | Returned by GET /automations/\{id}. What runs when this email is sent, opened or clicked. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] campaign full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   title?: string | null,
>   subject?: string | null,
>   preview_text?: string | null | null,
>   html?: string | null,
>   from_name?: string | null,
>   from_email?: string | null,
>   reply_to_email?: string | null | null,
>   scheduled_at?: string | null | null,
>   sent_at?: string | null | null,
>   timezone?: string | null,
>   lists?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null,
>   is_web_gated?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   automation_email_id?: number | null,
>   event?: string | null,
>   action?: string | null,
>   contact_tag_id?: number | null | null,
>   list_id?: number | null | null,
>   link_url?: string | null | null,
>   ends_automation?: boolean | null
> }[] | null
> ```

***

### create

`automations.create`

Create an automation

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.automations.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | Yes | — |
| `trigger_type` | `apply_list \| apply_tag \| open_campaign \| click_campaign` | No | — |
| `trigger_list_id` | `number` | No | Required when trigger\_type is apply\_list |
| `trigger_contact_tag_id` | `number` | No | Required when trigger\_type is apply\_tag |
| `trigger_campaign_id` | `number` | No | Required when trigger\_type is open\_campaign or click\_campaign. Any campaign you own, sent or not yet sent, including an email inside another automation. |
| `active` | `boolean` | No | — |

POST /automations

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `active` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `automation_triggers` | `object[] \| null` | No | — |
| `automation_items` | `object[] \| null` | No | — |

> [accordion] automation\_triggers full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   automation_id?: number | null,
>   type?: string | null,
>   list_id?: number | null | null,
>   contact_tag_id?: number | null | null,
>   campaign_id?: number | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

> [accordion] automation\_items full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   type?: string | null,
>   automation_id?: number | null,
>   campaign_id?: number | null | null,
>   parent_item_id?: number | null | null,
>   branch?: string | null | null,
>   delay_hours?: number | null,
>   send_order?: number | null,
>   condition_type?: string | null | null,
>   condition_list_id?: number | null | null,
>   condition_contact_tag_id?: number | null | null,
>   condition_email_link_id?: number | null | null,
>   yes_path_ends?: boolean | null,
>   no_path_ends?: boolean | null,
>   campaign?: {
>     id?: number | null,
>     title?: string | null,
>     subject?: string | null,
>     preview_text?: string | null | null,
>     html?: string | null,
>     from_name?: string | null,
>     from_email?: string | null,
>     reply_to_email?: string | null | null,
>     scheduled_at?: string | null | null,
>     sent_at?: string | null | null,
>     timezone?: string | null,
>     lists?: {
>       id?: number | null,
>       name?: string | null
>     }[] | null,
>     is_web_gated?: boolean | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null,
>   actions?: {
>     id?: number | null,
>     automation_email_id?: number | null,
>     event?: string | null,
>     action?: string | null,
>     contact_tag_id?: number | null | null,
>     list_id?: number | null | null,
>     link_url?: string | null | null,
>     ends_automation?: boolean | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### delete

`automations.delete`

Delete an automation

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.automations.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /automations/\{id}

**Output**

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

***

### get

`automations.get`

Get a specific automation

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.automations.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /automations/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `active` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `automation_triggers` | `object[] \| null` | No | — |
| `automation_items` | `object[] \| null` | No | — |

> [accordion] automation\_triggers full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   automation_id?: number | null,
>   type?: string | null,
>   list_id?: number | null | null,
>   contact_tag_id?: number | null | null,
>   campaign_id?: number | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

> [accordion] automation\_items full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   type?: string | null,
>   automation_id?: number | null,
>   campaign_id?: number | null | null,
>   parent_item_id?: number | null | null,
>   branch?: string | null | null,
>   delay_hours?: number | null,
>   send_order?: number | null,
>   condition_type?: string | null | null,
>   condition_list_id?: number | null | null,
>   condition_contact_tag_id?: number | null | null,
>   condition_email_link_id?: number | null | null,
>   yes_path_ends?: boolean | null,
>   no_path_ends?: boolean | null,
>   campaign?: {
>     id?: number | null,
>     title?: string | null,
>     subject?: string | null,
>     preview_text?: string | null | null,
>     html?: string | null,
>     from_name?: string | null,
>     from_email?: string | null,
>     reply_to_email?: string | null | null,
>     scheduled_at?: string | null | null,
>     sent_at?: string | null | null,
>     timezone?: string | null,
>     lists?: {
>       id?: number | null,
>       name?: string | null
>     }[] | null,
>     is_web_gated?: boolean | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null,
>   actions?: {
>     id?: number | null,
>     automation_email_id?: number | null,
>     event?: string | null,
>     action?: string | null,
>     contact_tag_id?: number | null | null,
>     list_id?: number | null | null,
>     link_url?: string | null | null,
>     ends_automation?: boolean | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### list

`automations.list`

List automations

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.automations.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |

GET /automations

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   user_id?: number | null,
>   title?: string | null,
>   active?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   automation_triggers?: {
>     id?: number | null,
>     automation_id?: number | null,
>     type?: string | null,
>     list_id?: number | null | null,
>     contact_tag_id?: number | null | null,
>     campaign_id?: number | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }[] | null,
>   automation_items?: {
>     id?: number | null,
>     type?: string | null,
>     automation_id?: number | null,
>     campaign_id?: number | null | null,
>     parent_item_id?: number | null | null,
>     branch?: string | null | null,
>     delay_hours?: number | null,
>     send_order?: number | null,
>     condition_type?: string | null | null,
>     condition_list_id?: number | null | null,
>     condition_contact_tag_id?: number | null | null,
>     condition_email_link_id?: number | null | null,
>     yes_path_ends?: boolean | null,
>     no_path_ends?: boolean | null,
>     campaign?: {
>       id?: number | null,
>       title?: string | null,
>       subject?: string | null,
>       preview_text?: string | null | null,
>       html?: string | null,
>       from_name?: string | null,
>       from_email?: string | null,
>       reply_to_email?: string | null | null,
>       scheduled_at?: string | null | null,
>       sent_at?: string | null | null,
>       timezone?: string | null,
>       lists?: {
>         id?: number | null,
>         name?: string | null
>       }[] | null,
>       is_web_gated?: boolean | null,
>       created_at?: string | null,
>       updated_at?: string | null
>     } | null,
>     actions?: {
>       id?: number | null,
>       automation_email_id?: number | null,
>       event?: string | null,
>       action?: string | null,
>       contact_tag_id?: number | null | null,
>       list_id?: number | null | null,
>       link_url?: string | null | null,
>       ends_automation?: boolean | null
>     }[] | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }[] | null
> }[] | null
> ```

***

### update

`automations.update`

Update an automation

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.automations.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `title` | `string` | No | — |
| `active` | `boolean` | No | — |
| `trigger_type` | `apply_list \| apply_tag \| open_campaign \| click_campaign` | No | — |
| `trigger_list_id` | `number` | No | Required when trigger\_type is apply\_list |
| `trigger_contact_tag_id` | `number` | No | Required when trigger\_type is apply\_tag |
| `trigger_campaign_id` | `number` | No | Required when trigger\_type is open\_campaign or click\_campaign |

PATCH /automations/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `active` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `automation_triggers` | `object[] \| null` | No | — |
| `automation_items` | `object[] \| null` | No | — |

> [accordion] automation\_triggers full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   automation_id?: number | null,
>   type?: string | null,
>   list_id?: number | null | null,
>   contact_tag_id?: number | null | null,
>   campaign_id?: number | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

> [accordion] automation\_items full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   type?: string | null,
>   automation_id?: number | null,
>   campaign_id?: number | null | null,
>   parent_item_id?: number | null | null,
>   branch?: string | null | null,
>   delay_hours?: number | null,
>   send_order?: number | null,
>   condition_type?: string | null | null,
>   condition_list_id?: number | null | null,
>   condition_contact_tag_id?: number | null | null,
>   condition_email_link_id?: number | null | null,
>   yes_path_ends?: boolean | null,
>   no_path_ends?: boolean | null,
>   campaign?: {
>     id?: number | null,
>     title?: string | null,
>     subject?: string | null,
>     preview_text?: string | null | null,
>     html?: string | null,
>     from_name?: string | null,
>     from_email?: string | null,
>     reply_to_email?: string | null | null,
>     scheduled_at?: string | null | null,
>     sent_at?: string | null | null,
>     timezone?: string | null,
>     lists?: {
>       id?: number | null,
>       name?: string | null
>     }[] | null,
>     is_web_gated?: boolean | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   } | null,
>   actions?: {
>     id?: number | null,
>     automation_email_id?: number | null,
>     event?: string | null,
>     action?: string | null,
>     contact_tag_id?: number | null | null,
>     list_id?: number | null | null,
>     link_url?: string | null | null,
>     ends_automation?: boolean | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

## Campaigns

### batchStats

`campaigns.batchStats`

Get statistics for multiple campaigns

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaigns.batchStats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `campaign_ids[]` | `number[]` | Yes | Repeat campaign\_ids\[] for each campaign ID. |

GET /campaigns/stats

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> (
>   {
>     link_stats?: {
>       url?: string | null,
>       clicks?: number | null
>     }[] | null,
>     sent_count?: number | null,
>     unique_open_count?: number | null,
>     unique_click_count?: number | null,
>     unsubscribe_count?: number | null,
>     bounce_count?: number | null,
>     spam_count?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null,
>     spam_rate?: number | null
>   }& {
>     id?: number | null
>   }
> )[] | null
> ```

***

### create

`campaigns.create`

Create a campaign. Without scheduled\_at it stays a draft; with scheduled\_at it is scheduled and emails its lists and tags at that time.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.campaigns.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | Yes | — |
| `subject` | `string` | Yes | — |
| `preview_text` | `string \| null` | No | Inbox preview snippet shown beneath the subject line. Optional. |
| `html` | `string` | Yes | Email body HTML content. Unless the campaign uses the Code Your Own layout, tags outside the editor's set are removed on save, along with event-handler attributes (such as onclick) and javascript: links. Paragraphs, images and lists have no margin in the email. If the body has no blank paragraph ... |
| `from_name` | `string` | No | Required unless the account has saved a default sender in Account Settings. Omitted, it uses that default's name, else the last name sent from, else the account name. |
| `from_email` | `string` | No | Required unless the account has saved a default From email in Account Settings, which is used when this is omitted. |
| `reply_to_email` | `string \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string` | No | Schedule send time (omit for draft). Must include at least one list. |
| `lists` | `number[]` | No | Array of list IDs to send to |
| `excluded_lists` | `number[]` | No | List IDs whose contacts should be excluded from the send. Exclusion wins over inclusion. |
| `to_contact_tags` | `number[]` | No | Tag IDs whose contacts should receive the campaign. Can be combined with lists. |
| `excluded_contact_tags` | `number[]` | No | Tag IDs whose contacts should be excluded from the send. Exclusion wins over inclusion. |
| `web_publish` | `boolean` | No | Publish the email to the web on your primary Smart Page once it sends. Requires a Smart Page. Omit it to list the email on every Smart Page whose Newsletters tab is on; send false to keep it off the web. |
| `web_gate` | `boolean` | No | On a published email, ask new readers for their email address to read past the opening. The account-wide signup requirement in Settings overrides this choice when enabled, including when false is sent or this field is omitted. |

POST /campaigns

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `preview_text` | `string \| null \| null` | No | Inbox preview snippet shown beneath the subject line in most email clients. |
| `html` | `string \| null` | No | — |
| `from_name` | `string \| null` | No | — |
| `from_email` | `string \| null` | No | — |
| `reply_to_email` | `string \| null \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `lists` | `object[] \| null` | No | The lists this campaign is addressed to, including any archived since, which `GET /lists` no longer returns. `GET /campaigns` returns only `id` and `name`, so compare against `GET /lists` to spot an archived one. |
| `is_web_gated` | `boolean \| null` | No | The saved per-issue signup requirement. Applies only to published web issues. If the account-wide signup requirement is enabled in Settings, the public page requires signup even when this field is false. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

### delete

`campaigns.delete`

Delete a draft campaign

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.campaigns.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /campaigns/\{id}

**Output**

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

***

### engagement

`campaigns.engagement`

List the contacts behind a campaign's engagement

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaigns.engagement({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `type` | `openers \| clickers \| non_openers \| bounced \| unsubscribed` | Yes | Which engagement group to list |
| `per_page` | `number` | No | Records per page |
| `page` | `number` | No | Page number, from 1. |

GET /campaigns/\{id}/engagement

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   contact_id?: number | null,
>   email?: string | null,
>   first_name?: string | null | null,
>   last_name?: string | null | null,
>   sent_at?: string | null | null,
>   opened_at?: string | null | null,
>   clicked_at?: string | null | null,
>   bounced_at?: string | null | null,
>   unsubscribed_at?: string | null | null
> }[] | null
> ```

***

### get

`campaigns.get`

Get a specific campaign

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaigns.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /campaigns/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `preview_text` | `string \| null \| null` | No | Inbox preview snippet shown beneath the subject line in most email clients. |
| `html` | `string \| null` | No | — |
| `from_name` | `string \| null` | No | — |
| `from_email` | `string \| null` | No | — |
| `reply_to_email` | `string \| null \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `lists` | `object[] \| null` | No | The lists this campaign is addressed to, including any archived since, which `GET /lists` no longer returns. `GET /campaigns` returns only `id` and `name`, so compare against `GET /lists` to spot an archived one. |
| `is_web_gated` | `boolean \| null` | No | The saved per-issue signup requirement. Applies only to published web issues. If the account-wide signup requirement is enabled in Settings, the public page requires signup even when this field is false. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

### list

`campaigns.list`

List campaigns

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaigns.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `number` | No | Only campaigns addressed to this list, archived lists included. An ID that isn't one of your lists returns an empty page. |
| `page` | `number` | No | Page number, from 1. |

GET /campaigns

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   title?: string | null,
>   subject?: string | null,
>   preview_text?: string | null | null,
>   html?: string | null,
>   from_name?: string | null,
>   from_email?: string | null,
>   reply_to_email?: string | null | null,
>   scheduled_at?: string | null | null,
>   sent_at?: string | null | null,
>   timezone?: string | null,
>   lists?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null,
>   is_web_gated?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### resend

`campaigns.resend`

Clone a sent campaign for part of its audience (non-openers, openers or clickers). Without scheduled\_at the clone stays a draft; with it, SendFox schedules the clone to send at that time.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.campaigns.resend({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `audience` | `non_openers \| openers \| clickers` | Yes | — |
| `subject` | `string` | No | Optional new subject line; defaults to the original's |
| `title` | `string` | No | Optional internal name; defaults to "Resend: \<original title>" |
| `scheduled_at` | `string` | No | Optional send time; omit to leave the resend as a draft |

POST /campaigns/\{id}/resend

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `preview_text` | `string \| null \| null` | No | Inbox preview snippet shown beneath the subject line in most email clients. |
| `html` | `string \| null` | No | — |
| `from_name` | `string \| null` | No | — |
| `from_email` | `string \| null` | No | — |
| `reply_to_email` | `string \| null \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `lists` | `object[] \| null` | No | The lists this campaign is addressed to, including any archived since, which `GET /lists` no longer returns. `GET /campaigns` returns only `id` and `name`, so compare against `GET /lists` to spot an archived one. |
| `is_web_gated` | `boolean \| null` | No | The saved per-issue signup requirement. Applies only to published web issues. If the account-wide signup requirement is enabled in Settings, the public page requires signup even when this field is false. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

### send

`campaigns.send`

Send a campaign now to its lists and tags. Emails real subscribers and cannot be undone.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.campaigns.send({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

POST /campaigns/\{id}/send

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `preview_text` | `string \| null \| null` | No | Inbox preview snippet shown beneath the subject line in most email clients. |
| `html` | `string \| null` | No | — |
| `from_name` | `string \| null` | No | — |
| `from_email` | `string \| null` | No | — |
| `reply_to_email` | `string \| null \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `lists` | `object[] \| null` | No | The lists this campaign is addressed to, including any archived since, which `GET /lists` no longer returns. `GET /campaigns` returns only `id` and `name`, so compare against `GET /lists` to spot an archived one. |
| `is_web_gated` | `boolean \| null` | No | The saved per-issue signup requirement. Applies only to published web issues. If the account-wide signup requirement is enabled in Settings, the public page requires signup even when this field is false. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

### sendTest

`campaigns.sendTest`

Send a test of a campaign

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.campaigns.sendTest({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `emails` | `string[]` | Yes | Addresses to deliver the test to. Trimmed and de-duplicated. |

POST /campaigns/\{id}/send-test

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `sent` | `boolean \| null` | No | — |
| `campaign_id` | `number \| null` | No | — |
| `sent_to` | `string[] \| null` | No | The addresses the test actually went to |
| `notice` | `string \| null \| null` | No | Set when the test was narrowed to the account's own address |

***

### stats

`campaigns.stats`

Get campaign performance statistics

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaigns.stats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `include_link_stats` | `boolean` | No | When true, include the link\_stats breakdown in the response |
| `link_limit` | `number` | No | How many links to return in link\_stats, most-clicked first. Ignored unless include\_link\_stats is true. |

GET /campaigns/\{id}/stats

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `link_stats` | `object[] \| null` | No | The campaign's links ranked by click count, most-clicked first. Present only when include\_link\_stats is true — it is the one part of this payload that queries rather than reading a stored counter. |
| `sent_count` | `number \| null` | No | — |
| `unique_open_count` | `number \| null` | No | — |
| `unique_click_count` | `number \| null` | No | — |
| `unsubscribe_count` | `number \| null` | No | — |
| `bounce_count` | `number \| null` | No | — |
| `spam_count` | `number \| null` | No | — |
| `open_rate` | `number \| null` | No | — |
| `click_rate` | `number \| null` | No | — |
| `unsubscribe_rate` | `number \| null` | No | — |
| `bounce_rate` | `number \| null` | No | — |
| `spam_rate` | `number \| null` | No | — |

> [accordion] link\_stats full type
>
> ```ts theme={null}
> {
>   url?: string | null,
>   clicks?: number | null
> }[] | null
> ```

***

### update

`campaigns.update`

Update a draft campaign. Setting scheduled\_at schedules it to email its lists and tags.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.campaigns.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `title` | `string` | No | — |
| `subject` | `string` | No | — |
| `preview_text` | `string \| null` | No | Inbox preview snippet. Pass null to clear. |
| `html` | `string` | No | Email body HTML content. Filtered and spaced on save the same way as when creating a campaign, unless it is the body the campaign already has. |
| `from_name` | `string` | No | — |
| `from_email` | `string` | No | — |
| `reply_to_email` | `string \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string \| null` | No | Set to null to unschedule, or a datetime to schedule |
| `lists` | `number[]` | No | Replaces all list assignments |
| `excluded_lists` | `number[]` | No | Replaces the excluded lists (contacts in these lists are removed from the send). |
| `to_contact_tags` | `number[]` | No | Replaces the included tag audience (contacts carrying these tags receive the campaign). |
| `excluded_contact_tags` | `number[]` | No | Replaces the excluded tag audience (contacts carrying these tags are removed from the send). |

PATCH /campaigns/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `preview_text` | `string \| null \| null` | No | Inbox preview snippet shown beneath the subject line in most email clients. |
| `html` | `string \| null` | No | — |
| `from_name` | `string \| null` | No | — |
| `from_email` | `string \| null` | No | — |
| `reply_to_email` | `string \| null \| null` | No | Where replies go. Empty uses the account's default reply-to, then `from_email`. |
| `scheduled_at` | `string \| null \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `lists` | `object[] \| null` | No | The lists this campaign is addressed to, including any archived since, which `GET /lists` no longer returns. `GET /campaigns` returns only `id` and `name`, so compare against `GET /lists` to spot an archived one. |
| `is_web_gated` | `boolean \| null` | No | The saved per-issue signup requirement. Applies only to published web issues. If the account-wide signup requirement is enabled in Settings, the public page requires signup even when this field is false. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

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

***

## Campaign Sections

### get

`campaignSections.get`

Get a saved campaign section

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaignSections.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /campaign-sections/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `html` | `string \| null \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |

***

### list

`campaignSections.list`

List saved campaign sections

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaignSections.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | — |
| `q` | `string` | No | Filter by name using the existing library search (SQL LIKE wildcards are supported). |

GET /campaign-sections

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `current_page` | `number \| null` | No | — |
| `per_page` | `number \| null` | No | — |
| `total` | `number \| null` | No | — |
| `last_page` | `number \| null` | No | — |
| `next_page_url` | `string \| null \| null` | No | — |
| `prev_page_url` | `string \| null \| null` | No | — |

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

***

## Campaign Templates

### get

`campaignTemplates.get`

Get a saved campaign template

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaignTemplates.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /campaign-templates/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `html` | `string \| null \| null` | No | — |
| `created_at` | `string \| null \| null` | No | — |
| `updated_at` | `string \| null \| null` | No | — |
| `subject` | `string \| null \| null` | No | — |
| `preview_text` | `string \| null \| null` | No | — |
| `campaign_layout_id` | `string \| null \| null` | No | — |

***

### list

`campaignTemplates.list`

List saved campaign templates

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.campaignTemplates.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | — |
| `q` | `string` | No | Filter by name using the existing library search (SQL LIKE wildcards are supported). |

GET /campaign-templates

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `current_page` | `number \| null` | No | — |
| `per_page` | `number \| null` | No | — |
| `total` | `number \| null` | No | — |
| `last_page` | `number \| null` | No | — |
| `next_page_url` | `string \| null \| null` | No | — |
| `prev_page_url` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   html?: string | null | null,
>   created_at?: string | null | null,
>   updated_at?: string | null | null,
>   subject?: string | null | null,
>   preview_text?: string | null | null,
>   campaign_layout_id?: string | null | null
> }[] | null
> ```

***

## Contacts

### activity

`contacts.activity`

Get email activity for a contact

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contacts.activity({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /contacts/\{id}/activity

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact` | `object \| null` | No | — |
| `deliverables` | `object \| null` | No | — |

> [accordion] contact full type
>
> ```ts theme={null}
> {
>   last_sent_at?: string | null | null,
>   last_opened_at?: string | null | null,
>   last_clicked_at?: string | null | null,
>   unsubscribed_at?: string | null | null,
>   bounced_at?: string | null | null
> } | null
> ```

> [accordion] deliverables full type
>
> ```ts theme={null}
> {
>   data?: {
>     campaign_title?: string | null,
>     campaign_id?: number | null,
>     sent_at?: string | null | null,
>     opened_at?: string | null | null,
>     clicked_at?: string | null | null,
>     bounced_at?: string | null | null,
>     unsubscribed_at?: string | null | null,
>     spam_at?: string | null | null
>   }[] | null
> } | null
> ```

***

### addTag

`contacts.addTag`

Attach a tag to a contact

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contacts.addTag({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `number` | Yes | — |
| `tag_id` | `number` | Yes | — |

POST /contacts/\{contact\_id}/tags/\{tag\_id}

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   user_id?: number | null,
>   name?: string | null,
>   color?: string | null,
>   contacts_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### batchImport

`contacts.batchImport`

Batch import contacts

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contacts.batchImport({});
```

**Input**

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

POST /contacts/batch

> [accordion] contacts full type
>
> ```ts theme={null}
> {
>   email: string,
>   first_name?: string,
>   last_name?: string,
>   lists?: number[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `created` | `number \| null` | No | — |
| `updated` | `number \| null` | No | — |

***

### bulkAction

`contacts.bulkAction`

Apply or remove a tag, or add to or remove from a list, for every contact matching a filter (queued). dry\_run: true only counts the matches. Bulk writes cannot be undone: removing a tag again also strips it from contacts that had it before.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.contacts.bulkAction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `action` | `apply_tag \| remove_tag \| add_to_list \| remove_from_list` | Yes | — |
| `target_id` | `number` | Yes | The tag id (apply\_tag/remove\_tag) or list id (add\_to\_list/remove\_from\_list) |
| `dry_run` | `boolean` | No | When true, only count the matches — nothing is modified |
| `filter` | `object` | No | An engagement filter over the account's contacts. Every condition is AND-ed. Omitting the object entirely means "all contacts". |

POST /contacts/bulk-actions

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   status?: active | engaged | inactive | new | unconfirmed | unsubscribed | bounced | bounce_paused | invalid,
>   last_opened_after?: string,
>   last_opened_before?: string,
>   last_clicked_after?: string,
>   last_clicked_before?: string,
>   last_sent_after?: string,
>   last_sent_before?: string,
>   created_after?: string,
>   created_before?: string,
>   never_opened?: boolean,
>   never_clicked?: boolean,
>   never_sent?: boolean,
>   in_list_ids?: number[],
>   not_in_list_ids?: number[],
>   tag_ids?: number[],
>   not_tag_ids?: number[],
>   opened_campaign_id?: number,
>   not_opened_campaign_id?: number,
>   clicked_campaign_id?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `target_id` | `number \| null` | No | — |
| `dry_run` | `boolean \| null` | No | — |
| `filter` | `string \| null` | No | Human-readable rendering of the filter that was applied |
| `matched_count` | `number \| null \| null` | No | Number of contacts the filter matched; null until counted |
| `processed_count` | `number \| null` | No | — |
| `error` | `string \| null \| null` | No | — |
| `started_at` | `string \| null \| null` | No | — |
| `completed_at` | `string \| null \| null` | No | — |

***

### create

`contacts.create`

Add a contact, or update the one with that email. Never resubscribes anyone unless resubscribe is true, which emails them a confirmation.

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contacts.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | — |
| `first_name` | `string` | No | — |
| `last_name` | `string` | No | — |
| `ip_address` | `string` | No | — |
| `lists` | `number[]` | No | Array of list IDs to add the contact to |
| `tags` | `number[]` | No | Legacy alias for `lists`. These are list IDs, not contact tag IDs. Use `contact_tags` to tag a contact. |
| `contact_tags` | `number[]` | No | IDs of contact tags (see `/contact-tags`) to add, up to 100. Applies to existing and unsubscribed contacts too; a tag the contact already has is left alone. An ID the account doesn't own returns 400 and nothing is written. |
| `contact_fields` | `object[]` | No | — |
| `resubscribe` | `boolean` | No | Set only when this person just asked to rejoin, such as on your own signup form. Never set it on a sync or import. If they unsubscribed from your account or from one of the given lists, they get a consent email and stay unsubscribed until they confirm it. Confirming covers your account-wide opt-o... |

POST /contacts

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

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   email?: string | null,
>   first_name?: string | null,
>   last_name?: string | null,
>   ip_address?: string | null,
>   unsubscribed_at?: string | null | null,
>   bounced_at?: string | null | null,
>   bounce_paused_at?: string | null | null,
>   bounce_paused_until?: string | null | null,
>   invalid_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }& {
>   created?: boolean | null,
>   subscription_status?: string | null,
>   resubscribe_confirmation_sent?: boolean | null,
>   resubscribe_confirmation_reason?: string | null | null
> }
> ```

***

### delete

`contacts.delete`

Delete a contact

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.contacts.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /contacts/\{id}

**Output**

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

***

### get

`contacts.get`

Get a specific contact

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contacts.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /contacts/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `email` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `ip_address` | `string \| null` | No | — |
| `unsubscribed_at` | `string \| null \| null` | No | — |
| `bounced_at` | `string \| null \| null` | No | When this address hard bounced. A hard bounce also sets unsubscribed\_at. If unsubscribed\_at is null, or far from this date, the bounce isn't what's stopping their email; they were resubscribed or opted out separately. |
| `bounce_paused_at` | `string \| null \| null` | No | When this contact was last paused for repeated bounces. Can remain set after the pause has ended; read bounce\_paused\_until to tell. |
| `bounce_paused_until` | `string \| null \| null` | No | When the current repeated-bounce pause ends. Null if the contact isn't paused, or has since unsubscribed or become invalid, since no retry is coming. |
| `invalid_at` | `string \| null \| null` | No | When this address was found to be invalid. It isn't mailed while this is set. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### getBulkAction

`contacts.getBulkAction`

Check the progress of a bulk contact action

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contacts.getBulkAction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /contacts/bulk-actions/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `action` | `string \| null` | No | — |
| `target_id` | `number \| null` | No | — |
| `dry_run` | `boolean \| null` | No | — |
| `filter` | `string \| null` | No | Human-readable rendering of the filter that was applied |
| `matched_count` | `number \| null \| null` | No | Number of contacts the filter matched; null until counted |
| `processed_count` | `number \| null` | No | — |
| `error` | `string \| null \| null` | No | — |
| `started_at` | `string \| null \| null` | No | — |
| `completed_at` | `string \| null \| null` | No | — |

***

### list

`contacts.list`

List contacts with their lists, filtered by search text, email, status, engagement dates, lists or tags; count\_only returns just the count.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | No | Search query for filtering contacts |
| `unsubscribed` | `boolean` | No | Filter unsubscribed contacts |
| `email` | `string` | No | Filter by specific email |
| `per_page` | `number` | No | Contacts per page |
| `count_only` | `boolean` | No | Return only the number of matching contacts, with no contact records |
| `filter[status]` | `active \| engaged \| inactive \| new \| unconfirmed \| unsubscribed \| bounced \| bounce_paused \| invalid` | No | Engagement status |
| `filter[last_opened_after]` | `string` | No | Contacts whose most recent open is on or after this date |
| `filter[last_opened_before]` | `string` | No | Contacts whose most recent open is before this date. Excludes contacts who never opened — use filter\[never\_opened] for those. |
| `filter[last_clicked_after]` | `string` | No | Contacts whose most recent click is on or after this date |
| `filter[last_clicked_before]` | `string` | No | Contacts whose most recent click is before this date |
| `filter[last_sent_after]` | `string` | No | Contacts last sent to on or after this date |
| `filter[last_sent_before]` | `string` | No | Contacts last sent to before this date |
| `filter[created_after]` | `string` | No | Contacts created on or after this date |
| `filter[created_before]` | `string` | No | Contacts created before this date |
| `filter[never_opened]` | `boolean` | No | Only contacts who have never opened an email |
| `filter[never_clicked]` | `boolean` | No | Only contacts who have never clicked a link |
| `filter[never_sent]` | `boolean` | No | Only contacts who have never been sent an email |
| `filter[in_list_ids]` | `number[]` | No | Only contacts still subscribed to any of these lists. Members who unsubscribed from the list are not matched, so results may be smaller than before per-list unsubscribe shipped. |
| `filter[not_in_list_ids]` | `number[]` | No | Exclude contacts who are members of any of these lists, whether or not they unsubscribed from it. |
| `filter[tag_ids]` | `number[]` | No | Only contacts still subscribed to any of these tags. Somebody who opted out of the tag keeps it but is not matched. Same rule as filter\[in\_list\_ids]; see the tag\_ids note in the bulk-action filter schema. |
| `filter[not_tag_ids]` | `number[]` | No | Exclude contacts carrying any of these tags |
| `page` | `number` | No | Page number, from 1. |

GET /contacts

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   data?: (
>     {
>       id?: number | null,
>       email?: string | null,
>       first_name?: string | null,
>       last_name?: string | null,
>       ip_address?: string | null,
>       unsubscribed_at?: string | null | null,
>       bounced_at?: string | null | null,
>       bounce_paused_at?: string | null | null,
>       bounce_paused_until?: string | null | null,
>       invalid_at?: string | null | null,
>       created_at?: string | null,
>       updated_at?: string | null
>     }& {
>       lists?: (
>         {
>           id?: number | null,
>           name?: string | null,
>           user_id?: number | null,
>           subscribed_contacts_count?: number | null,
>           unsubscribed_contacts_count?: number | null,
>           public_description?: string | null | null,
>           subscriber_description?: string | null | null,
>           average_email_open_percent?: number | null,
>           average_email_click_percent?: number | null,
>           created_at?: string | null,
>           updated_at?: string | null
>         }& {
>           list_unsubscribed_at?: string | null | null
>         }
>       )[] | null
>     }
>   )[] | null,
>   current_page?: number | null,
>   total?: number | null,
>   per_page?: number | null
> } | {
>   count?: number | null,
>   filter?: string | null
> }
> ```

***

### removeTag

`contacts.removeTag`

Remove a tag from a contact

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contacts.removeTag({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contact_id` | `number` | Yes | — |
| `tag_id` | `number` | Yes | — |

DELETE /contacts/\{contact\_id}/tags/\{tag\_id}

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   user_id?: number | null,
>   name?: string | null,
>   color?: string | null,
>   contacts_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### tags

`contacts.tags`

List a contact's tags

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contacts.tags({});
```

**Input**

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

GET /contacts/\{contact\_id}/tags

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   user_id?: number | null,
>   name?: string | null,
>   color?: string | null,
>   contacts_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### unsubscribe

`contacts.unsubscribe`

Unsubscribe a contact from all of the account's email. There is no resubscribe call: only the person can rejoin (contacts.create with resubscribe emails them to confirm).

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.contacts.unsubscribe({});
```

**Input**

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

PATCH /unsubscribe

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `email` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `ip_address` | `string \| null` | No | — |
| `unsubscribed_at` | `string \| null \| null` | No | — |
| `bounced_at` | `string \| null \| null` | No | When this address hard bounced. A hard bounce also sets unsubscribed\_at. If unsubscribed\_at is null, or far from this date, the bounce isn't what's stopping their email; they were resubscribed or opted out separately. |
| `bounce_paused_at` | `string \| null \| null` | No | When this contact was last paused for repeated bounces. Can remain set after the pause has ended; read bounce\_paused\_until to tell. |
| `bounce_paused_until` | `string \| null \| null` | No | When the current repeated-bounce pause ends. Null if the contact isn't paused, or has since unsubscribed or become invalid, since no retry is coming. |
| `invalid_at` | `string \| null \| null` | No | When this address was found to be invalid. It isn't mailed while this is set. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### unsubscribed

`contacts.unsubscribed`

List unsubscribed contacts

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contacts.unsubscribed({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | No | Search query for filtering contacts |
| `page` | `number` | No | Page number, from 1. |

GET /contacts/unsubscribed

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> (
>   {
>     id?: number | null,
>     email?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     ip_address?: string | null,
>     unsubscribed_at?: string | null | null,
>     bounced_at?: string | null | null,
>     bounce_paused_at?: string | null | null,
>     bounce_paused_until?: string | null | null,
>     invalid_at?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }& {
>     lists?: (
>       {
>         id?: number | null,
>         name?: string | null,
>         user_id?: number | null,
>         subscribed_contacts_count?: number | null,
>         unsubscribed_contacts_count?: number | null,
>         public_description?: string | null | null,
>         subscriber_description?: string | null | null,
>         average_email_open_percent?: number | null,
>         average_email_click_percent?: number | null,
>         created_at?: string | null,
>         updated_at?: string | null
>       }& {
>         list_unsubscribed_at?: string | null | null
>       }
>     )[] | null
>   }
> )[] | null
> ```

***

### update

`contacts.update`

Update a contact

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contacts.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `first_name` | `string` | No | — |
| `last_name` | `string` | No | — |
| `lists` | `number[]` | No | Array of list IDs (replaces all current list memberships) |
| `contact_fields` | `object[]` | No | — |

PATCH /contacts/\{id}

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `email` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `ip_address` | `string \| null` | No | — |
| `unsubscribed_at` | `string \| null \| null` | No | — |
| `bounced_at` | `string \| null \| null` | No | When this address hard bounced. A hard bounce also sets unsubscribed\_at. If unsubscribed\_at is null, or far from this date, the bounce isn't what's stopping their email; they were resubscribed or opted out separately. |
| `bounce_paused_at` | `string \| null \| null` | No | When this contact was last paused for repeated bounces. Can remain set after the pause has ended; read bounce\_paused\_until to tell. |
| `bounce_paused_until` | `string \| null \| null` | No | When the current repeated-bounce pause ends. Null if the contact isn't paused, or has since unsubscribed or become invalid, since no retry is coming. |
| `invalid_at` | `string \| null \| null` | No | When this address was found to be invalid. It isn't mailed while this is set. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

## Contact Tags

### create

`contactTags.create`

Create a contact tag

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contactTags.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `color` | `string` | No | Optional brand palette hex color; auto-assigned when omitted. |

POST /contact-tags

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `color` | `string \| null` | No | Brand palette hex color (e.g. "#FF644D"). |
| `contacts_count` | `number \| null` | No | Number of contacts carrying the tag (included on list/show). |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### delete

`contactTags.delete`

Delete a contact tag

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.contactTags.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /contact-tags/\{id}

**Output**

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

***

### get

`contactTags.get`

Get a contact tag

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contactTags.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /contact-tags/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `color` | `string \| null` | No | Brand palette hex color (e.g. "#FF644D"). |
| `contacts_count` | `number \| null` | No | Number of contacts carrying the tag (included on list/show). |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### list

`contactTags.list`

List contact tags

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.contactTags.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |

GET /contact-tags

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   user_id?: number | null,
>   name?: string | null,
>   color?: string | null,
>   contacts_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### update

`contactTags.update`

Update a contact tag

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.contactTags.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `name` | `string` | No | — |
| `color` | `string` | No | — |

PATCH /contact-tags/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `color` | `string \| null` | No | Brand palette hex color (e.g. "#FF644D"). |
| `contacts_count` | `number \| null` | No | Number of contacts carrying the tag (included on list/show). |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

## Domains

### create

`domains.create`

Add a sender domain

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.domains.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | Domain name (e.g., example.com). Do not include @ or protocol. |

POST /domains

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `sendgrid_whitelabel_domain_id` | `number \| null \| null` | No | — |
| `validated_at` | `string \| null \| null` | No | — |
| `dns` | `Record<string, any> \| null` | No | DNS records from SendGrid (included on show) |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### delete

`domains.delete`

Delete a sender domain

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.domains.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /domains/\{id}

**Output**

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

***

### get

`domains.get`

Get domain with DNS records

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.domains.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /domains/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `sendgrid_whitelabel_domain_id` | `number \| null \| null` | No | — |
| `validated_at` | `string \| null \| null` | No | — |
| `dns` | `Record<string, any> \| null` | No | DNS records from SendGrid (included on show) |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### list

`domains.list`

List sender domains

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |

GET /domains

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   domain?: string | null,
>   sendgrid_whitelabel_domain_id?: number | null | null,
>   validated_at?: string | null | null,
>   dns?: Record<string, any> | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### validate

`domains.validate`

Check a sender domain's DNS records now and return what is still missing.

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.domains.validate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

POST /domains/\{id}/validate

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `string \| null` | No | — |
| `valid` | `boolean \| null` | No | — |
| `domain` | `object \| null` | No | — |

> [accordion] domain full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   domain?: string | null,
>   sendgrid_whitelabel_domain_id?: number | null | null,
>   validated_at?: string | null | null,
>   dns?: Record<string, any> | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

## Fields

### create

`fields.create`

Create a custom contact field

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.fields.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `label` | `string` | Yes | Human-readable field label |
| `contact_field_type_id` | `0abe5601-7738-43c8-858f-81911ecf89ee \| e43c6471-b3ff-4541-80c5-964c62decd15 \| fe7dd76c-5113-4159-bc7c-0dbf0ed8d404` | No | UUID of the field's data type. Required unless type is provided; must match type if both are provided. |
| `type` | `text \| number \| date` | No | Readable data type; required unless contact\_field\_type\_id is provided. |

POST /contact-fields

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `label` | `string \| null` | No | Human-readable field label |
| `name` | `string \| null` | No | Machine-readable slug (auto-generated from label) |
| `type` | `string \| null` | No | Field type |

***

### delete

`fields.delete`

Delete a contact field

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.fields.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /contact-fields/\{id}

**Output**

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

***

### get

`fields.get`

Get a specific contact field

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.fields.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /contact-fields/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `label` | `string \| null` | No | Human-readable field label |
| `name` | `string \| null` | No | Machine-readable slug (auto-generated from label) |
| `type` | `string \| null` | No | Field type |

***

### list

`fields.list`

List user contact fields

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.fields.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |

GET /contact-fields

**Output**

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

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

***

### update

`fields.update`

Update a contact field label

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.fields.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `label` | `string` | Yes | — |

PATCH /contact-fields/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `label` | `string \| null` | No | Human-readable field label |
| `name` | `string \| null` | No | Machine-readable slug (auto-generated from label) |
| `type` | `string \| null` | No | Field type |

***

## Forms

### create

`forms.create`

Create a new form

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.forms.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | Yes | — |
| `lists` | `number[]` | Yes | Array of list IDs to attach |
| `redirect_url` | `string \| null` | No | URL to redirect to after subscription |
| `gdpr_required` | `boolean` | No | Whether GDPR consent checkbox is required |

POST /forms

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `landing_page_id` | `number \| null \| null` | No | — |
| `redirect_url` | `string \| null \| null` | No | — |
| `gdpr_required` | `boolean \| null` | No | — |
| `url` | `string \| null` | No | Public subscribe URL |
| `lists` | `object[] \| null` | No | Attached lists (included on create/update) |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] lists full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   user_id?: number | null,
>   subscribed_contacts_count?: number | null,
>   unsubscribed_contacts_count?: number | null,
>   public_description?: string | null | null,
>   subscriber_description?: string | null | null,
>   average_email_open_percent?: number | null,
>   average_email_click_percent?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### delete

`forms.delete`

Delete a form

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.forms.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /forms/\{id}

**Output**

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

***

### get

`forms.get`

Get a specific form

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.forms.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /forms/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `landing_page_id` | `number \| null \| null` | No | — |
| `redirect_url` | `string \| null \| null` | No | — |
| `gdpr_required` | `boolean \| null` | No | — |
| `url` | `string \| null` | No | Public subscribe URL |
| `lists` | `object[] \| null` | No | Attached lists (included on create/update) |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] lists full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   user_id?: number | null,
>   subscribed_contacts_count?: number | null,
>   unsubscribed_contacts_count?: number | null,
>   public_description?: string | null | null,
>   subscriber_description?: string | null | null,
>   average_email_open_percent?: number | null,
>   average_email_click_percent?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### list

`forms.list`

List forms

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.forms.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | No | Search query for filtering forms |
| `page` | `number` | No | Page number, from 1. |

GET /forms

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   title?: string | null,
>   landing_page_id?: number | null | null,
>   redirect_url?: string | null | null,
>   gdpr_required?: boolean | null,
>   url?: string | null,
>   lists?: {
>     id?: number | null,
>     name?: string | null,
>     user_id?: number | null,
>     subscribed_contacts_count?: number | null,
>     unsubscribed_contacts_count?: number | null,
>     public_description?: string | null | null,
>     subscriber_description?: string | null | null,
>     average_email_open_percent?: number | null,
>     average_email_click_percent?: number | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### update

`forms.update`

Update a form

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.forms.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `title` | `string` | No | — |
| `lists` | `number[]` | No | Replaces all list assignments |
| `redirect_url` | `string \| null` | No | — |
| `gdpr_required` | `boolean` | No | — |

PATCH /forms/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `title` | `string \| null` | No | — |
| `landing_page_id` | `number \| null \| null` | No | — |
| `redirect_url` | `string \| null \| null` | No | — |
| `gdpr_required` | `boolean \| null` | No | — |
| `url` | `string \| null` | No | Public subscribe URL |
| `lists` | `object[] \| null` | No | Attached lists (included on create/update) |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] lists full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   user_id?: number | null,
>   subscribed_contacts_count?: number | null,
>   unsubscribed_contacts_count?: number | null,
>   public_description?: string | null | null,
>   subscriber_description?: string | null | null,
>   average_email_open_percent?: number | null,
>   average_email_click_percent?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

## Lists

### addContact

`lists.addContact`

Add a contact to a list

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.lists.addContact({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `number` | Yes | — |
| `contact_id` | `number` | Yes | ID of the contact to add |

POST /lists/\{list\_id}/contacts

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `email` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `ip_address` | `string \| null` | No | — |
| `unsubscribed_at` | `string \| null \| null` | No | — |
| `bounced_at` | `string \| null \| null` | No | When this address hard bounced. A hard bounce also sets unsubscribed\_at. If unsubscribed\_at is null, or far from this date, the bounce isn't what's stopping their email; they were resubscribed or opted out separately. |
| `bounce_paused_at` | `string \| null \| null` | No | When this contact was last paused for repeated bounces. Can remain set after the pause has ended; read bounce\_paused\_until to tell. |
| `bounce_paused_until` | `string \| null \| null` | No | When the current repeated-bounce pause ends. Null if the contact isn't paused, or has since unsubscribed or become invalid, since no retry is coming. |
| `invalid_at` | `string \| null \| null` | No | When this address was found to be invalid. It isn't mailed while this is set. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### contacts

`lists.contacts`

Get contacts in a list

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.lists.contacts({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `number` | Yes | — |
| `query` | `string` | No | Search query for filtering contacts |
| `status` | `subscribed \| unsubscribed` | No | Optional. Omit for every member, which is the long-standing behaviour of this endpoint. `subscribed` returns members who can still be mailed from this list; `unsubscribed` returns members who have stopped it, whether by leaving this list or by unsubscribing from the account. The two do not sum to... |
| `page` | `number` | No | Page number, from 1. |

GET /lists/\{list\_id}/contacts

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> (
>   {
>     id?: number | null,
>     email?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     ip_address?: string | null,
>     unsubscribed_at?: string | null | null,
>     bounced_at?: string | null | null,
>     bounce_paused_at?: string | null | null,
>     bounce_paused_until?: string | null | null,
>     invalid_at?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }& {
>     list_unsubscribed_at?: string | null | null
>   }
> )[] | null
> ```

***

### create

`lists.create`

Create a new contact list

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.lists.create({});
```

**Input**

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

POST /lists

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `subscribed_contacts_count` | `number \| null` | No | Members who can still be mailed from this list. Excludes anyone who unsubscribed from the list itself as well as anyone who unsubscribed from the account. |
| `unsubscribed_contacts_count` | `number \| null` | No | Members who have stopped this list, by either the account-wide unsubscribe or this list's own. A hard bounce is included, because bouncing sets the account-wide flag. These two counts do not sum to total membership: an address flagged invalid is in neither. |
| `public_description` | `string \| null \| null` | No | The name subscribers see for this list on the unsubscribe and preference pages, or null to show the list's own name. |
| `subscriber_description` | `string \| null \| null` | No | What subscribers can expect from this list, shown below its name on the unsubscribe and preference pages. Returned by `GET /lists/{id}` and `PATCH /lists/{id}` only, not when lists are listed or embedded in a contact. |
| `average_email_open_percent` | `number \| null` | No | — |
| `average_email_click_percent` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### delete

`lists.delete`

Delete a contact list

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.lists.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

DELETE /lists/\{id}

**Output**

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

***

### get

`lists.get`

Get a specific contact list

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.lists.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

GET /lists/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `subscribed_contacts_count` | `number \| null` | No | Members who can still be mailed from this list. Excludes anyone who unsubscribed from the list itself as well as anyone who unsubscribed from the account. |
| `unsubscribed_contacts_count` | `number \| null` | No | Members who have stopped this list, by either the account-wide unsubscribe or this list's own. A hard bounce is included, because bouncing sets the account-wide flag. These two counts do not sum to total membership: an address flagged invalid is in neither. |
| `public_description` | `string \| null \| null` | No | The name subscribers see for this list on the unsubscribe and preference pages, or null to show the list's own name. |
| `subscriber_description` | `string \| null \| null` | No | What subscribers can expect from this list, shown below its name on the unsubscribe and preference pages. Returned by `GET /lists/{id}` and `PATCH /lists/{id}` only, not when lists are listed or embedded in a contact. |
| `average_email_open_percent` | `number \| null` | No | — |
| `average_email_click_percent` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### list

`lists.list`

List contact lists

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.lists.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | No | Search query for filtering lists |
| `page` | `number` | No | Page number, from 1. |

GET /lists

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   user_id?: number | null,
>   subscribed_contacts_count?: number | null,
>   unsubscribed_contacts_count?: number | null,
>   public_description?: string | null | null,
>   subscriber_description?: string | null | null,
>   average_email_open_percent?: number | null,
>   average_email_click_percent?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[] | null
> ```

***

### removeContact

`lists.removeContact`

Remove a contact from a list

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.lists.removeContact({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `number` | Yes | — |
| `contact_id` | `number` | Yes | — |

DELETE /lists/\{list\_id}/contacts/\{contact\_id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `email` | `string \| null` | No | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `ip_address` | `string \| null` | No | — |
| `unsubscribed_at` | `string \| null \| null` | No | — |
| `bounced_at` | `string \| null \| null` | No | When this address hard bounced. A hard bounce also sets unsubscribed\_at. If unsubscribed\_at is null, or far from this date, the bounce isn't what's stopping their email; they were resubscribed or opted out separately. |
| `bounce_paused_at` | `string \| null \| null` | No | When this contact was last paused for repeated bounces. Can remain set after the pause has ended; read bounce\_paused\_until to tell. |
| `bounce_paused_until` | `string \| null \| null` | No | When the current repeated-bounce pause ends. Null if the contact isn't paused, or has since unsubscribed or become invalid, since no retry is coming. |
| `invalid_at` | `string \| null \| null` | No | When this address was found to be invalid. It isn't mailed while this is set. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

### unsubscribeContact

`lists.unsubscribeContact`

Unsubscribe a contact from one list. There is no resubscribe call: adding them back does not restart sending.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.lists.unsubscribeContact({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `number` | Yes | — |
| `email` | `string` | Yes | Email address of a contact already on this list |

PATCH /lists/\{list\_id}/unsubscribe

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   email?: string | null,
>   first_name?: string | null,
>   last_name?: string | null,
>   ip_address?: string | null,
>   unsubscribed_at?: string | null | null,
>   bounced_at?: string | null | null,
>   bounce_paused_at?: string | null | null,
>   bounce_paused_until?: string | null | null,
>   invalid_at?: string | null | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }& {
>   list_unsubscribed_at?: string | null,
>   unsubscribed_scope?: string | null
> }
> ```

***

### unsubscribes

`lists.unsubscribes`

Get everyone who has stopped this list

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.lists.unsubscribes({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `number` | Yes | — |
| `query` | `string` | No | Search query for filtering contacts |
| `page` | `number` | No | Page number, from 1. |

GET /lists/\{list\_id}/unsubscribes

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> (
>   {
>     id?: number | null,
>     email?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     ip_address?: string | null,
>     unsubscribed_at?: string | null | null,
>     bounced_at?: string | null | null,
>     bounce_paused_at?: string | null | null,
>     bounce_paused_until?: string | null | null,
>     invalid_at?: string | null | null,
>     created_at?: string | null,
>     updated_at?: string | null
>   }& {
>     list_unsubscribed_at?: string | null | null,
>     unsubscribed_scope?: string | null
>   }
> )[] | null
> ```

***

### update

`lists.update`

Update a contact list

**Risk:** `write`

```ts theme={null}
await corsair.sendfox.api.lists.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `name` | `string` | No | — |
| `public_description` | `string \| null` | No | The name subscribers see on the unsubscribe and preference pages. Blank uses the list's own name. |
| `subscriber_description` | `string \| null` | No | What subscribers can expect from this list, shown below its name on those pages. Blank clears it. |

PATCH /lists/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `user_id` | `number \| null` | No | — |
| `subscribed_contacts_count` | `number \| null` | No | Members who can still be mailed from this list. Excludes anyone who unsubscribed from the list itself as well as anyone who unsubscribed from the account. |
| `unsubscribed_contacts_count` | `number \| null` | No | Members who have stopped this list, by either the account-wide unsubscribe or this list's own. A hard bounce is included, because bouncing sets the account-wide flag. These two counts do not sum to total membership: an address flagged invalid is in neither. |
| `public_description` | `string \| null \| null` | No | The name subscribers see for this list on the unsubscribe and preference pages, or null to show the list's own name. |
| `subscriber_description` | `string \| null \| null` | No | What subscribers can expect from this list, shown below its name on the unsubscribe and preference pages. Returned by `GET /lists/{id}` and `PATCH /lists/{id}` only, not when lists are listed or embedded in a contact. |
| `average_email_open_percent` | `number \| null` | No | — |
| `average_email_click_percent` | `number \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

***

## Transactional

### get

`transactional.get`

Get an email

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.transactional.get({});
```

**Input**

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

GET /transactional/emails/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | Opaque message id (`tm_` and 24 hex characters). Store it as a string; it is random, not sequential. |
| `status` | `string \| null` | No | — |
| `mode` | `string \| null` | No | test for messages to the sandbox test addresses, which never reach a mailbox and are never counted. |
| `from` | `string \| null` | No | — |
| `to` | `string[] \| null` | No | — |
| `cc` | `string[] \| null` | No | — |
| `bcc` | `string[] \| null` | No | — |
| `reply_to` | `string \| null \| null` | No | — |
| `subject` | `string \| null` | No | — |
| `tag` | `string \| null \| null` | No | — |
| `headers` | `Record<string, any> \| null` | No | The custom headers the email was sent with; `{}` when there were none. |
| `attachments` | `object[] \| null` | No | Only on `GET /transactional/emails/{id}`. The files sent with the email (never their content). |
| `idempotency_key` | `string \| null \| null` | No | — |
| `failure` | `object \| null` | No | — |
| `accepted_at` | `string \| null` | No | — |
| `sent_at` | `string \| null \| null` | No | — |
| `delivered_at` | `string \| null \| null` | No | — |
| `failed_at` | `string \| null \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `events` | `object[] \| null` | No | Present on GET /transactional/emails/\{id} only. |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename?: string | null,
>   content_type?: string | null,
>   size?: number | null
> }[] | null
> ```

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

> [accordion] events full type
>
> ```ts theme={null}
> {
>   event?: string | null,
>   occurred_at?: string | null,
>   reason?: string | null | null,
>   status?: string | null | null
> }[] | null
> ```

***

### list

`transactional.list`

List emails

**Risk:** `read`

```ts theme={null}
await corsair.sendfox.api.transactional.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `queued \| sent \| delivered \| bounced \| complained \| failed \| suppressed` | No | — |
| `tag` | `string` | No | — |
| `to` | `string` | No | Exact match on the first `to` address. |
| `mode` | `live \| test` | No | — |
| `page` | `number` | No | — |
| `per_page` | `number` | No | — |

GET /transactional/emails

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   mode?: string | null,
>   from?: string | null,
>   to?: string[] | null,
>   cc?: string[] | null,
>   bcc?: string[] | null,
>   reply_to?: string | null | null,
>   subject?: string | null,
>   tag?: string | null | null,
>   headers?: Record<string, any> | null,
>   attachments?: {
>     filename?: string | null,
>     content_type?: string | null,
>     size?: number | null
>   }[] | null,
>   idempotency_key?: string | null | null,
>   failure?: {
>     name?: string | null,
>     message?: string | null
>   } | null,
>   accepted_at?: string | null,
>   sent_at?: string | null | null,
>   delivered_at?: string | null | null,
>   failed_at?: string | null | null,
>   created_at?: string | null,
>   events?: {
>     event?: string | null,
>     occurred_at?: string | null,
>     reason?: string | null | null,
>     status?: string | null | null
>   }[] | null
> }[] | null
> ```

***

### send

`transactional.send`

Send one transactional email (up to 10 addresses across to, cc and bcc). The sandbox sender [onboarding@sendfoxmail.com](mailto:onboarding@sendfoxmail.com) only delivers to the account's own addresses.

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.transactional.send({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | — |
| `from` | `string` | Yes | Sender. Either an address or a display name followed by one in angle brackets. The domain must be plain ASCII (for an internationalized domain, use its punycode form, starting xn--) and verified under Account > Domains (a subdomain of a verified domain also works), or be the sandbox sender \`onboa... |
| `to` | `string[]` | Yes | 1 to 10 addresses. to, cc and bcc together may hold at most 10, and every address counts as one email against your plan's sends, so a message to three people uses three. |
| `cc` | `string[]` | No | — |
| `bcc` | `string[]` | No | At most 2 addresses; counts toward the 10-address total. |
| `reply_to` | `string \| null` | No | — |
| `subject` | `string` | Yes | — |
| `html` | `string` | No | HTML body, at most 500 KB (UTF-8 bytes). Send html, text, or both. |
| `text` | `string` | No | Plain-text body, at most 100 KB (UTF-8 bytes). Send html, text, or both. |
| `tag` | `string \| null` | No | A label for grouping in the dashboard, for per-tag open/click tracking switches, and for per-tag alerts. Lowercase letters, digits, dots, dashes and underscores. Messages without a tag are grouped by subject. Tags that look like authentication mail (`login_code`, `password_reset`, `otp`, ...) can... |
| `headers` | `Record<string, any> \| null` | No | Custom headers, at most 20, as `{"Name": "value"}`. Allowed: `List-Unsubscribe`, `List-Unsubscribe-Post`, `List-Id`, `X-Entity-Ref-ID`, `References`, `In-Reply-To`, and any other `X-*` header except `X-SendFox-*` and `X-SG-*`. Headers SendFox or SendGrid set (`From`, `To`, `Cc`, `Bcc`, `Reply-To`... |
| `attachments` | `object[] \| null` | No | Files to attach, at most 10 and 5 MB in total once decoded. Each is `{filename, content, content_type?}` with `content` the file in base64 (line breaks are fine). `content_type` is guessed from the extension when omitted and may carry parameters, like `text/calendar; method=REQUEST` for a calenda... |

POST /transactional/emails

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   content: string,
>   content_type?: string
> }[] | null
> ```

**Output**

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

***

### sendBatch

`transactional.sendBatch`

Send a batch of emails

**Risk:** `destructive`

```ts theme={null}
await corsair.sendfox.api.transactional.sendBatch({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | — |
| `emails` | `object[]` | Yes | 1 to 100 emails. Each item takes the same fields as `POST /transactional/emails` plus an optional `idempotency_key`. The `html` and `text` of all items together may total at most 5 MB. |

POST /transactional/emails/batch

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   from: string,
>   to: string[],
>   cc?: string[],
>   bcc?: string[],
>   reply_to?: string | null,
>   subject: string,
>   html?: string,
>   text?: string,
>   tag?: string | null,
>   headers?: Record<string, any> | null,
>   attachments?: {
>     filename: string,
>     content: string,
>     content_type?: string
>   }[] | null,
>   idempotency_key?: string
> }[]
> ```

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   index?: number | null,
>   id?: string | null,
>   status?: string | null,
>   replayed?: boolean | null,
>   error?: {
>     status?: number | null,
>     name?: string | null,
>     message?: string | null,
>     fix?: string | null,
>     link?: string | null,
>     errors?: Record<string, any> | null
>   } | null
> }[] | null
> ```

***


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