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

# Sender API reference

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

## Campaigns

### cancelFollowup

`campaigns.cancelFollowup`

Cancel a campaign's automatic follow-up.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.campaigns.cancelFollowup({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

POST /v2/campaigns/\{id}/cancel\_followup

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### cancelSchedule

`campaigns.cancelSchedule`

Cancel a scheduled campaign; it goes back to draft.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.campaigns.cancelSchedule({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

DELETE /v2/campaigns/\{id}/schedule

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### clicks

`campaigns.clicks`

List link clicks of a sent campaign.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.clicks({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/clicks

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### complaints

`campaigns.complaints`

List spam complaints for a campaign.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.complaints({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/complaints

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### copy

`campaigns.copy`

Copy a campaign into a new draft.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.campaigns.copy({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

POST /v2/campaigns/\{id}/copy

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   preheader?: string | null,
>   language?: string | null,
>   status?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   domain_id?: string | number | null,
>   recipient_count?: number | null,
>   sent_count?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounces_count?: number | null,
>   send_to_all?: boolean | number | null,
>   schedule_time?: string | null,
>   sent_time?: string | null,
>   created?: string | null,
>   modified?: string | null,
>   auto_followup_active?: boolean | number | null,
>   auto_followup_subject?: string | null,
>   auto_followup_delay?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null,
>   campaign_groups?: any[] | null,
>   segments?: any[] | null
> } | null
> ```

***

### create

`campaigns.create`

Create a draft email campaign (plain text or HTML content). It is not sent until campaigns.send or campaigns.schedule.

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subject` | `string` | Yes | Subject line. |
| `from` | `string` | Yes | Sender name shown to subscribers. |
| `reply_to` | `string` | Yes | Reply-to address; must be on a verified domain of the account. |
| `content_type` | `editor \| html \| text` | Yes | Content type. The API can set html or text content; editor needs the app. |
| `title` | `string` | No | Campaign name shown in reports. |
| `preheader` | `string` | No | Preview text. |
| `content` | `string` | No | Campaign content (HTML or plain text). |
| `groups` | `string[]` | No | Group ids to send to. |
| `segments` | `string[]` | No | Segment ids to send to. |
| `google_analytics` | `0 \| 1` | No | 1 adds Google Analytics tracking to links. |
| `auto_followup_active` | `boolean` | No | Send a follow-up to subscribers who did not open. |
| `auto_followup_subject` | `string` | No | Follow-up subject. |
| `auto_followup_delay` | `12 \| 24 \| 48 \| 72 \| 96 \| 120 \| 144 \| 168` | No | Hours before the follow-up. |

POST /v2/campaigns

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   preheader?: string | null,
>   language?: string | null,
>   status?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   domain_id?: string | number | null,
>   recipient_count?: number | null,
>   sent_count?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounces_count?: number | null,
>   send_to_all?: boolean | number | null,
>   schedule_time?: string | null,
>   sent_time?: string | null,
>   created?: string | null,
>   modified?: string | null,
>   auto_followup_active?: boolean | number | null,
>   auto_followup_subject?: string | null,
>   auto_followup_delay?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null,
>   campaign_groups?: any[] | null,
>   segments?: any[] | null
> } | null
> ```

***

### delete

`campaigns.delete`

Delete campaigns by id ("all" deletes every campaign, optionally narrowed by status or title).

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ids` | `string[] \| all` | Yes | Campaign ids, or "all". |
| `status` | `DRAFT \| SENT \| PENDING \| PREPARING` | No | Only campaigns with this status. |
| `title` | `string` | No | Only campaigns with this title. |

DELETE /v2/campaigns

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### errors

`campaigns.errors`

Check a campaign before sending: blocking errors and warnings.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.errors({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

GET /v2/campaigns/\{id}/errors

**Output**

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

> [accordion] errors full type
>
> ```ts theme={null}
> {
>   title?: string | null,
>   details?: string | null,
>   route?: string | null
> }[] | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> {
>   title?: string | null,
>   details?: string | null,
>   route?: string | null
> }[] | null
> ```

***

### get

`campaigns.get`

Get a campaign with its content, groups and counts.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

GET /v2/campaigns/\{id}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   preheader?: string | null,
>   language?: string | null,
>   status?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   domain_id?: string | number | null,
>   recipient_count?: number | null,
>   sent_count?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounces_count?: number | null,
>   send_to_all?: boolean | number | null,
>   schedule_time?: string | null,
>   sent_time?: string | null,
>   created?: string | null,
>   modified?: string | null,
>   auto_followup_active?: boolean | number | null,
>   auto_followup_subject?: string | null,
>   auto_followup_delay?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null,
>   campaign_groups?: any[] | null,
>   segments?: any[] | null
> }
> ```

***

### groupStats

`campaigns.groupStats`

Opens and clicks of a campaign per group.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.groupStats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

GET /v2/campaigns/\{id}/groups

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   tag_id?: string | number | null,
>   tag_title?: string | null,
>   opens?: number | null,
>   link_opens?: number | null,
>   recipient_count?: number | null,
>   percentage?: Record<string, any> | null
> }[]
> ```

***

### hardBounces

`campaigns.hardBounces`

List a campaign's hard bounces.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.hardBounces({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/hard\_bounces

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### list

`campaigns.list`

List email campaigns, optionally by status.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |
| `status` | `SCHEDULED \| SENDING \| SENT \| DRAFT` | No | Only campaigns with this status. |

GET /v2/campaigns

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   preheader?: string | null,
>   language?: string | null,
>   status?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   domain_id?: string | number | null,
>   recipient_count?: number | null,
>   sent_count?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounces_count?: number | null,
>   send_to_all?: boolean | number | null,
>   schedule_time?: string | null,
>   sent_time?: string | null,
>   created?: string | null,
>   modified?: string | null,
>   auto_followup_active?: boolean | number | null,
>   auto_followup_subject?: string | null,
>   auto_followup_delay?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null,
>   campaign_groups?: any[] | null,
>   segments?: any[] | null
> }[] | {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   preheader?: string | null,
>   language?: string | null,
>   status?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   domain_id?: string | number | null,
>   recipient_count?: number | null,
>   sent_count?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounces_count?: number | null,
>   send_to_all?: boolean | number | null,
>   schedule_time?: string | null,
>   sent_time?: string | null,
>   created?: string | null,
>   modified?: string | null,
>   auto_followup_active?: boolean | number | null,
>   auto_followup_subject?: string | null,
>   auto_followup_delay?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null,
>   campaign_groups?: any[] | null,
>   segments?: any[] | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### opens

`campaigns.opens`

List who opened a sent campaign.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.opens({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/opens

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### schedule

`campaigns.schedule`

Schedule a campaign to send at a set time (it then emails its groups and segments).

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.campaigns.schedule({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `schedule_time` | `string` | Yes | When to send, "YYYY-MM-DD HH:MM:SS". |

POST /v2/campaigns/\{id}/schedule

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### send

`campaigns.send`

Send a campaign now to its groups and segments. Emails real subscribers and cannot be undone.

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |

POST /v2/campaigns/\{id}/send

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### sent

`campaigns.sent`

List the recipients a campaign was sent to.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.sent({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/emails-sent

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### softBounces

`campaigns.softBounces`

List a campaign's soft bounces.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.softBounces({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/soft\_bounces

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### unsubscribes

`campaigns.unsubscribes`

List who unsubscribed from a campaign.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.campaigns.unsubscribes({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/campaigns/\{id}/unsubscribes

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }[] | {
>   recipient_id?: string | number | null,
>   email?: string | null,
>   created_at?: string | null,
>   link_id?: string | number | null,
>   url?: string | null,
>   message?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

## Events

### create

`events.create`

Record a custom event for a subscriber (e.g. product\_viewed); it can start workflows.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.events.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subscriber` | `object` | Yes | The subscriber: id, email or phone. |
| `type` | `string` | Yes | Event name, e.g. product\_viewed. |
| `value` | `number` | No | A number for the event, e.g. an order total. |
| `value_currency` | `string` | No | ISO 4217 currency of value. |
| `properties` | `Record<string, string \| number \| boolean>` | No | Flat custom properties (each text up to 2 KB, 8 KB in all). |

POST /v2/events

> [accordion] subscriber full type
>
> ```ts theme={null}
> {
>   id?: string,
>   email?: string,
>   phone?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

## Fields

### create

`fields.create`

Create a custom subscriber field.

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | Yes | Field name. |
| `type` | `number \| text \| datetime` | Yes | Field type. |

POST /v2/fields

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | number | null,
>   title?: string | null,
>   type?: string | null,
>   field_name?: string | null,
>   show?: boolean | number | null,
>   position?: number | null,
>   default?: boolean | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null
> } | null
> ```

***

### delete

`fields.delete`

Delete a custom field and its values.

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The field id. |

DELETE /v2/fields/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### list

`fields.list`

List subscriber fields, built-in and custom.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/fields

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | number | null,
>   title?: string | null,
>   type?: string | null,
>   field_name?: string | null,
>   show?: boolean | number | null,
>   position?: number | null,
>   default?: boolean | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null
> }[] | {
>   id?: string | number | null,
>   title?: string | null,
>   type?: string | null,
>   field_name?: string | null,
>   show?: boolean | number | null,
>   position?: number | null,
>   default?: boolean | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### update

`fields.update`

Rename a custom field or show/hide it as a filter in the subscribers list.

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The field id. |
| `title` | `string` | No | New name. |
| `show` | `boolean` | No | Show it as a filter in the subscribers dashboard. |

PATCH /v2/fields/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

## Groups

### create

`groups.create`

Create a subscriber group.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.groups.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | Yes | Group name. |

POST /v2/groups

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   recipient_count?: number | null,
>   active_subscribers?: number | null,
>   opens_rate?: number | null,
>   click_rate?: number | null,
>   unsubscribed_count?: number | null,
>   bounced_count?: number | null,
>   phone_count?: number | null,
>   active_phone_count?: number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   is_recalculating_subscribers?: boolean | null
> } | null
> ```

***

### delete

`groups.delete`

Delete a group, and optionally soft-delete its subscribers.

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.groups.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The group id. |
| `delete_subscribers` | `boolean` | No | Also delete the group's subscribers (default false). |

DELETE /v2/groups/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### get

`groups.get`

Get a group with its subscriber counts.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.groups.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The group id. |

GET /v2/groups/\{id}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   recipient_count?: number | null,
>   active_subscribers?: number | null,
>   opens_rate?: number | null,
>   click_rate?: number | null,
>   unsubscribed_count?: number | null,
>   bounced_count?: number | null,
>   phone_count?: number | null,
>   active_phone_count?: number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   is_recalculating_subscribers?: boolean | null
> }
> ```

***

### list

`groups.list`

List subscriber groups with their subscriber counts.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.groups.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/groups

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   recipient_count?: number | null,
>   active_subscribers?: number | null,
>   opens_rate?: number | null,
>   click_rate?: number | null,
>   unsubscribed_count?: number | null,
>   bounced_count?: number | null,
>   phone_count?: number | null,
>   active_phone_count?: number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   is_recalculating_subscribers?: boolean | null
> }[] | {
>   id: string | number,
>   title?: string | null,
>   recipient_count?: number | null,
>   active_subscribers?: number | null,
>   opens_rate?: number | null,
>   click_rate?: number | null,
>   unsubscribed_count?: number | null,
>   bounced_count?: number | null,
>   phone_count?: number | null,
>   active_phone_count?: number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   is_recalculating_subscribers?: boolean | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### subscribers

`groups.subscribers`

List the subscribers in a group.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.groups.subscribers({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The group id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/groups/\{id}/subscribers

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |
| `has_more_not_deleted_subscribers` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }[] | {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### update

`groups.update`

Rename a group.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.groups.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The group id. |
| `title` | `string` | Yes | New name. |

PATCH /v2/groups/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

## Messages

### send

`messages.send`

Send one transactional email without a template: sender, recipient, subject and body.

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.messages.send({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `from` | `object` | Yes | Sender address (verified domain) and name. |
| `to` | `object` | Yes | Recipient: email and optional name. |
| `subject` | `string` | Yes | Subject line. |
| `text` | `string` | No | Plain-text body. |
| `html` | `string` | No | HTML body. |
| `variables` | `Record<string, any>` | No | Values for \{\{variables}} in the content. |
| `attachments` | `Record<string, string>` | No | Files to attach: file name -> public URL. |
| `headers` | `Record<string, string>` | No | Extra email headers. |

POST /v2/message/send

> [accordion] from full type
>
> ```ts theme={null}
> {
>   email: string,
>   name: string
> }
> ```

> [accordion] to full type
>
> ```ts theme={null}
> {
>   email: string,
>   name?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `emailId` | `string \| null` | No | — |

***

## Segments

### delete

`segments.delete`

Delete a segment (its subscribers stay).

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.segments.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The segment id. |

DELETE /v2/segments/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### get

`segments.get`

Get a segment with its conditions.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.segments.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The segment id. |

GET /v2/segments/\{id}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string | null,
>   account_id?: string | number | null,
>   conditions?: any[] | null,
>   created?: string | null,
>   modified?: string | null,
>   subscribers?: number | null,
>   phone_count?: number | null,
>   active_subscribers?: number | null,
>   active_phone_count?: number | null
> }
> ```

***

### list

`segments.list`

List segments with their conditions and subscriber counts.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.segments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/segments

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   name?: string | null,
>   account_id?: string | number | null,
>   conditions?: any[] | null,
>   created?: string | null,
>   modified?: string | null,
>   subscribers?: number | null,
>   phone_count?: number | null,
>   active_subscribers?: number | null,
>   active_phone_count?: number | null
> }[] | {
>   id: string | number,
>   name?: string | null,
>   account_id?: string | number | null,
>   conditions?: any[] | null,
>   created?: string | null,
>   modified?: string | null,
>   subscribers?: number | null,
>   phone_count?: number | null,
>   active_subscribers?: number | null,
>   active_phone_count?: number | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### subscribers

`segments.subscribers`

List the subscribers that match a segment.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.segments.subscribers({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The segment id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/segments/\{id}/subscribers

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |
| `has_more_not_deleted_subscribers` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }[] | {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

## Subscribers

### addToGroup

`subscribers.addToGroup`

Add existing subscribers (by email) to a group. Can start automations unless trigger\_automation is false.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.subscribers.addToGroup({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `groupId` | `string` | Yes | The group id. |
| `subscribers` | `string[]` | Yes | Email addresses of existing subscribers. |
| `trigger_automation` | `boolean` | No | Start automations for this change (default true). |

POST /v2/subscribers/groups/\{groupId}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### create

`subscribers.create`

Add a subscriber (or update the one with that email), optionally into groups. Can start automations unless trigger\_automation is false.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.subscribers.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | Email address. |
| `firstname` | `string` | No | First name. |
| `lastname` | `string` | No | Last name. |
| `groups` | `string[]` | No | Group ids to add the subscriber to. |
| `fields` | `Record<string, string \| number \| boolean \| null>` | No | Custom field values keyed by field name, e.g. \{"\{\$company}": "Acme"}. |
| `phone` | `string` | No | Phone number with country code (+370...). |
| `trigger_automation` | `boolean` | No | Start automations for this change (default true). |

POST /v2/subscribers

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| any[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> } | any[] | null
> ```

***

### delete

`subscribers.delete`

Delete subscribers by email address (soft delete, processed in the background).

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.subscribers.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subscribers` | `string[]` | Yes | Email addresses to delete. |

DELETE /v2/subscribers

**Output**

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

***

### events

`subscribers.events`

List a subscriber's email activity: campaigns received, opened, clicked, bounced or unsubscribed from.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.subscribers.events({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subscriber` | `string` | Yes | The subscriber's id, email address or phone number. |
| `actions` | `(opened \| bounced \| clicked \| unsubscribed \| got)[]` | Yes | Which activity to return. |

GET /v2/subscribers/\{subscriber}/events

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `Record<string, any> \| null` | No | — |
| `sms` | `any` | No | — |
| `temail` | `any` | No | — |
| `sms_campaign` | `Record<string, any> \| null` | No | — |
| `email_campaign` | `Record<string, any> \| null` | No | — |

***

### get

`subscribers.get`

Get one subscriber by id, email address or phone number, with group memberships and field values.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.subscribers.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subscriber` | `string` | Yes | The subscriber's id, email address or phone number. |

GET /v2/subscribers/\{subscriber}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }
> ```

***

### list

`subscribers.list`

List subscribers, newest first, a page at a time.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.subscribers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/subscribers

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |
| `has_more_not_deleted_subscribers` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }[] | {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### removeFromGroup

`subscribers.removeFromGroup`

Remove subscribers (by email) from a group.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.subscribers.removeFromGroup({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `groupId` | `string` | Yes | The group id. |
| `subscribers` | `string[]` | Yes | Email addresses to remove from the group. |
| `trigger_automation` | `boolean` | No | Start automations for this change (default true). |

DELETE /v2/subscribers/groups/\{groupId}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### removePhone

`subscribers.removePhone`

Remove the phone number from a subscriber.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.subscribers.removePhone({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The subscriber id. |

DELETE /v2/subscribers/\{id}/remove\_phone

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### update

`subscribers.update`

Update a subscriber's name, groups, field values, phone or email/SMS/transactional status.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.subscribers.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subscriber` | `string` | Yes | The subscriber's id, email address or phone number. |
| `firstname` | `string` | No | First name. |
| `lastname` | `string` | No | Last name. |
| `groups` | `string[]` | No | Group ids the subscriber should be in. |
| `fields` | `Record<string, string \| number \| boolean \| null>` | No | Custom field values keyed by field name. |
| `phone` | `string` | No | Phone number with country code. |
| `subscriber_status` | `ACTIVE \| UNSUBSCRIBED \| BOUNCED \| SPAM_REPORTED` | No | Email status. |
| `sms_status` | `ACTIVE \| UNSUBSCRIBED \| BOUNCED \| SPAM_REPORTED` | No | SMS status. |
| `transactional_email_status` | `ACTIVE \| UNSUBSCRIBED \| BOUNCED \| SPAM_REPORTED` | No | Transactional email status. |
| `trigger_automation` | `boolean` | No | Start automations for this change (default true). |

PATCH /v2/subscribers/\{subscriber}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| any[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   phone?: string | null,
>   phone_country?: {
>     phone_code?: number | null,
>     country_code?: string | null
>   } | null,
>   created?: string | null,
>   status?: Record<string, any> | null,
>   ip_address?: string | null,
>   bounced_at?: string | null,
>   unsubscribed_at?: string | null,
>   unsubscribed?: boolean | number | null,
>   bounced?: boolean | number | null,
>   spam_reported?: boolean | number | null,
>   location?: any,
>   source?: string | null,
>   subscriber_tags?: (
>     {
>       id?: string | number | null,
>       title?: string | null
>     } | string
>   )[] | null,
>   columns?: {
>     id?: string | number | null,
>     title?: string | null,
>     type?: string | null,
>     default?: boolean | number | null,
>     value?: any
>   }[] | Record<string, any> | null,
>   sms_campaign?: Record<string, any> | null,
>   email_campaign?: Record<string, any> | null
> } | any[] | null
> ```

***

## Transactional

### bounces

`transactional.bounces`

List bounces of a transactional campaign's emails.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.transactional.bounces({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `email_address` | `string` | No | Only emails to this recipient address. |
| `order` | `string` | No | Column to sort by (id sorts by created). |
| `direction` | `asc \| desc` | No | Sort direction. |

GET /v2/transactional/\{id}/bounces

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }[] | {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### clicks

`transactional.clicks`

List link clicks in a transactional campaign's emails.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.transactional.clicks({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `email_address` | `string` | No | Only emails to this recipient address. |
| `order` | `string` | No | Column to sort by (id sorts by created). |
| `direction` | `asc \| desc` | No | Sort direction. |

GET /v2/transactional/\{id}/clicks

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }[] | {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### complaints

`transactional.complaints`

List spam complaints about a transactional campaign's emails.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.transactional.complaints({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `email_address` | `string` | No | Only emails to this recipient address. |
| `order` | `string` | No | Column to sort by (id sorts by created). |
| `direction` | `asc \| desc` | No | Sort direction. |

GET /v2/transactional/\{id}/complaints

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }[] | {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### create

`transactional.create`

Create a transactional campaign (a template sent later with transactional.send).

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.transactional.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subject` | `string` | Yes | Subject line; can use \{\{variables}}. |
| `from` | `string` | Yes | Sender name. |
| `reply_to` | `string` | Yes | Sender address; must be on a verified domain. |
| `editor` | `plain \| html \| builder` | Yes | Content type. |
| `title` | `string` | No | Name shown in reports. |
| `preheader` | `string` | No | Preview text. |
| `content` | `string` | No | Plain text or HTML content. |

POST /v2/transactional

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   domain_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   type?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   disable_click_tracking?: boolean | null,
>   created?: string | null,
>   modified?: string | null,
>   sent?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounced?: number | null,
>   unsubscribeCount?: number | null,
>   purchaseCount?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null
> }
> ```

***

### delete

`transactional.delete`

Delete transactional campaigns by id ("all" deletes every one).

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.transactional.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ids` | `string[] \| all` | Yes | Transactional campaign ids, or "all". |

DELETE /v2/transactional

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### get

`transactional.get`

Get a transactional campaign with its send, open and click counts.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |

GET /v2/transactional/\{id}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   domain_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   type?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   disable_click_tracking?: boolean | null,
>   created?: string | null,
>   modified?: string | null,
>   sent?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounced?: number | null,
>   unsubscribeCount?: number | null,
>   purchaseCount?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null
> }
> ```

***

### list

`transactional.list`

List transactional campaigns (templates for one-to-one emails).

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/transactional

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   domain_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   type?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   disable_click_tracking?: boolean | null,
>   created?: string | null,
>   modified?: string | null,
>   sent?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounced?: number | null,
>   unsubscribeCount?: number | null,
>   purchaseCount?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null
> }[] | {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   domain_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   type?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   disable_click_tracking?: boolean | null,
>   created?: string | null,
>   modified?: string | null,
>   sent?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounced?: number | null,
>   unsubscribeCount?: number | null,
>   purchaseCount?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### opens

`transactional.opens`

List opens of a transactional campaign's emails.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.transactional.opens({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `email_address` | `string` | No | Only emails to this recipient address. |
| `order` | `string` | No | Column to sort by (id sorts by created). |
| `direction` | `asc \| desc` | No | Sort direction. |

GET /v2/transactional/\{id}/opens

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }[] | {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### report

`transactional.report`

Sent, opens, clicks, bounces, unsubscribes and complaints of a transactional campaign per day, week, month or year.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.transactional.report({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `from` | `string` | Yes | Start date, YYYY-MM-DD. |
| `to` | `string` | Yes | End date, YYYY-MM-DD. |
| `period` | `day \| week \| month \| year` | Yes | Bucket size. |

GET /v2/transactional/\{id}/report

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `sent` | `object[] \| null` | No | — |
| `opens` | `object[] \| null` | No | — |
| `clicks` | `object[] \| null` | No | — |
| `bounces` | `object[] \| null` | No | — |
| `soft_bounces` | `object[] \| null` | No | — |
| `hard_bounces` | `object[] \| null` | No | — |
| `unsubscribes` | `object[] \| null` | No | — |
| `complaints` | `object[] \| null` | No | — |
| `totals` | `Record<string, any> \| null` | No | — |

> [accordion] sent full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] opens full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] clicks full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] bounces full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] soft\_bounces full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] hard\_bounces full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] unsubscribes full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

> [accordion] complaints full type
>
> ```ts theme={null}
> {
>   date?: {
>     from?: string | null,
>     to?: string | null
>   } | null,
>   count?: number | null
> }[] | null
> ```

***

### send

`transactional.send`

Send one email from a transactional campaign to one recipient, filling its \{\{variables}}.

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `to` | `object` | Yes | Recipient: email and optional name. |
| `variables` | `Record<string, any>` | No | Values for the template's \{\{variables}}. |
| `attachments` | `Record<string, string>` | No | Files to attach: file name -> public URL. |
| `text` | `string` | No | Plain-text body; replaces the template's. |
| `html` | `string` | No | HTML body; replaces the template's. |
| `headers` | `Record<string, string>` | No | Extra email headers. |

POST /v2/message/\{id}/send

> [accordion] to full type
>
> ```ts theme={null}
> {
>   email: string,
>   name?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `emailId` | `string \| null` | No | — |

***

### sent

`transactional.sent`

List emails sent from a transactional campaign.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.transactional.sent({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `email_address` | `string` | No | Only emails to this recipient address. |
| `direction` | `asc \| desc` | No | Sort direction. |

GET /v2/transactional/\{id}/sent

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }[] | {
>   emailId?: string | null,
>   email?: string | null,
>   subscriber_id?: string | number | null,
>   account_id?: string | number | null,
>   created?: string | null,
>   has_preview?: boolean | null,
>   url?: string | null,
>   link_id?: string | number | null,
>   bounce_type?: string | null,
>   message?: string | null,
>   type?: number | string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### update

`transactional.update`

Update a transactional campaign's title, subject, sender or editor.

**Risk:** `write`

```ts theme={null}
await corsair.sender.api.transactional.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The transactional campaign id. |
| `title` | `string` | No | Name shown in reports. |
| `subject` | `string` | No | Subject line. |
| `from` | `string` | No | Sender name. |
| `reply_to` | `string` | No | Sender address on a verified domain. |
| `editor` | `plain \| html \| builder` | No | Content type. |
| `preheader` | `string` | No | Preview text. |
| `last_action` | `string` | No | Editor progress step. |

PATCH /v2/transactional/\{id}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   subject?: string | null,
>   from?: string | null,
>   reply_to?: string | null,
>   domain_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   type?: string | null,
>   editor?: string | null,
>   last_action?: string | null,
>   disable_click_tracking?: boolean | null,
>   created?: string | null,
>   modified?: string | null,
>   sent?: number | null,
>   opens?: number | null,
>   clicks?: number | null,
>   bounced?: number | null,
>   unsubscribeCount?: number | null,
>   purchaseCount?: number | null,
>   html?: {
>     id?: string | number | null,
>     thumbnail_url?: string | null,
>     has_preview?: boolean | null,
>     has_snapshots?: boolean | null,
>     html_content?: string | null,
>     html_body?: string | null,
>     styles?: string | null
>   } | null
> }
> ```

***

## Webhooks

### create

`webhooks.create`

Create a webhook: Sender POSTs the topic's events to the URL, signed with the account's signing secret. Add ?topic=\<topic> to the URL so the plugin can tell subscriber topics apart.

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string` | Yes | Where Sender sends the events. |
| `topic` | `subscribers/new \| subscribers/updated \| subscribers/unsubscribed \| groups/new-subscriber \| groups/unsubscribed \| groups/new \| campaigns/new \| bounces/new` | Yes | The event topic. |
| `relation_id` | `string` | No | Group id; required for groups/new-subscriber and groups/unsubscribed. |

POST /v2/account/webhooks

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   account_id?: string | number | null,
>   url?: string | null,
>   topic?: string | null,
>   group?: string | number | null,
>   total_deliveries?: number | null,
>   total_failures?: number | null,
>   response_time?: number | null,
>   status?: string | null
> }
> ```

***

### delete

`webhooks.delete`

Delete a webhook.

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The webhook id. |

DELETE /v2/account/webhooks/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### get

`webhooks.get`

Get a webhook.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The webhook id. |

GET /v2/account/webhooks/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| number` | Yes | — |
| `account_id` | `string \| number \| null` | No | — |
| `url` | `string \| null` | No | — |
| `topic` | `string \| null` | No | — |
| `group` | `string \| number \| null` | No | — |
| `total_deliveries` | `number \| null` | No | — |
| `total_failures` | `number \| null` | No | — |
| `response_time` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |

***

### list

`webhooks.list`

List the account's webhooks with delivery counts.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page. |
| `order` | `string` | No | Field to sort by, any key of the returned records. |
| `direction` | `asc \| desc` | No | Sort direction (default desc). |

GET /v2/account/webhooks

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   account_id?: string | number | null,
>   url?: string | null,
>   topic?: string | null,
>   group?: string | number | null,
>   total_deliveries?: number | null,
>   total_failures?: number | null,
>   response_time?: number | null,
>   status?: string | null
> }[] | {
>   id: string | number,
>   account_id?: string | number | null,
>   url?: string | null,
>   topic?: string | null,
>   group?: string | number | null,
>   total_deliveries?: number | null,
>   total_failures?: number | null,
>   response_time?: number | null,
>   status?: string | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### update

`webhooks.update`

Change a webhook's URL, topic or group, or pause/resume it.

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The webhook id. |
| `url` | `string` | No | New URL. |
| `topic` | `subscribers/new \| subscribers/updated \| subscribers/unsubscribed \| groups/new-subscriber \| groups/unsubscribed \| groups/new \| campaigns/new \| bounces/new` | No | New topic. |
| `relation_id` | `string` | No | Group id for groups/\* topics. |
| `status` | `ACTIVE \| PAUSED` | No | Pause or resume deliveries. |

POST /v2/account/webhooks/\{id}

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

## Workflows

### get

`workflows.get`

Get a workflow with its report.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.workflows.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The workflow id. |

GET /v2/workflows/\{id}

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   status?: string | null,
>   type?: string | null,
>   description?: string | null,
>   thumbnail?: string | null,
>   emails_sent?: number | null,
>   workflow_category_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   report?: {
>     sent?: number | null,
>     opened?: number | null,
>     clicked?: number | null,
>     unsubscribed?: number | null,
>     bounced?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null
>   } | null,
>   index_report?: {
>     sent?: number | null,
>     opened?: number | null,
>     clicked?: number | null,
>     unsubscribed?: number | null,
>     bounced?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null
>   } | null
> }
> ```

***

### list

`workflows.list`

List automation workflows with their send and open counts.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.workflows.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | Page number, from 1. |
| `limit` | `number` | No | Items per page (1-100, default 10). |
| `status` | `DRAFT \| ACTIVE \| PAUSED` | No | Only workflows with this status. |
| `title` | `string` | No | Only workflows whose title starts with this. |

GET /v2/workflows

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| object` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `has_more_resources` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   title?: string | null,
>   status?: string | null,
>   type?: string | null,
>   description?: string | null,
>   thumbnail?: string | null,
>   emails_sent?: number | null,
>   workflow_category_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   report?: {
>     sent?: number | null,
>     opened?: number | null,
>     clicked?: number | null,
>     unsubscribed?: number | null,
>     bounced?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null
>   } | null,
>   index_report?: {
>     sent?: number | null,
>     opened?: number | null,
>     clicked?: number | null,
>     unsubscribed?: number | null,
>     bounced?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null
>   } | null
> }[] | {
>   id: string | number,
>   title?: string | null,
>   status?: string | null,
>   type?: string | null,
>   description?: string | null,
>   thumbnail?: string | null,
>   emails_sent?: number | null,
>   workflow_category_id?: string | number | null,
>   account_id?: string | number | null,
>   user_id?: string | number | null,
>   created?: string | null,
>   modified?: string | null,
>   report?: {
>     sent?: number | null,
>     opened?: number | null,
>     clicked?: number | null,
>     unsubscribed?: number | null,
>     bounced?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null
>   } | null,
>   index_report?: {
>     sent?: number | null,
>     opened?: number | null,
>     clicked?: number | null,
>     unsubscribed?: number | null,
>     bounced?: number | null,
>     open_rate?: number | null,
>     click_rate?: number | null,
>     unsubscribe_rate?: number | null,
>     bounce_rate?: number | null
>   } | null
> }
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | string | null,
>   to?: number | null,
>   total?: number | null,
>   links?: any[] | null
> } | null
> ```

***

### performance

`workflows.performance`

Get a workflow's e-commerce results: revenue, orders and ROI.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.workflows.performance({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The workflow id. |

GET /v2/workflows/\{id}/ecommerce-report

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   revenue?: number | null,
>   number_of_orders?: number | null,
>   roi?: number | null,
>   currency?: string | null,
>   revenue_per_customer?: number | null
> } | null
> ```

***

### start

`workflows.start`

Start an active workflow for one subscriber; its emails go to that address.

**Risk:** `destructive`

```ts theme={null}
await corsair.sender.api.workflows.start({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The workflow id. |
| `email` | `string` | Yes | The subscriber's email address. |

POST /v2/workflows/\{id}/start

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |

***

### statistics

`workflows.statistics`

Get a workflow's sent, open, click, unsubscribe and bounce totals and rates.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.workflows.statistics({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The workflow id. |

GET /v2/workflows/\{id}/average\_report

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| any[] \| Record<string, any> \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   sent?: number | null,
>   opened?: number | null,
>   clicked?: number | null,
>   unsubscribed?: number | null,
>   bounced?: number | null,
>   open_rate?: number | null,
>   click_rate?: number | null,
>   unsubscribe_rate?: number | null,
>   bounce_rate?: number | null
> } | null
> ```

***

### steps

`workflows.steps`

Get a workflow's steps (trigger, delays, emails, conditions), each with its parent\_id, a batch at a time: pass next\_batch as batch\_no for the next one.

**Risk:** `read`

```ts theme={null}
await corsair.sender.api.workflows.steps({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The workflow id. |
| `batch_no` | `number` | No | Batch index from 0; the response gives next\_batch when there is more. |

GET /v2/workflows/\{id}/steps

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string | number,
>   workflow_id?: string | number | null,
>   parent_id?: string | number | null,
>   type?: string | null,
>   trigger_type?: string | null,
>   delay_type?: string | null,
>   condition_path?: any,
>   complete?: boolean | null,
>   active_subscribers_count?: number | null,
>   thumbnail_url?: string | null,
>   trigger_definition?: Record<string, any> | null,
>   children?: any[] | null
> }[]
> ```

***


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