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

# SMTP2GO API reference

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

## Activity

### search

`activity.search`

Search delivery activity events (processed, delivered, bounced, opened, clicked and more) by date, address, subject or username, with equals/contains/not\_\* operators; 100 items by default, up to 1,000 per call, continue\_token for more

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.activity.search({ event_types: ['delivered', 'opened'], search_subject: 'receipt', limit: 100, region: 'eu' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_date` | `string` | No | — |
| `end_date` | `string` | No | — |
| `search` | `string` | No | — |
| `search_email_id` | `string` | No | — |
| `search_subject` | `string` | No | — |
| `search_subject_op` | `equals \| contains \| not_equals \| not_contains` | No | How search\_subject compares; SMTP2GO defaults to contains. |
| `search_sender` | `string` | No | — |
| `search_sender_op` | `equals \| contains \| not_equals \| not_contains` | No | How search\_sender compares; SMTP2GO defaults to contains. |
| `search_recipient` | `string` | No | — |
| `search_recipient_op` | `equals \| contains \| not_equals \| not_contains` | No | How search\_recipient compares; SMTP2GO defaults to contains. |
| `search_usernames` | `string[]` | No | Only events for emails sent by these SMTP usernames. |
| `only_latest_by_sent` | `boolean` | No | Only the latest event per email, ordered by sent date (overrides only\_latest). |
| `custom_headers` | `string[]` | No | Header names to parse out of each email's raw headers. |
| `event_types` | `string[]` | No | Event types to keep: 'processed', 'soft-bounced', 'hard-bounced', 'rejected', 'spam', 'delivered', 'unsubscribed', 'resubscribed', 'opened', 'clicked'. |
| `limit` | `number` | No | SMTP2GO defaults to 100 and allows up to 1000 per call. |
| `continue_token` | `string` | No | — |
| `only_latest` | `boolean` | No | — |
| `include_headers` | `boolean` | No | — |
| `region` | `us \| eu \| au` | No | Read activity from one region instead of the account default. |
| `subaccounts` | `string[]` | No | Subaccount ids to include. |

Returns at most 1000 events per call; `total_events` is the full match
count. The endpoint is documented at 60 requests per minute.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   events: {
>     email_id?: string | null,
>     event?: string | null,
>     date?: string | null,
>     from?: string | null,
>     sender?: string | null,
>     recipient?: string | null,
>     to?: string | null,
>     bcc?: string | null,
>     subject?: string | null,
>     username?: string | null,
>     subaccount_name?: string | null,
>     smtp_response?: string | null,
>     host?: string | null,
>     headers?: string | null,
>     custom_headers?: Record<string, any> | null
>   }[],
>   total_events?: number | null,
>   continue_token?: string | null
> }
> ```

***

## Allowed Recipients

### add

`allowedRecipients.add`

Add allowed recipients: add one or more email addresses and domain names to your Allowed Recipients List. Further details of the associated setting are found in the SMTP2GO Guides.

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.allowedRecipients.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowed_recipients` | `string[]` | Yes | Array of email addresses and domain names. |
| `enabled` | `boolean` | No | A flag indicating if this list is taken into account when sending |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_recipients?: string[] | null,
>   enabled?: boolean | null
> } | null
> ```

***

### list

`allowedRecipients.list`

View allowed recipients: returns the email addresses and domain names on your Allowed Recipients list.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.allowedRecipients.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_recipients?: string[] | null,
>   enabled?: boolean | null
> } | null
> ```

***

### remove

`allowedRecipients.remove`

Remove allowed recipients: remove one or more emails addresses or domain names stored in your Allowed Recipients List. Note: In the event that any of the email addresses or domains do not feature…

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.allowedRecipients.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowed_recipients` | `string[]` | Yes | Array of email addresses and domain names to remove. |
| `enabled` | `boolean` | No | A flag indicating if this list is taken into account when sending |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_recipients?: string[] | null,
>   enabled?: boolean | null
> } | null
> ```

***

### update

`allowedRecipients.update`

Update allowed recipients: replace the email addresses and domain names on your Allowed Recipients List using this endpoint. Further details of these modes are found in the SMPT2GO Guides. Note… (replaces the whole list)

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.allowedRecipients.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowed_recipients` | `string[]` | Yes | Array of email addresses and domain names. |
| `enabled` | `boolean` | Yes | A flag indicating if this list should be taken into account when sending |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_recipients?: string[] | null,
>   enabled?: boolean | null
> } | null
> ```

***

## Allowed Senders

### add

`allowedSenders.add`

Add allowed senders: add one or more email addresses and domain names to your Allowed or Restricted Senders List. How this list of email addresses and domain names are used is shown by the…

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.allowedSenders.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowed_senders` | `string[]` | Yes | Array of email addresses and domain names. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_senders?: string[] | null,
>   mode?: string | null
> } | null
> ```

***

### list

`allowedSenders.list`

View allowed senders: returns the email addresses and domain names on your Allowed or Restricted Senders list, as well as the Restrict Senders setting, which dictates how they are interpreted.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.allowedSenders.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_senders?: string[] | null,
>   mode?: string | null
> } | null
> ```

***

### remove

`allowedSenders.remove`

Remove allowed senders: remove one or more emails addresses or domain names stored in your Allowed or Restricted Senders List. Note: In the event that any of the email addresses or domains do…

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.allowedSenders.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowed_senders` | `string[]` | Yes | Array of email addresses and domain names to remove. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_senders?: string[] | null,
>   mode?: string | null
> } | null
> ```

***

### update

`allowedSenders.update`

Update allowed senders: replace the email addresses and domain names on your Allowed or Restricted Senders List using this endpoint. How the email addresses and domain names are used is… (replaces the whole list)

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.allowedSenders.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `allowed_senders` | `string[]` | Yes | Array of email addresses and domain names. |
| `mode` | `whitelist \| blacklist \| disabled` | Yes | A string indicating how the list of email address and domain names is interpreted. and should be one of 'whitelist', 'blacklist' or 'disabled'.Warning: Changing the mode to 'whitelist' or… |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   allowed_senders?: string[] | null,
>   mode?: string | null
> } | null
> ```

***

## Api Keys

### add

`apiKeys.add`

Add a new API key: add a new API key to your accountThis endpoint is rate-limited to 5 requests per minute. (mints a new credential)

**Risk:** `destructive`

```ts theme={null}
await corsair.smtp2go.api.apiKeys.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `description` | `string` | No | A comment or description of your new API key |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. |
| `custom_ratelimit_value` | `number` | No | If passed, defines the limit of emails this user can send in the period specified in custom\_ratelimit\_period.Note: Only stores this value if custom\_ratelimit is true. |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value.Syntax: "\ \[hour\[s]\|day\[s]\|week\[s]\|month\[s]] \[hh:mm:ss]".Examples:… |
| `ip_pool` | `number` | No | If passed, any emails sent with this API key will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this API key. |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this API key. |
| `archive_enabled` | `boolean` | No | If true, archiving (available on paid plans) will be enabled for this API key. |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this API key. |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | The initial status of the API key, one of \['allowed', 'blocked', 'sandbox']. |
| `endpoints` | `string[]` | No | An array of endpoints that this API key will be allowed to use.The endpoints passed must be a subset of the endpoints allowed by the API key making this call.A full list of endpoints can be found in… |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   api_key?: string | null,
>   username?: string | null,
>   description?: string | null,
>   status?: string | null,
>   sending_status?: string | null,
>   endpoints?: string[] | null,
>   bounce_notifications?: string | null,
>   default_ratelimit_period?: string | null
> } | null
> ```

***

### edit

`apiKeys.edit`

Edit an API key: edit an existing API key

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.apiKeys.edit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the existing API key you wish to edit. |
| `description` | `string` | No | A comment or description of your new API key |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. |
| `custom_ratelimit_value` | `number` | No | If passed, defines the limit of emails this user can send in the period specified in custom\_ratelimit\_period.Note: Only stores this value if custom\_ratelimit is true. |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value.Syntax: "\ \[hour\[s]\|day\[s]\|week\[s]\|month\[s]] \[hh:mm:ss]".Examples:… |
| `ip_pool` | `number` | No | If passed, any emails sent with this API key will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this API key. |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this API key. |
| `archive_enabled` | `boolean` | No | If true, archiving (available on paid plans) will be enabled for this API key. |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this API key. |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | The initial status of the API key, one of \['allowed', 'blocked', 'sandbox']. |
| `endpoints` | `string[]` | No | An array of endpoints that this API key will be allowed to use.Any additional endpoints passed must be a subset of the endpoints allowed by the API key making this call.A full list of endpoints can… |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   api_key?: string | null,
>   username?: string | null,
>   description?: string | null,
>   status?: string | null,
>   sending_status?: string | null,
>   endpoints?: string[] | null,
>   bounce_notifications?: string | null,
>   default_ratelimit_period?: string | null
> } | null
> ```

***

### list

`apiKeys.list`

View API Keys: retrieve a list of API keys on this account

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.apiKeys.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | No | A full API key to retrieve the information for. |
| `search` | `string` | No | A search keyword used to refine the results. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   api_key?: string | null,
>   username?: string | null,
>   description?: string | null,
>   custom_rate_limit?: boolean | null,
>   custom_ratelimit_value?: number | null,
>   custom_ratelimit_period?: string | null,
>   default_ratelimit_value?: string | null,
>   default_ratelimit_period?: string | null,
>   ippool?: number | null,
>   feedback_enabled?: boolean | null,
>   feedback_html?: string | null,
>   feedback_text?: string | null,
>   open_tracking_enabled?: boolean | null,
>   click_tracking_enabled?: boolean | null,
>   archive_enabled?: boolean | null,
>   audit_email?: string | null,
>   bounce_notifications?: string | null,
>   status?: string | null,
>   sending_status?: string | null,
>   endpoints?: any[] | null
> }[] | null
> ```

***

### patch

`apiKeys.patch`

Patch an API key: patch an existing API key ignoring missing properties

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.apiKeys.patch({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the existing API key you wish to edit. |
| `description` | `string` | No | A comment or description of your new API key |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. |
| `custom_ratelimit_value` | `number` | No | If passed, defines the limit of emails this user can send in the period specified in custom\_ratelimit\_period.Note: Only stores this value if custom\_ratelimit is true. |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value.Syntax: "\ \[hour\[s]\|day\[s]\|week\[s]\|month\[s]] \[hh:mm:ss]".Examples:… |
| `ip_pool` | `number` | No | If passed, any emails sent with this API key will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this API key. |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this API key. |
| `archive_enabled` | `boolean` | No | If true, archiving (available on paid plans) will be enabled for this API key. |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this API key. |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | The initial status of the API key, one of \['allowed', 'blocked', 'sandbox']. |
| `endpoints` | `string[]` | No | An array of endpoints that this API key will be allowed to use.Any additional endpoints passed must be a subset of the endpoints allowed by the API key making this call.A full list of endpoints can… |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   api_key?: string | null,
>   username?: string | null,
>   description?: string | null,
>   status?: string | null,
>   sending_status?: string | null,
>   endpoints?: string[] | null,
>   bounce_notifications?: string | null,
>   default_ratelimit_period?: string | null
> } | null
> ```

***

### permissions

`apiKeys.permissions`

View Permissions: retrieve a list of endpoints this API Key can use. This endpoint is available to all API Keys.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.apiKeys.permissions({});
```

**Input:** *empty object*

**Output**

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

***

### remove

`apiKeys.remove`

Remove an API key: remove an existing API key (revokes the key)

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

```ts theme={null}
await corsair.smtp2go.api.apiKeys.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the existing API key you wish to remove. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `any \| null` | No | — |

***

## Archive

### getEmail

`archive.getEmail`

View an archived email: fetch an archived email using the email\_id

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.archive.getEmail({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_id` | `string` | Yes | The unique email\_id of the archived email you wish to retrieve |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   attachment_count?: number | null,
>   attachments?: any[] | null,
>   byte_count?: number | null,
>   email_id?: string | null,
>   envelope_from?: string | null,
>   headers?: string | null,
>   recipient?: string | null,
>   sender?: string | null,
>   sent?: string | null,
>   subject?: string | null,
>   to?: string | null,
>   url?: string | null,
>   username?: string | null
> } | null
> ```

***

### search

`archive.search`

Search archived content: retrieve a list of up to 5,000 archived emails matching the supplied parameters.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.archive.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_date` | `string` | No | ISO-8601 formatted datetime which defaults to current date at midnight. The range will be inclusive of start\_date and exclusive of end\_date. Timezone is UTC. |
| `end_date` | `string` | No | ISO-8601 formatted datetime which defaults to now. Timezone is UTC. |
| `limit` | `number` | No | The maximum number of emails to return (Default: 5,000) |
| `username` | `string` | No | If passed, only return email details sent by this user |
| `recipient` | `string` | No | If passed, only return emails with this recipient |
| `sender` | `string` | No | If passed, only return emails with this sender |
| `envelope_from` | `string` | No | If passed, only return emails with this envelope\_from |
| `subject` | `string` | No | If passed, only return emails with this subject |
| `headers` | `string` | No | If passed, only return emails with this substring in the headers |
| `continue_token` | `string` | No | If passed, will continue the previous search if too many results were found. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `request_id` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   email_count?: number | null,
>   emails?: {
>     attachment_count?: number | null,
>     attachments?: any[] | null,
>     byte_count?: number | null,
>     email_id?: string | null,
>     envelope_from?: string | null,
>     headers?: string | null,
>     recipient?: string | null,
>     sender?: string | null,
>     sent?: string | null,
>     subject?: string | null,
>     to?: string | null,
>     url?: string | null,
>     username?: string | null
>   }[] | null
> } | null
> ```

***

## Dedicated Ips

### list

`dedicatedIps.list`

View Dedicated IP Addresses: retrieve a list of Dedicated IP addresses on this account

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.dedicatedIps.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   ip_pools?: Record<string, any>[] | null
> } | null
> ```

***

## Domains

### add

`domains.add`

Add a sender domain and get the DNS records to publish; verification starts right away unless auto\_verify is false

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.domains.add({ domain: 'example.com', auto_verify: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | The sender domain to add, such as example.com. |
| `auto_verify` | `boolean` | No | Defaults to true: verification is attempted right away. |
| `requisition_ssl` | `boolean` | No | Defaults to true: an SSL requisition is created for the tracking subdomain. |
| `subaccount_id` | `string` | No | — |

The answer contains the DNS records to publish (DKIM, return-path and
CNAME). Verification starts right away unless `auto_verify` is false.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   domains: {
>     domain?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       dkim_selector?: string | null,
>       dkim_verified?: boolean | null,
>       dkim_status?: string | null,
>       dkim_value?: string | null,
>       rpath_selector?: string | null,
>       rpath_verified?: boolean | null,
>       rpath_status?: string | null,
>       rpath_value?: string | null,
>       setup_link?: string | null
>     } | null,
>     trackers?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       cname_verified?: boolean | null,
>       cname_status?: string | null,
>       cname_value?: string | null,
>       enabled?: boolean | null
>     }[] | null,
>     subaccount_access?: {
>       subaccounts?: string[] | null,
>       future_subaccounts?: boolean | null
>     } | null
>   }[]
> }
> ```

***

### editReturnPath

`domains.editReturnPath`

Edit the return-path subdomain: a Return Path Subdomain is used to instruct the server where to return emails that are not deliverable (ie. Bounces). This endpoint allows you to edit a Return Path…

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.domains.editReturnPath({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | The sender domain to edit the return-path subdomain for |
| `old_subdomain` | `string` | Yes | The domains old return-path subdomain |
| `new_subdomain` | `string` | Yes | The domains new return-path subdomain |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   domains?: {
>     domain?: {
>       dkim_value?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       rpath_selector?: string | null,
>       rpath_status?: string | null,
>       rpath_verified?: boolean | null,
>       rpath_value?: string | null,
>       dkim_status?: string | null,
>       dkim_verified?: boolean | null,
>       subdomain?: any | null,
>       fulldomain?: string | null,
>       dkim_selector?: string | null
>     } | null,
>     trackers?: {
>       cname_value?: string | null,
>       cname_status?: string | null,
>       cname_verified?: boolean | null,
>       domain?: string | null,
>       suffix?: string | null,
>       subdomain?: string | null,
>       enabled?: boolean | null,
>       fulldomain?: string | null
>     }[] | null,
>     subaccount_access?: {
>       subaccounts?: any[] | null,
>       future_subaccounts?: boolean | null
>     } | null
>   }[] | null
> } | null
> ```

***

### editSubaccountAccess

`domains.editSubaccountAccess`

Edit subaccount access: allow subaccounts to send from verified sender domains on the master account.

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.domains.editSubaccountAccess({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | The sender domain to edit subaccount access for |
| `subaccounts` | `any[]` | Yes | A list of subaccount\_ids to be given access. ID's can be found by querying /subaccounts/search |
| `future_subaccounts` | `boolean` | No | If set to true, will automatically add any new subaccounts to the access list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string \| null` | No | — |
| `subaccounts` | `any[] \| null` | No | — |
| `future_subaccounts` | `boolean \| null` | No | — |
| `data` | `any \| null` | No | — |

***

### editTracking

`domains.editTracking`

Edit the tracking subdomain: a Tracking Subdomain is used to monitor your email opens and clicks. This endpoint allows you to edit a tracking subdomain for a particular sender domain. Full details…

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.domains.editTracking({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | The sender domain to edit the tracking subdomain for |
| `old_subdomain` | `string` | Yes | The domains old tracking subdomain |
| `new_subdomain` | `string` | Yes | The domains new tracking subdomain |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   domains?: {
>     domain?: {
>       dkim_value?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       rpath_selector?: string | null,
>       rpath_status?: string | null,
>       rpath_verified?: boolean | null,
>       rpath_value?: string | null,
>       dkim_status?: string | null,
>       dkim_verified?: boolean | null,
>       subdomain?: any | null,
>       fulldomain?: string | null,
>       dkim_selector?: string | null
>     } | null,
>     trackers?: {
>       cname_value?: string | null,
>       cname_status?: string | null,
>       cname_verified?: boolean | null,
>       domain?: string | null,
>       suffix?: string | null,
>       subdomain?: string | null,
>       enabled?: boolean | null,
>       fulldomain?: string | null
>     }[] | null,
>     subaccount_access?: {
>       subaccounts?: any[] | null,
>       future_subaccounts?: boolean | null
>     } | null
>   }[] | null
> } | null
> ```

***

### list

`domains.list`

List sender domains with DKIM and return-path verification state and tracking subdomains

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | No | — |
| `subaccount_id` | `string` | No | — |

Each row carries the DKIM and return-path state under `domain` and the
tracking subdomains under `trackers`.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   domains: {
>     domain?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       dkim_selector?: string | null,
>       dkim_verified?: boolean | null,
>       dkim_status?: string | null,
>       dkim_value?: string | null,
>       rpath_selector?: string | null,
>       rpath_verified?: boolean | null,
>       rpath_status?: string | null,
>       rpath_value?: string | null,
>       setup_link?: string | null
>     } | null,
>     trackers?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       cname_verified?: boolean | null,
>       cname_status?: string | null,
>       cname_value?: string | null,
>       enabled?: boolean | null
>     }[] | null,
>     subaccount_access?: {
>       subaccounts?: string[] | null,
>       future_subaccounts?: boolean | null
>     } | null
>   }[]
> }
> ```

***

### remove

`domains.remove`

Remove a sender domain; mail from it stops being accepted and it must be added and verified again

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

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | The sender domain to remove. |
| `subaccount_id` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string` | Yes | — |
| `data` | `object \| null` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   domains: {
>     domain?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       dkim_selector?: string | null,
>       dkim_verified?: boolean | null,
>       dkim_status?: string | null,
>       dkim_value?: string | null,
>       rpath_selector?: string | null,
>       rpath_verified?: boolean | null,
>       rpath_status?: string | null,
>       rpath_value?: string | null,
>       setup_link?: string | null
>     } | null,
>     trackers?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       cname_verified?: boolean | null,
>       cname_status?: string | null,
>       cname_value?: string | null,
>       enabled?: boolean | null
>     }[] | null,
>     subaccount_access?: {
>       subaccounts?: string[] | null,
>       future_subaccounts?: boolean | null
>     } | null
>   }[]
> } | null
> ```

***

### verify

`domains.verify`

Run verification for one sender domain now instead of waiting for the periodic re-check

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | The sender domain to verify. |
| `requisition_ssl` | `boolean` | No | — |
| `subaccount_id` | `string` | No | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   domains: {
>     domain?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       dkim_selector?: string | null,
>       dkim_verified?: boolean | null,
>       dkim_status?: string | null,
>       dkim_value?: string | null,
>       rpath_selector?: string | null,
>       rpath_verified?: boolean | null,
>       rpath_status?: string | null,
>       rpath_value?: string | null,
>       setup_link?: string | null
>     } | null,
>     trackers?: {
>       fulldomain?: string | null,
>       subdomain?: string | null,
>       domain?: string | null,
>       suffix?: string | null,
>       cname_verified?: boolean | null,
>       cname_status?: string | null,
>       cname_value?: string | null,
>       enabled?: boolean | null
>     }[] | null,
>     subaccount_access?: {
>       subaccounts?: string[] | null,
>       future_subaccounts?: boolean | null
>     } | null
>   }[]
> }
> ```

***

## Email

### cancelScheduled

`email.cancelScheduled`

Cancel one queued scheduled email by schedule\_id; the message will not be sent and must be scheduled again to go out

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

```ts theme={null}
await corsair.smtp2go.api.email.cancelScheduled({ schedule_id: '4d3b03a7-8663-4592-899a-b479ba6fcba9' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `schedule_id` | `string` | Yes | The schedule\_id from email.searchScheduled. |

`schedule_id` must be a UUID. The success body is undocumented; confirm
the cancellation with `email.searchScheduled`.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string` | Yes | — |
| `data` | `Record<string, any> \| string \| null` | No | — |

***

### searchScheduled

`email.searchScheduled`

List emails queued by a schedule, filtered by schedule\_id, subject, sender or recipient

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.email.searchScheduled({ limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `schedule_id` | `string` | No | — |
| `search_subject` | `string` | No | — |
| `search_recipient` | `string` | No | — |
| `search_sender` | `string` | No | — |
| `limit` | `number` | No | Defaults to 1000. |
| `page` | `number` | No | — |

The answer's `data` is a bare array of queued messages, not an object.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   schedule_id?: string | null,
>   schedule?: string | null,
>   sender?: string | null,
>   subject?: string | null,
>   recipients?: string | null,
>   client_ip?: string | null
> }[]
> ```

***

### searchSent

`email.searchSent`

Search sent emails by date, recipient, sender, subject or email\_id, with opens, clicks, delivery status and a continue\_token for the next page

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.email.searchSent({ start_date: '2024-01-01', end_date: '2024-02-01', email_id: ['1u0SwL-B9zBpi9ffUq-JAB2'], limit: 100 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_date` | `string` | No | Search window start, such as 2024-01-01 or a full timestamp. |
| `end_date` | `string` | No | — |
| `email_id` | `string[]` | No | Only these emails; this is how a single send is looked up. |
| `limit` | `number` | No | Defaults to 5000. |
| `status_counts` | `boolean` | No | — |
| `opened_only` | `boolean` | No | — |
| `clicked_only` | `boolean` | No | — |
| `ignore_case` | `boolean` | No | — |
| `filter_query` | `string` | No | — |
| `username` | `string` | No | — |
| `headers` | `string[]` | No | Return these email header values on each result. |
| `continue_token` | `string` | No | The continue\_token from the previous page. |

`limit` defaults to and caps at 5000. To look up one send, filter by
`email_id`; there is no per-email status endpoint (`/email/status/{id}`
answers 404). `continue_token` is null on the last page.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   count?: number | null,
>   emails: {
>     email_id?: string | null,
>     sender?: string | null,
>     recipient?: string | null,
>     subject?: string | null,
>     status?: string | null,
>     process_status?: string | null,
>     smtpcode?: number | null,
>     response?: string | null,
>     host?: string | null,
>     delivered_at?: string | null,
>     sent_at?: string | null,
>     total_opens?: number | null,
>     total_clicks?: number | null,
>     opens?: {
>       user_agent?: string | null,
>       opened_at?: string | null,
>       read_secs?: string | null,
>       recipient?: string | null,
>       ip_address?: string | null
>     }[] | null
>   }[],
>   continue_token?: string | null
> }
> ```

***

### send

`email.send`

Send one email to up to 100 recipients, with HTML or plain text, a template, attachments, custom headers, or a schedule up to 3 days out; the result counts succeeded and failed recipients at HTTP 200, so check failed, not the status

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

```ts theme={null}
await corsair.smtp2go.api.email.send({ sender: 'John Smith <john@example.com>', to: ['Jane Jones <jane@example.com>'], subject: 'Your receipt', text_body: 'Thanks for your order.', custom_headers: [{ header: 'Reply-To', value: 'support@example.com' }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sender` | `string` | Yes | The sender, in `Name <name@example.com>` format. |
| `to` | `string[]` | Yes | Up to 100 recipients. Each recipient counts against the plan quota. |
| `cc` | `string[]` | No | — |
| `bcc` | `string[]` | No | — |
| `subject` | `string` | No | Optional despite the docs saying required: the server does not enforce it. |
| `html_body` | `string` | No | — |
| `text_body` | `string` | No | — |
| `custom_headers` | `object[]` | No | Content-Type, Content-Transfer-Encoding and MIME-Version cannot be overridden. |
| `attachments` | `object[]` | No | — |
| `inlines` | `object[]` | No | Inline images referenced by the HTML body via cid: URLs. |
| `template_id` | `string` | No | — |
| `template_data` | `Record<string, any> \| string` | No | Template variables, e.g. \{ name: "Ada" } (a JSON-encoded string is accepted too). |
| `schedule` | `string` | No | Schedule the send, in `YYYY-MM-DD HH:mm:ss +ZZZZ` format, less than 3 days out. |
| `fastaccept` | `boolean` | No | Accept the message without delivery results; defaults to false, which waits for per-recipient outcomes. |

Sends real email. The plugin requires one of `text_body`, `html_body` or
`template_id` before spending the call; SMTP2GO enforces the same rule
server-side. `subject` is optional despite the docs saying required
(verified live). Every To/CC/BCC recipient counts as one email against the
plan quota. The answer carries `succeeded` and `failed` counts at HTTP
200, plus a `failures` entry per rejected recipient, so check `failed`
rather than the status code.

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

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   filename: string,
>   fileblob?: string,
>   url?: string,
>   mimetype?: string
> }[]
> ```

> [accordion] inlines full type
>
> ```ts theme={null}
> {
>   filename: string,
>   fileblob?: string,
>   url?: string,
>   mimetype?: string
> }[]
> ```

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   succeeded?: number | null,
>   failed?: number | null,
>   failures?: (string | Record<string, any>)[] | null,
>   email_id?: string | null,
>   schedule_id?: string | null
> }
> ```

***

### sendBatch

`email.sendBatch`

Send up to 1000 independent messages in one call; the answer carries one email\_id or schedule\_id entry per message

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

```ts theme={null}
await corsair.smtp2go.api.email.sendBatch({ emails: [{ sender: 'john@example.com', to: ['jane@example.com'], subject: 'Receipt 1', text_body: 'Thanks.' }, { sender: 'john@example.com', to: ['sam@example.com'], subject: 'Receipt 2', text_body: 'Thanks.' }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `emails` | `object[]` | Yes | Up to 1000 messages; each recipient counts against the quota. |

Sends up to 1000 independent messages in one call; the answer's `data` is
a bare array with one entry per message, carrying an `email_id`, or a
`schedule_id` for scheduled messages.

> [accordion] emails full type
>
> ```ts theme={null}
> {
>   sender: string,
>   to: string[],
>   cc?: string[],
>   bcc?: string[],
>   subject?: string,
>   html_body?: string,
>   text_body?: string,
>   custom_headers?: {
>     header: string,
>     value: string
>   }[],
>   attachments?: {
>     filename: string,
>     fileblob?: string,
>     url?: string,
>     mimetype?: string
>   }[],
>   inlines?: {
>     filename: string,
>     fileblob?: string,
>     url?: string,
>     mimetype?: string
>   }[],
>   template_id?: string,
>   template_data?: Record<string, any> | string,
>   schedule?: string,
>   fastaccept?: boolean
> }[]
> ```

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   email_id?: string | null,
>   schedule_id?: string | null
> }[]
> ```

***

### sendMime

`email.sendMime`

Send one pre-encoded MIME message, with the same per-recipient succeeded/failed accounting as email.send

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

```ts theme={null}
await corsair.smtp2go.api.email.sendMime({ mime_email: 'RnJvbTogam9obkBleGFtcGxlLmNvbQ0KVG86IGphbmVAZXhhbXBsZS5jb20NClN1YmplY3Q6IEhpDQpNSU1FLVZlcnNpb246IDEuMA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PXV0Zi04DQoNCkhlbGxvIGZyb20gU01UUDJHTy4=', fastaccept: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mime_email` | `string` | Yes | A complete MIME message (From, To, Subject headers and body), Base64-encoded. |
| `schedule` | `string` | No | Schedule the send, in `YYYY-MM-DD HH:mm:ss +ZZZZ` format, less than 3 days out. |
| `fastaccept` | `boolean` | No | Accept the message without delivery results; defaults to false, which waits for per-recipient outcomes. |

Sends one pre-encoded MIME message with the same `succeeded`/`failed`
accounting as `email.send`.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   succeeded?: number | null,
>   failed?: number | null,
>   failures?: (string | Record<string, any>)[] | null,
>   email_id?: string | null,
>   schedule_id?: string | null
> }
> ```

***

## Ip Auth

### list

`ipAuth.list`

View IP Auth: returns a list of all IP Auth entries that are managed by this account, or details of a specific IP Auth, when you include the \[ip\_address] in your request. If no…

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.ipAuth.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ip_address` | `string` | No | If passed, a valid ip address of an existing IP Auth entry that you wish to view |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   ip_address?: string | null,
>   description?: string | null,
>   status?: string | null
> }[] | null
> ```

***

### patch

`ipAuth.patch`

Patch an IP Auth: patch an existing IP Auth ignoring missing properties

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.ipAuth.patch({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ip_address` | `string` | Yes | A valid IP address of your existing IP Auth that you wish to edit |
| `description` | `string` | No | A comment or description of the IP Auth |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. |
| `custom_ratelimit_value` | `number` | No | If passed, defines the limit of emails this user can send in the period specified in custom\_ratelimit\_period.Note: Only stores this value if custom\_ratelimit is true. |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value.Syntax: "\ \[hour\[s]\|day\[s]\|week\[s]\|month\[s]] \[hh:mm:ss]".Examples:… |
| `ip_pool` | `number` | No | If passed, any emails sent with this IP Auth will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this IP Auth user. |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this IP Auth. |
| `archive_enabled` | `boolean` | No | If true, archiving (available on paid plans) will be enabled for this IP Auth. |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this IP Auth. |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | The initial status of the IP Auth user, one of \['allowed', 'blocked', 'sandbox']. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   ip_address?: string | null,
>   description?: string | null,
>   custom_rate_limit?: boolean | null,
>   custom_ratelimit_value?: number | null,
>   custom_ratelimit_period?: string | null,
>   default_ratelimit_value?: string | null,
>   default_ratelimit_period?: string | null,
>   ippool?: number | null,
>   feedback_enabled?: boolean | null,
>   feedback_html?: string | null,
>   feedback_text?: string | null,
>   open_tracking_enabled?: boolean | null,
>   click_tracking_enabled?: boolean | null,
>   archive_enabled?: boolean | null,
>   audit_email?: string | null,
>   bounce_notifications?: string | null,
>   status?: string | null
> }[] | null
> ```

***

### remove

`ipAuth.remove`

Remove an IP Auth entry: remove an IP Auth entry from your account (the IP can no longer send)

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

```ts theme={null}
await corsair.smtp2go.api.ipAuth.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ip_address` | `string` | Yes | A valid ip address of an existing IP Auth entry that you wish to remove |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `any \| null` | No | — |

***

## Single Senders

### add

`singleSenders.add`

Add a single sender email: use the API to add a single sender email address to your account, to use from which to send mail. If the email address has previously been added and not yet verified,… (emails a verification link to the address)

**Risk:** `destructive`

```ts theme={null}
await corsair.smtp2go.api.singleSenders.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | The email address that you wish to send emails from |
| `message` | `string` | No | (Optional) If provided, will add a text only message to the email. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `any \| null` | No | — |

***

### list

`singleSenders.list`

View single sender emails: returns a list of single sender email addresses on your account, along with their verification status. If you include a email\_address, the response will only include…

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.singleSenders.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | No | (Optional) If provided, only return email addresses that match value |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   request_id?: string | null,
>   senders?: {
>     email_address?: string | null,
>     verified?: boolean | null
>   }[] | null
> } | null
> ```

***

### remove

`singleSenders.remove`

Remove a single sender email: remove a single sender email address from your account. Include the address to remove as the email\_address parameter. (the address must be verified again)

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

```ts theme={null}
await corsair.smtp2go.api.singleSenders.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | The email address to remove from your Single Sender Emails |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

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

***

## Sms

### listReceived

`sms.listReceived`

View received SMS: view received SMS messages.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.sms.listReceived({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_date` | `string` | No | ISO-8601 formatted datetime which defaults to 7 days ago at midnight. The range will be inclusive of start\_date and exclusive of end\_date. Timezone is UTC. |
| `end_date` | `string` | No | ISO-8601 formatted datetime which defaults to now. Timezone is UTC. |
| `unix_start` | `number` | No | Deprecated: this is a legacy method of selecting the start of the search period as a unix timestamp. This can be left empty to use the start\_date. |
| `unix_end` | `number` | No | Deprecated: this is a legacy method of selecting the end of the search period as a unix timestamp. This can be left empty to use the end\_date. |
| `username` | `string` | No | If passed will filter the results based on the username information on the message |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   request_id?: string | null,
>   messages?: {
>     source_address?: string | null,
>     destination_address?: string | null,
>     timestamp?: string | null,
>     content?: string | null,
>     message_id?: string | null,
>     username?: string | null
>   }[] | null
> } | null
> ```

***

### listSent

`sms.listSent`

View sent SMS: view sent SMS messages.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.sms.listSent({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_date` | `string` | No | ISO-8601 formatted datetime which defaults to 7 days ago at midnight. The range will be inclusive of start\_date and exclusive of end\_date. Timezone is UTC. |
| `end_date` | `string` | No | ISO-8601 formatted datetime which defaults to now. Timezone is UTC. |
| `username` | `string` | No | If passed will filter the results based on the username information on the message |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   request_id?: string | null,
>   messages?: {
>     id?: string | null,
>     timestamp?: string | null,
>     username?: string | null,
>     sender?: string | null,
>     sender_email?: string | null,
>     destination_address?: string | null,
>     destination_address_county?: string | null,
>     format?: string | null,
>     status?: string | null,
>     content?: string | null,
>     units?: number | null
>   }[] | null
> } | null
> ```

***

### send

`sms.send`

Send SMS: send an SMS message to one or more numbers, up to a maximum of 100 numbers. (sends text messages and spends SMS credit)

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

```ts theme={null}
await corsair.smtp2go.api.sms.send({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `destination` | `string[]` | Yes | An array of SMS numbers to send the message to (Maximum: 100 numbers). Numbers should include the country code of the recipient, and can optionally start with a plus symbol (+). |
| `sender` | `string` | No | The message will be sent from this number or sender-id (numbers must be in e.164 format). If left empty or the source and destination are located in different countries, we will attempt to use one… |
| `content` | `string` | Yes | The content of the SMS. If more than 160 characters, will be sent as multiple units. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `request_id` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   statuses?: {
>     queued?: number | null
>   } | null,
>   total_sent?: number | null,
>   messages?: {
>     destination?: string | null,
>     message_id?: string | null,
>     status?: string | null
>   }[] | null
> } | null
> ```

***

### summary

`sms.summary`

SMS Summary: retrieve a summary of SMS messages within a certain time range.

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.sms.summary({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_date` | `string` | No | ISO-8601 formatted datetime which defaults to current date at midnight. The range will be inclusive of start\_date and exclusive of end\_date. Timezone is UTC. |
| `end_date` | `string` | No | ISO-8601 formatted datetime which defaults to now. Timezone is UTC. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `request_id` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   total_messages?: number | null,
>   total_units?: number | null,
>   total_cost?: number | null,
>   subaccounts?: {
>     subaccount_id?: string | null,
>     total_messages?: number | null,
>     total_units?: number | null,
>     total_cost?: number | null
>   }[] | null
> } | null
> ```

***

## Smtp Users

### add

`smtpUsers.add`

Add an SMTP user: add a new SMTP user to your account. Full details of the available options for new user accounts can be found in the SMTP User Guide.

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.smtpUsers.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | A username to access the SMTP2GO service via SMTP. Length = 5 to 100 |
| `email_password` | `string` | No | A valid password for your new SMTP User. Must have an entropy of at least 64 bits. Consider using a password generator or leave blank for an auto generated value. Ideally contain at least: 12… |
| `description` | `string` | No | A comment or description of your new SMTP User |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. Default: false |
| `custom_ratelimit_value` | `number` | No | If passed, defines the limit of emails this user can send in the period specified in custom\_ratelimit\_period.Note: Only stores this value if custom\_ratelimit is true. |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value.Syntax: "\ \[hour\[s]\|day\[s]\|week\[s]\|month\[s]] \[hh:mm:ss]".Examples:… |
| `ip_pool` | `number` | No | If passed, any emails sent with this SMTP user will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. Default: false |
| `feedback_domain` | `string` | No | The domain to insert into the custom feedback links via the unsubscribe footer. Default: blankWarning: In order to use the SMTP2go feedback handling feature, this parameter needs to be set to… |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer. Default: blank System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address =… |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer. Default: blankSystem Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address =… |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this user. Default: false |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this user. Default: false |
| `archive_enabled` | `boolean` | No | If true, archiving (available on paid plans) will be enabled for this user. Default: false. |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this SMTP User |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | The initial status of the SMTP user, one of \['allowed', 'blocked', 'sandbox'], defaults to 'allowed' |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   results?: {
>     comments?: string | null,
>     username?: string | null,
>     email_password?: string | null,
>     sending_allowed?: boolean | null,
>     custom_ratelimit?: boolean | null,
>     custom_ratelimit_value?: number | null,
>     custom_ratelimit_period?: string | null,
>     default_ratelimit_value?: string | null,
>     default_ratelimit_period?: string | null,
>     ippool?: number | null,
>     description?: string | null,
>     feedback_enabled?: boolean | null,
>     feedback_domain?: string | null,
>     feedback_html?: string | null,
>     feedback_text?: string | null,
>     archive_enabled?: boolean | null,
>     open_tracking_enabled?: boolean | null,
>     audit_email?: string | null,
>     bounce_notifications?: string | null
>   }[] | null
> } | null
> ```

***

### edit

`smtpUsers.edit`

Edit SMTP user details: update an SMTP user's details with the parameters passed. Full details of the available options for SMTP user accounts is found in the SMTP User Guide.

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.smtpUsers.edit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | A valid username of your existing SMTP User that you wish to edit |
| `email_password` | `string` | No | A valid password for your new SMTP User. Must have an entropy of at least 64 bits. Consider using a password generator or leave blank for an auto generated value. Ideally contain at least: 12… |
| `description` | `string` | No | A comment or description of your new SMTP User |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. |
| `custom_ratelimit_value` | `number` | No | If passed, defines the maximum number of emails this user can send in the custom\_ratelimit\_period. Values: 1 to 2147483647 |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value. Syntax: " \{hour\[s]\|day\[s]\|week\[s]\|month\[s]}\[,hh:mm:ss]". Examples: "1… |
| `ip_pool` | `number` | No | If passed, any emails sent with this SMTP user will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. Default: false |
| `feedback_domain` | `string` | No | The domain to insert into the custom feedback links via the unsubscribe footer |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this user. Default: false |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this user. Default: false |
| `archive_enabled` | `boolean` | No | If true, archiving will be enabled for this user. Default: false |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this SMTP User |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | If passed will set the status of the SMTP user, one of \['allowed', 'blocked', 'sandbox'] |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   results?: {
>     comments?: string | null,
>     username?: string | null,
>     email_password?: string | null,
>     sending_allowed?: boolean | null,
>     custom_ratelimit?: boolean | null,
>     custom_ratelimit_value?: number | null,
>     custom_ratelimit_period?: string | null,
>     default_ratelimit_value?: string | null,
>     default_ratelimit_period?: string | null,
>     ippool?: number | null,
>     description?: string | null,
>     feedback_enabled?: boolean | null,
>     feedback_domain?: string | null,
>     feedback_html?: string | null,
>     feedback_text?: string | null,
>     archive_enabled?: boolean | null,
>     open_tracking_enabled?: boolean | null,
>     audit_email?: string | null,
>     bounce_notifications?: string | null
>   }[] | null
> } | null
> ```

***

### list

`smtpUsers.list`

View SMTP users: returns a list of all SMTP users that are managed by this account, or details of a specific user, when you include the \[username] in your request. If no users are…

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.smtpUsers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | No | If passed, a valid SMTP2GO username of your existing SMTP User that you wish to view |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   results?: {
>     comments?: string | null,
>     username?: string | null,
>     email_password?: string | null,
>     sending_allowed?: boolean | null,
>     custom_ratelimit?: boolean | null,
>     custom_ratelimit_value?: number | null,
>     custom_ratelimit_period?: string | null,
>     default_ratelimit_value?: string | null,
>     default_ratelimit_period?: string | null,
>     ippool?: number | null,
>     description?: string | null,
>     feedback_enabled?: boolean | null,
>     feedback_domain?: string | null,
>     feedback_html?: string | null,
>     feedback_text?: string | null,
>     archive_enabled?: boolean | null,
>     open_tracking_enabled?: boolean | null,
>     audit_email?: string | null,
>     bounce_notifications?: string | null
>   }[] | null
> } | null
> ```

***

### patch

`smtpUsers.patch`

Patch an SMTP user: patch an existing SMTP user ignoring missing properties

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.smtpUsers.patch({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | A valid username of your existing SMTP User that you wish to edit |
| `email_password` | `string` | No | A valid SMTP2GO password for your existing SMTP User. Must have an entropy of at least 64 bits. Consider using a password generator or leave blank for an auto generated value. |
| `description` | `string` | No | A comment or description of the SMTP user |
| `custom_ratelimit` | `boolean` | No | If true, a custom rate limit will be enabled for this user, and defined by the custom\_ratelimit\_value and custom\_ratelimit\_period. |
| `custom_ratelimit_value` | `number` | No | If passed, defines the limit of emails this user can send in the period specified in custom\_ratelimit\_period.Note: Only stores this value if custom\_ratelimit is true. |
| `custom_ratelimit_period` | `string` | No | If passed, defines the period for which this user will be limited to the number of emails specified in custom\_ratelimit\_value.Syntax: "\ \[hour\[s]\|day\[s]\|week\[s]\|month\[s]] \[hh:mm:ss]".Examples:… |
| `ip_pool` | `number` | No | If passed, any emails sent with this API key will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |
| `feedback_enabled` | `boolean` | No | If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings. |
| `feedback_html` | `string` | No | The HTML content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `feedback_text` | `string` | No | The text content to insert into the custom feedback email body via the unsubscribe footer.System Variables (Only available here):Unsubscribe URL = %%UNSUBSCRIBE%% Email address = %%EMAIL%% |
| `open_tracking_enabled` | `boolean` | No | If true, open tracking will be enabled for this SMTP user. |
| `click_tracking_enabled` | `boolean` | No | If true, click tracking will be enabled for this SMTP user. |
| `archive_enabled` | `boolean` | No | If true, archiving (available on paid plans) will be enabled for this SMTP user. |
| `audit_email` | `string` | No | If passed, this email will be BCC'd on all emails sent by this SMTP user. |
| `bounce_notifications` | `string` | No | If passed, will control how bounce notifications are handled. Must be one of \[from, drop, or a valid email address]. \[from] will return the email to sender, \[drop] will discard the event, and the… |
| `status` | `string` | No | The initial status of the SMTP user, one of \['allowed', 'blocked', 'sandbox']. |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   results?: {
>     comments?: string | null,
>     username?: string | null,
>     email_password?: string | null,
>     sending_allowed?: boolean | null,
>     custom_ratelimit?: boolean | null,
>     custom_ratelimit_value?: number | null,
>     custom_ratelimit_period?: string | null,
>     default_ratelimit_value?: string | null,
>     default_ratelimit_period?: string | null,
>     ippool?: number | null,
>     description?: string | null,
>     feedback_enabled?: boolean | null,
>     feedback_domain?: string | null,
>     feedback_html?: string | null,
>     feedback_text?: string | null,
>     archive_enabled?: boolean | null,
>     open_tracking_enabled?: boolean | null,
>     audit_email?: string | null,
>     bounce_notifications?: string | null
>   }[] | null
> } | null
> ```

***

### remove

`smtpUsers.remove`

Remove an SMTP user: remove an SMTP user from your account (deletes the SMTP login)

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

```ts theme={null}
await corsair.smtp2go.api.smtpUsers.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | A valid SMTP2GO username of your existing SMTP User that you wish to remove |
| `subaccount_id` | `string` | No | If you wish to make this API call on behalf of a subaccount then include its unique ID here |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   results?: {
>     comments?: string | null,
>     username?: string | null,
>     email_password?: string | null,
>     sending_allowed?: boolean | null,
>     custom_ratelimit?: boolean | null,
>     custom_ratelimit_value?: number | null,
>     custom_ratelimit_period?: string | null,
>     default_ratelimit_value?: string | null,
>     default_ratelimit_period?: string | null,
>     ippool?: number | null,
>     description?: string | null,
>     feedback_enabled?: boolean | null,
>     feedback_domain?: string | null,
>     feedback_html?: string | null,
>     feedback_text?: string | null,
>     archive_enabled?: boolean | null,
>     open_tracking_enabled?: boolean | null,
>     audit_email?: string | null,
>     bounce_notifications?: string | null
>   }[] | null
> } | null
> ```

***

## Stats

### bounces

`stats.bounces`

Read bounce counts (hard, soft, rejects) over the last 30 days or a given window, per SMTP user or account-wide

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.stats.bounces({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | No | Restrict to one SMTP user; defaults to the whole account. |

Percent fields are strings, such as `0.00`. Defaults to the last 30 days.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emails?: number | null,
>   hardbounces?: number | null,
>   softbounces?: number | null,
>   rejects?: number | null,
>   bounce_percent?: string | null
> }
> ```

***

### cycle

`stats.cycle`

Read the current billing cycle: emails sent, remaining and the plan cap

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.stats.cycle({});
```

**Input:** *empty object*

Answers the current billing cycle: `cycle_used`, `cycle_remaining` and
the plan cap `cycle_max`.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   cycle_start?: string | null,
>   cycle_end?: string | null,
>   cycle_used?: number | null,
>   cycle_remaining?: number | null,
>   cycle_max?: number | null
> }
> ```

***

### history

`stats.history`

Read per-recipient sending history rows with volumes, bounces, opens, clicks and spam reports for a date range

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.stats.history({ group_by: 'email_address', start_date: '2024-01-01', end_date: '2024-01-31' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_by` | `string` | No | Group the rows, such as by day or by email\_address. |
| `start_date` | `string` | No | — |
| `end_date` | `string` | No | — |
| `subaccounts` | `string[]` | No | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   count?: number | null,
>   history: {
>     email_address?: string | null,
>     used?: number | null,
>     bytecount?: number | null,
>     avgsize?: number | null,
>     lastip?: string | null,
>     bounces?: number | null,
>     clicks?: number | null,
>     opens?: number | null,
>     rejects?: number | null,
>     spam?: number | null,
>     unsubscribes?: number | null
>   }[]
> }
> ```

***

### spam

`stats.spam`

Read spam-complaint counts over the last 30 days or a given window

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.stats.spam({});
```

**Input**

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

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emails?: number | null,
>   spams?: number | null,
>   rejects?: number | null,
>   spam_percent?: string | null
> }
> ```

***

### summary

`stats.summary`

Read one combined report: billing cycle usage, bounces, spam, unsubscribes, opens and clicks

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.stats.summary({});
```

**Input**

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

Combines cycle usage, bounces, spam, unsubscribes, opens and clicks; it
can be slower than the individual endpoints.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   cycle_start?: string | null,
>   cycle_end?: string | null,
>   cycle_used?: number | null,
>   cycle_remaining?: number | null,
>   cycle_max?: number | null,
>   email_count?: number | null,
>   hardbounces?: number | null,
>   softbounces?: number | null,
>   bounce_rejects?: number | null,
>   bounce_percent?: string | null,
>   spam_emails?: number | null,
>   spam_rejects?: number | null,
>   spam_percent?: string | null,
>   unsubscribes?: number | null,
>   unsubscribe_percent?: string | null,
>   opens?: number | null,
>   clicks?: number | null,
>   rejects?: number | null
> }
> ```

***

### unsubscribes

`stats.unsubscribes`

Read unsubscribe counts over the last 30 days or a given window

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.stats.unsubscribes({});
```

**Input**

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

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   emails?: number | null,
>   unsubscribes?: number | null,
>   rejects?: number | null,
>   unsubscribe_percent?: string | null
> }
> ```

***

## Subaccounts

### add

`subaccounts.add`

Add a subaccount: adds a new subaccount on your master account. Note: This end-point is rate limited to 50 calls per hour. (emails an invitation when subaccount\_email is set)

**Risk:** `destructive`

```ts theme={null}
await corsair.smtp2go.api.subaccounts.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `fullname` | `string` | Yes | A full name used for the subaccount |
| `subaccount_email` | `string` | No | An optional email address for the first team member in the subaccount. An email invitation will be sent to this address. |
| `limit` | `number` | No | The number of emails the subaccount is allowed to send per billing cycle. Valid values:2000, 5000, 10000, 20000, 30000, 40000, 50000, 60000, 80000, 100000, 250000, 500000, 1000000, 2000000, 3000000,… |
| `dedicated_ip` | `boolean` | No | Auto assign a dedicated IP to the subaccount (Only available if limit is greater than 100,000) |
| `archiving` | `boolean` | No | Choose whether the subaccount is allowed to enable archiving. You still need to turn on archiving for individual senders within the subaccount. |
| `enforce_2fa` | `boolean` | No | Enforce team members of this subaccount to use 2FA. |
| `enable_sms` | `boolean` | No | Enable SMS messaging for the subaccount. Additional charges apply. |
| `sms_limit` | `number` | No | Your subaccount will be able to send up to this monthly limit of SMS messages. Their sending will also be limited by the master account's overall monthly limit. |
| `ip_pool` | `number` | No | If passed, will set the default ip\_pool of this subaccount and any emails sent will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   id?: string | null,
>   plan_size?: number | null,
>   plan_used?: number | null,
>   plan_remaining?: number | null,
>   state?: string | null,
>   dedicated_ip?: boolean | null,
>   archiving?: boolean | null,
>   enforce_2fa?: boolean | null,
>   sms_enabled?: boolean | null,
>   sms_limit?: number | null
> } | null
> ```

***

### close

`subaccounts.close`

Close a subaccount: changes the status of an Active subaccount to Closed (stops the subaccount sending)

**Risk:** `destructive`

```ts theme={null}
await corsair.smtp2go.api.subaccounts.close({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The id of the subaccount you want to close |
| `email` | `string` | No | The email address of the subaccount you want to close |

**Output**

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

***

### edit

`subaccounts.edit`

Update a subaccount: changes the details on an existing subaccount

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.subaccounts.edit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The id of an existing subaccount |
| `fullname` | `string` | No | If provided, will set to the new full name for the subaccount |
| `limit` | `number` | No | If provided, will set to the new limit for the subaccount |
| `dedicated_ip` | `boolean` | No | If provided, will set to the new dedicated IP address for the subaccount (If limit is greater than 100,000) |
| `archiving` | `boolean` | No | Choose whether the subaccount is allowed to enable archiving. You still need to turn on archiving for individual senders within the subaccount. |
| `enforce_2fa` | `boolean` | No | Enforce team members of this subaccount to use 2FA. |
| `enable_sms` | `boolean` | No | Enable SMS messaging for the subaccount. Additional charges apply. |
| `sms_limit` | `number` | No | Your subaccount will be able to send up to this monthly limit of SMS messages. Their sending will also be limited by the master account's overall monthly limit. |
| `ip_pool` | `number` | No | If passed, will set the default ip\_pool of this subaccount and any emails sent will use dedicated IP's in this IP Pool, This value can be found on the /v3/dedicated\_ips/view endpoint. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   id?: string | null,
>   plan_size?: number | null,
>   plan_used?: number | null,
>   plan_remaining?: number | null,
>   state?: string | null,
>   dedicated_ip?: boolean | null,
>   archiving?: boolean | null,
>   enforce_2fa?: boolean | null,
>   sms_enabled?: boolean | null,
>   sms_limit?: number | null
> } | null
> ```

***

### reopen

`subaccounts.reopen`

Reopen a closed subaccount: changes the status of a Closed subaccount back to Active

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.subaccounts.reopen({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | No | The email address of the subaccount you want to reopen |
| `id` | `string` | Yes | The id of the subaccount you want to reopen |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

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

***

### search

`subaccounts.search`

View subaccounts: returns any subaccounts that match search criteria

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.subaccounts.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `fuzzy_search` | `boolean` | No | Determines if search terms match complete field values and are case sensitive (false) or partial fields and are case insensitive (true). Default: true |
| `search_terms` | `string[]` | No | Return subaccounts with one or more of the strings in the following array.Note: See 'fuzzy\_search' for impact on case sensitivity |
| `states` | `string` | No | Controls which states you will be searched Valid values: all, active, closed, suspended |
| `sort_direction` | `string` | No | Sort direction, sorts either asc or desc by subaccount name |
| `page_size` | `number` | No | Number of subaccounts to retrieve per call |
| `continue_token` | `string` | No | A token provided by a prior call to this endpoint, passing this will cause it to fetch the next page of results |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   continue_token?: string | null,
>   total_count?: number | null,
>   subaccounts?: {
>     email?: string | null,
>     state?: string | null,
>     plan_size?: number | null,
>     plan_remaining?: number | null,
>     plan_used?: number | null,
>     name?: string | null
>   }[] | null
> } | null
> ```

***

## Suppressions

### add

`suppressions.add`

Block future sends to one email address, optionally scoped to a subaccount

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.suppressions.add({ email_address: 'temp@example.com', block_description: 'repeated complaints' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | The address to stop sending to. |
| `block_description` | `string` | No | — |
| `subaccount_id` | `string` | No | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   added?: boolean | null,
>   email_address?: string | null,
>   block_description?: string | null
> }
> ```

***

### list

`suppressions.list`

List suppressed addresses with their block reasons, filtered by address, block type or date, with a continue\_token for the next page

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.suppressions.list({ suppression_types: ['spam'], limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | No | — |
| `suppression_types` | `string[]` | No | Restrict the results to these types: 'manual', 'spam', 'unsubscribe', 'bounce', 'compliance'. |
| `start_date` | `string` | No | Only suppressions added on or after this date (YYYY-MM-DD). |
| `end_date` | `string` | No | Only suppressions added on or before this date (YYYY-MM-DD). |
| `limit` | `number` | No | — |
| `continue_token` | `string` | No | — |

`suppression_types` accepts `manual`, `spam`, `unsubscribe`, `bounce` and
`compliance`. Rows carry `reason` (the block type) and `timestamp`.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   results: {
>     email_address?: string | null,
>     reason?: string | null,
>     block_description?: string | null,
>     complaint?: string | null,
>     subject?: string | null,
>     timestamp?: string | null
>   }[],
>   total_results?: number | null,
>   continue_token?: string | null
> }
> ```

***

### remove

`suppressions.remove`

Lift the given block types for one email address, reporting per reason whether it was removed

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

```ts theme={null}
await corsair.smtp2go.api.suppressions.remove({ email_address: 'temp@example.com', reasons: ['manual', 'spam'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_address` | `string` | Yes | The address to unblock. |
| `reasons` | `string[]` | No | Block types to remove; the API defaults to \['manual', 'spam']. |
| `subaccount_id` | `string` | No | — |

One answer row per requested reason; `removed: false` means that block
type was not in place or could not be lifted. The API defaults
`reasons` to `['manual', 'spam']`.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   suppressions: {
>     email_address?: string | null,
>     reason?: string | null,
>     removed?: boolean | null
>   }[]
> }
> ```

***

## Templates

### add

`templates.add`

Create a template; the caller picks the template id, subject and both HTML and text bodies are required

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.templates.add({ id: 'order-receipt', template_name: 'Order receipt', subject: 'Receipt for {{ product_name }}', html_body: '<p>{{ product_name }}</p>', text_body: '{{ product_name }}', tags: ['receipts'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | A caller-chosen id for the new template. |
| `template_name` | `string` | Yes | — |
| `subject` | `string` | Yes | — |
| `html_body` | `string` | Yes | — |
| `text_body` | `string` | Yes | — |
| `template_variables` | `Record<string, any>` | No | — |
| `tags` | `string[]` | No | — |

Unusually, the API requires the caller to choose the template `id`.
`subject`, `html_body` and `text_body` are all required.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   template_name?: string | null,
>   name?: string | null,
>   subject?: string | null,
>   html_body?: string | null,
>   text_body?: string | null,
>   template_variables?: Record<string, any> | null,
>   tags?: string[] | null,
>   last_updated?: string | null
> }
> ```

***

### delete

`templates.delete`

Delete a template by id; the answer's data carries a confirmation string

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

```ts theme={null}
await corsair.smtp2go.api.templates.delete({ id: 'order-receipt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The template to delete. |

The answer's `data` is a confirmation string, such as
"Successfully deleted template 'example'".

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_id` | `string` | Yes | — |
| `data` | `string` | Yes | — |

***

### edit

`templates.edit`

Change a template by id, optionally moving it to a new id

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.templates.edit({ id: 'order-receipt', subject: 'New subject' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The template to change. |
| `new_id` | `string` | No | Move the template to a new id. |
| `template_name` | `string` | No | — |
| `subject` | `string` | No | — |
| `html_body` | `string` | No | — |
| `text_body` | `string` | No | — |
| `template_variables` | `Record<string, any>` | No | — |
| `tags` | `string[]` | No | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   template_name?: string | null,
>   name?: string | null,
>   subject?: string | null,
>   html_body?: string | null,
>   text_body?: string | null,
>   template_variables?: Record<string, any> | null,
>   tags?: string[] | null,
>   last_updated?: string | null
> }
> ```

***

### list

`templates.list`

List email templates by name or tag, one page of 100 at a time with a continue\_token

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.templates.list({ page_size: 100 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `fuzzy_search` | `boolean` | No | — |
| `search_terms` | `string[]` | No | Terms matched against template names. |
| `tags` | `string[]` | No | — |
| `sort_direction` | `string` | No | — |
| `page_size` | `number` | No | Defaults to 100. |
| `continue_token` | `string` | No | The continue\_token from the previous page. |

`page_size` defaults to 100; `continue_token` is null on the last page.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   templates: {
>     id?: string | null,
>     name?: string | null,
>     template_name?: string | null,
>     subject?: string | null,
>     tags?: string[] | null,
>     last_updated?: string | null
>   }[],
>   total_count?: number | null,
>   continue_token?: string | null
> }
> ```

***

### view

`templates.view`

Read one template with its subject, HTML and text bodies, tags and variables

**Risk:** `read`

```ts theme={null}
await corsair.smtp2go.api.templates.view({ id: '5355878' });
```

**Input**

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

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   subject?: string | null,
>   html_body?: string | null,
>   text_body?: string | null,
>   tags?: string[] | null,
>   template_variables?: Record<string, any> | null,
>   last_updated?: string | null
> }
> ```

***

## Webhooks

### add

`webhooks.add`

Register a webhook URL for chosen email (or SMS) events, in form or JSON output, with optional auth headers

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.webhooks.add({ url: 'https://example.com/smtp2go-events', events: ['delivered', 'open', 'click', 'spam', 'bounce'], output_format: 'json' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string` | Yes | The https URL events are posted to. |
| `events` | `string[]` | No | Email events to receive: 'delivered', 'unsubscribe', 'spam', 'bounce', 'processed', 'reject', 'click', 'open'. Defaults to all. |
| `sms_events` | `string[]` | No | — |
| `headers` | `string[]` | No | Email headers echoed to the webhook. |
| `usernames` | `string[]` | No | Restrict the webhook to these SMTP users. |
| `output_format` | `form \| json` | No | Defaults to 'form'. |
| `auth_header_type` | `string` | No | — |
| `auth_header_value` | `string` | No | — |
| `custom_headers` | `string[]` | No | Extra headers sent with every delivery. |
| `subaccount_id` | `string` | No | — |

`output_format` accepts `form` or `json` and defaults to `form`. With no
`events` list the webhook receives all email events. Set `auth_header_type`
and `auth_header_value`, and store the value as the plugin's webhook
secret: the plugin's `email.event` and `sms.event` webhooks receive the
deliveries and check that header.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   url?: string | null,
>   events?: string[] | null,
>   sms_events?: string[] | null,
>   headers?: string | string[] | null,
>   usernames?: string | string[] | null,
>   output_format?: string | null,
>   auth_header_type?: string | null,
>   auth_header_value?: string | null,
>   disabled?: boolean | null,
>   custom_headers?: string[] | null
> }
> ```

***

### edit

`webhooks.edit`

Change a webhook registration by id; the edit replaces its settings, so pass url every time and auth\_header\_type/auth\_header\_value again or the Authorization header is dropped

**Risk:** `write`

```ts theme={null}
await corsair.smtp2go.api.webhooks.edit({ id: 4320, url: 'https://example.com/hooks/smtp2go', disabled: true, auth_header_type: 'bearer', auth_header_value: '<token>' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The webhook registration to change. |
| `url` | `string` | Yes | The webhook URL; required on every edit, even when unchanged. |
| `events` | `string[]` | No | — |
| `sms_events` | `string[]` | No | — |
| `headers` | `string[]` | No | — |
| `usernames` | `string[]` | No | — |
| `output_format` | `form \| json` | No | — |
| `disabled` | `boolean` | No | — |
| `auth_header_type` | `string` | No | — |
| `auth_header_value` | `string` | No | — |
| `custom_headers` | `string[]` | No | — |
| `subaccount_id` | `string` | No | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   url?: string | null,
>   events?: string[] | null,
>   sms_events?: string[] | null,
>   headers?: string | string[] | null,
>   usernames?: string | string[] | null,
>   output_format?: string | null,
>   auth_header_type?: string | null,
>   auth_header_value?: string | null,
>   disabled?: boolean | null,
>   custom_headers?: string[] | null
> }
> ```

***

### list

`webhooks.list`

Read the account webhook registration with its events, output format and auth header settings

**Risk:** `read`

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

**Input**

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

Returns an array of registrations in `data`, each with its `events`,
`output_format` and auth header settings (an empty array when there are
none). The reference shows a single object; the live API answers an array.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   url?: string | null,
>   events?: string[] | null,
>   sms_events?: string[] | null,
>   headers?: string | string[] | null,
>   usernames?: string | string[] | null,
>   output_format?: string | null,
>   auth_header_type?: string | null,
>   auth_header_value?: string | null,
>   disabled?: boolean | null,
>   custom_headers?: string[] | null
> }[]
> ```

***

### remove

`webhooks.remove`

Remove a webhook registration by id; deliveries to that URL stop

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

```ts theme={null}
await corsair.smtp2go.api.webhooks.remove({ id: 4320 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The webhook registration to remove. |
| `subaccount_id` | `string` | No | — |

Removals are permanent; deliveries to that URL stop.

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   url?: string | null,
>   events?: string[] | null,
>   sms_events?: string[] | null,
>   headers?: string | string[] | null,
>   usernames?: string | string[] | null,
>   output_format?: string | null,
>   auth_header_type?: string | null,
>   auth_header_value?: string | null,
>   disabled?: boolean | null,
>   custom_headers?: string[] | null
> }
> ```

***


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