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

# Formcarry API reference

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

## Auth

### verify

`auth.verify`

Retrieve the current key or connection

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.auth.verify({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | Yes | — |
| `key` | `object \| null` | No | — |
| `app` | `object \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `teams` | `object[] \| null` | No | — |

> [accordion] key full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   prefix?: string | null,
>   last4?: string | null,
>   kind?: string | null
> } | null
> ```

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

> [accordion] teams full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   scopes?: string[] | null,
>   form_access?: {
>     mode?: string | null,
>     forms?: string[] | null
>   } | null
> }[] | null
> ```

***

## Email Servers

### list

`emailServers.list`

List email servers

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.emailServers.list({});
```

**Input:** *empty object*

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   team_id?: string | null,
>   kind?: string | null,
>   name?: string | null,
>   host_or_domain?: string | null,
>   active?: boolean | null
> }[]
> ```

***

## Forms

### create

`forms.create`

Create a form

**Risk:** `write`

```ts theme={null}
await corsair.formcarry.api.forms.create({ body: { name: 'Contact' } });
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   active?: boolean,
>   folder_id?: string | null,
>   storage?: {
>     store_submissions?: boolean,
>     keep_for?: 30_days | 60_days | 90_days | 180_days | 365_days | forever
>   },
>   spam?: {
>     protection?: boolean,
>     captcha?: {
>       provider?: none | recaptcha | hcaptcha | turnstile,
>       secret_key?: string | null,
>       secret_key_set?: boolean
>     }
>   },
>   self_email_notification?: {
>     enabled?: boolean,
>     recipients?: string[],
>     include_spam?: boolean,
>     subject?: string | null,
>     logo_url?: string | null,
>     logo_height?: number | null,
>     template?: {
>       type?: formcarry | custom,
>       theme?: formal | fancy,
>       html?: string | null
>     },
>     sender?: {
>       type?: formcarry | email_server | premium_server,
>       server_id?: string | null,
>       name?: string | null,
>       email?: string | null
>     }
>   },
>   auto_response?: {
>     enabled?: boolean,
>     subject?: string | null,
>     from_name?: string | null,
>     logo_url?: string | null,
>     logo_height?: number | null,
>     template?: {
>       type?: formcarry | custom,
>       theme?: formal | fancy,
>       message?: string | null,
>       html?: string | null
>     }
>   },
>   after_submit?: {
>     type?: formcarry_page | redirect,
>     page?: {
>       theme?: sweet | fancy | formal,
>       mode?: light | dark | system,
>       headline?: string | null,
>       message?: string | null,
>       logo_url?: string | null,
>       logo_dark_url?: string | null,
>       logo_size?: normal | big,
>       primary_color?: string | null,
>       secondary_color?: string | null,
>       return_button?: {
>         text?: string | null,
>         url?: string | null
>       },
>       download_button?: {
>         text?: string | null,
>         url?: string | null
>       }
>     },
>     redirect?: {
>       success_url?: string | null,
>       fail_url?: string | null,
>       append_submission_to_url?: boolean
>     }
>   },
>   validation?: {
>     enabled?: boolean,
>     rules?: {
>       field: string,
>       checks: {
>         type: required | email | url | phone_number | integer | min_length | max_length | contains | not_contains,
>         value?: string | null,
>         message?: string | null
>       }[]
>     }[]
>   },
>   team_id?: string,
>   name: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `team_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `endpoint` | `string \| null` | No | — |
| `active` | `boolean \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `folder_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `last_submission_at` | `string \| null` | No | — |
| `submissions` | `object \| null` | No | — |
| `storage` | `object \| null` | No | — |
| `spam` | `object \| null` | No | — |
| `self_email_notification` | `object \| null` | No | — |
| `auto_response` | `object \| null` | No | — |
| `after_submit` | `object \| null` | No | — |
| `webhooks` | `object[] \| null` | No | — |
| `validation` | `object \| null` | No | — |

> [accordion] submissions full type
>
> ```ts theme={null}
> {
>   this_month?: number | null,
>   all_time?: number | null
> } | null
> ```

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   store_submissions?: boolean | null,
>   keep_for?: string | null
> } | null
> ```

> [accordion] spam full type
>
> ```ts theme={null}
> {
>   protection?: boolean | null,
>   captcha?: {
>     provider?: string | null,
>     secret_key?: string | null,
>     secret_key_set?: boolean | null
>   } | null
> } | null
> ```

> [accordion] self\_email\_notification full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   recipients?: string[] | null,
>   include_spam?: boolean | null,
>   subject?: string | null,
>   logo_url?: string | null,
>   logo_height?: number | null,
>   template?: {
>     type?: string | null,
>     theme?: string | null,
>     html?: string | null
>   } | null,
>   sender?: {
>     type?: string | null,
>     server_id?: string | null,
>     name?: string | null,
>     email?: string | null
>   } | null
> } | null
> ```

> [accordion] auto\_response full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   subject?: string | null,
>   from_name?: string | null,
>   logo_url?: string | null,
>   logo_height?: number | null,
>   template?: {
>     type?: string | null,
>     theme?: string | null,
>     message?: string | null,
>     html?: string | null
>   } | null
> } | null
> ```

> [accordion] after\_submit full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   page?: {
>     theme?: string | null,
>     mode?: string | null,
>     headline?: string | null,
>     message?: string | null,
>     logo_url?: string | null,
>     logo_dark_url?: string | null,
>     logo_size?: string | null,
>     primary_color?: string | null,
>     secondary_color?: string | null,
>     return_button?: {
>       text?: string | null,
>       url?: string | null
>     } | null,
>     download_button?: {
>       text?: string | null,
>       url?: string | null
>     } | null
>   } | null,
>   redirect?: {
>     success_url?: string | null,
>     fail_url?: string | null,
>     append_submission_to_url?: boolean | null
>   } | null
> } | null
> ```

> [accordion] webhooks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   url?: string | null,
>   enabled?: boolean | null,
>   description?: string | null,
>   events?: string[] | null,
>   signing?: {
>     algorithm?: string | null,
>     header?: string | null
>   } | null,
>   last_delivery?: {
>     at?: string | null,
>     status?: string | null,
>     response_status?: number | null,
>     attempt?: number | null
>   } | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] validation full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   rules?: {
>     field?: string | null,
>     checks?: {
>       type?: string | null,
>       value?: string | null,
>       message?: string | null
>     }[] | null
>   }[] | null
> } | null
> ```

***

### delete

`forms.delete`

Delete a form

**Risk:** `destructive`

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

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `deleted` | `true` | Yes | — |

***

### get

`forms.get`

Retrieve a form

**Risk:** `read`

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

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `team_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `endpoint` | `string \| null` | No | — |
| `active` | `boolean \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `folder_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `last_submission_at` | `string \| null` | No | — |
| `submissions` | `object \| null` | No | — |
| `storage` | `object \| null` | No | — |
| `spam` | `object \| null` | No | — |
| `self_email_notification` | `object \| null` | No | — |
| `auto_response` | `object \| null` | No | — |
| `after_submit` | `object \| null` | No | — |
| `webhooks` | `object[] \| null` | No | — |
| `validation` | `object \| null` | No | — |

> [accordion] submissions full type
>
> ```ts theme={null}
> {
>   this_month?: number | null,
>   all_time?: number | null
> } | null
> ```

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   store_submissions?: boolean | null,
>   keep_for?: string | null
> } | null
> ```

> [accordion] spam full type
>
> ```ts theme={null}
> {
>   protection?: boolean | null,
>   captcha?: {
>     provider?: string | null,
>     secret_key?: string | null,
>     secret_key_set?: boolean | null
>   } | null
> } | null
> ```

> [accordion] self\_email\_notification full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   recipients?: string[] | null,
>   include_spam?: boolean | null,
>   subject?: string | null,
>   logo_url?: string | null,
>   logo_height?: number | null,
>   template?: {
>     type?: string | null,
>     theme?: string | null,
>     html?: string | null
>   } | null,
>   sender?: {
>     type?: string | null,
>     server_id?: string | null,
>     name?: string | null,
>     email?: string | null
>   } | null
> } | null
> ```

> [accordion] auto\_response full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   subject?: string | null,
>   from_name?: string | null,
>   logo_url?: string | null,
>   logo_height?: number | null,
>   template?: {
>     type?: string | null,
>     theme?: string | null,
>     message?: string | null,
>     html?: string | null
>   } | null
> } | null
> ```

> [accordion] after\_submit full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   page?: {
>     theme?: string | null,
>     mode?: string | null,
>     headline?: string | null,
>     message?: string | null,
>     logo_url?: string | null,
>     logo_dark_url?: string | null,
>     logo_size?: string | null,
>     primary_color?: string | null,
>     secondary_color?: string | null,
>     return_button?: {
>       text?: string | null,
>       url?: string | null
>     } | null,
>     download_button?: {
>       text?: string | null,
>       url?: string | null
>     } | null
>   } | null,
>   redirect?: {
>     success_url?: string | null,
>     fail_url?: string | null,
>     append_submission_to_url?: boolean | null
>   } | null
> } | null
> ```

> [accordion] webhooks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   url?: string | null,
>   enabled?: boolean | null,
>   description?: string | null,
>   events?: string[] | null,
>   signing?: {
>     algorithm?: string | null,
>     header?: string | null
>   } | null,
>   last_delivery?: {
>     at?: string | null,
>     status?: string | null,
>     response_status?: number | null,
>     attempt?: number | null
>   } | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] validation full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   rules?: {
>     field?: string | null,
>     checks?: {
>       type?: string | null,
>       value?: string | null,
>       message?: string | null
>     }[] | null
>   }[] | null
> } | null
> ```

***

### list

`forms.list`

List forms

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.forms.list({ limit: 10 });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `has_more` | `boolean \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   team_id?: string | null,
>   name?: string | null,
>   endpoint?: string | null,
>   active?: boolean | null,
>   avatar?: string | null,
>   folder_id?: string | null,
>   created_at?: string | null,
>   last_submission_at?: string | null,
>   submissions?: {
>     this_month?: number | null,
>     all_time?: number | null
>   } | null,
>   storage?: {
>     store_submissions?: boolean | null,
>     keep_for?: string | null
>   } | null,
>   spam?: {
>     protection?: boolean | null,
>     captcha?: {
>       provider?: string | null,
>       secret_key?: string | null,
>       secret_key_set?: boolean | null
>     } | null
>   } | null,
>   self_email_notification?: {
>     enabled?: boolean | null,
>     recipients?: string[] | null,
>     include_spam?: boolean | null,
>     subject?: string | null,
>     logo_url?: string | null,
>     logo_height?: number | null,
>     template?: {
>       type?: string | null,
>       theme?: string | null,
>       html?: string | null
>     } | null,
>     sender?: {
>       type?: string | null,
>       server_id?: string | null,
>       name?: string | null,
>       email?: string | null
>     } | null
>   } | null,
>   auto_response?: {
>     enabled?: boolean | null,
>     subject?: string | null,
>     from_name?: string | null,
>     logo_url?: string | null,
>     logo_height?: number | null,
>     template?: {
>       type?: string | null,
>       theme?: string | null,
>       message?: string | null,
>       html?: string | null
>     } | null
>   } | null,
>   after_submit?: {
>     type?: string | null,
>     page?: {
>       theme?: string | null,
>       mode?: string | null,
>       headline?: string | null,
>       message?: string | null,
>       logo_url?: string | null,
>       logo_dark_url?: string | null,
>       logo_size?: string | null,
>       primary_color?: string | null,
>       secondary_color?: string | null,
>       return_button?: {
>         text?: string | null,
>         url?: string | null
>       } | null,
>       download_button?: {
>         text?: string | null,
>         url?: string | null
>       } | null
>     } | null,
>     redirect?: {
>       success_url?: string | null,
>       fail_url?: string | null,
>       append_submission_to_url?: boolean | null
>     } | null
>   } | null,
>   webhooks?: {
>     id?: string | null,
>     url?: string | null,
>     enabled?: boolean | null,
>     description?: string | null,
>     events?: string[] | null,
>     signing?: {
>       algorithm?: string | null,
>       header?: string | null
>     } | null,
>     last_delivery?: {
>       at?: string | null,
>       status?: string | null,
>       response_status?: number | null,
>       attempt?: number | null
>     } | null,
>     created_at?: string | null
>   }[] | null,
>   validation?: {
>     enabled?: boolean | null,
>     rules?: {
>       field?: string | null,
>       checks?: {
>         type?: string | null,
>         value?: string | null,
>         message?: string | null
>       }[] | null
>     }[] | null
>   } | null
> }[]
> ```

***

### listFields

`forms.listFields`

List a form's fields

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.forms.listFields({});
```

**Input**

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

**Output**

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

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

***

### update

`forms.update`

Update a form

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name?: string,
>   active?: boolean,
>   folder_id?: string | null,
>   storage?: {
>     store_submissions?: boolean,
>     keep_for?: 30_days | 60_days | 90_days | 180_days | 365_days | forever
>   },
>   spam?: {
>     protection?: boolean,
>     captcha?: {
>       provider?: none | recaptcha | hcaptcha | turnstile,
>       secret_key?: string | null,
>       secret_key_set?: boolean
>     }
>   },
>   self_email_notification?: {
>     enabled?: boolean,
>     recipients?: string[],
>     include_spam?: boolean,
>     subject?: string | null,
>     logo_url?: string | null,
>     logo_height?: number | null,
>     template?: {
>       type?: formcarry | custom,
>       theme?: formal | fancy,
>       html?: string | null
>     },
>     sender?: {
>       type?: formcarry | email_server | premium_server,
>       server_id?: string | null,
>       name?: string | null,
>       email?: string | null
>     }
>   },
>   auto_response?: {
>     enabled?: boolean,
>     subject?: string | null,
>     from_name?: string | null,
>     logo_url?: string | null,
>     logo_height?: number | null,
>     template?: {
>       type?: formcarry | custom,
>       theme?: formal | fancy,
>       message?: string | null,
>       html?: string | null
>     }
>   },
>   after_submit?: {
>     type?: formcarry_page | redirect,
>     page?: {
>       theme?: sweet | fancy | formal,
>       mode?: light | dark | system,
>       headline?: string | null,
>       message?: string | null,
>       logo_url?: string | null,
>       logo_dark_url?: string | null,
>       logo_size?: normal | big,
>       primary_color?: string | null,
>       secondary_color?: string | null,
>       return_button?: {
>         text?: string | null,
>         url?: string | null
>       },
>       download_button?: {
>         text?: string | null,
>         url?: string | null
>       }
>     },
>     redirect?: {
>       success_url?: string | null,
>       fail_url?: string | null,
>       append_submission_to_url?: boolean
>     }
>   },
>   validation?: {
>     enabled?: boolean,
>     rules?: {
>       field: string,
>       checks: {
>         type: required | email | url | phone_number | integer | min_length | max_length | contains | not_contains,
>         value?: string | null,
>         message?: string | null
>       }[]
>     }[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `team_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `endpoint` | `string \| null` | No | — |
| `active` | `boolean \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `folder_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `last_submission_at` | `string \| null` | No | — |
| `submissions` | `object \| null` | No | — |
| `storage` | `object \| null` | No | — |
| `spam` | `object \| null` | No | — |
| `self_email_notification` | `object \| null` | No | — |
| `auto_response` | `object \| null` | No | — |
| `after_submit` | `object \| null` | No | — |
| `webhooks` | `object[] \| null` | No | — |
| `validation` | `object \| null` | No | — |

> [accordion] submissions full type
>
> ```ts theme={null}
> {
>   this_month?: number | null,
>   all_time?: number | null
> } | null
> ```

> [accordion] storage full type
>
> ```ts theme={null}
> {
>   store_submissions?: boolean | null,
>   keep_for?: string | null
> } | null
> ```

> [accordion] spam full type
>
> ```ts theme={null}
> {
>   protection?: boolean | null,
>   captcha?: {
>     provider?: string | null,
>     secret_key?: string | null,
>     secret_key_set?: boolean | null
>   } | null
> } | null
> ```

> [accordion] self\_email\_notification full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   recipients?: string[] | null,
>   include_spam?: boolean | null,
>   subject?: string | null,
>   logo_url?: string | null,
>   logo_height?: number | null,
>   template?: {
>     type?: string | null,
>     theme?: string | null,
>     html?: string | null
>   } | null,
>   sender?: {
>     type?: string | null,
>     server_id?: string | null,
>     name?: string | null,
>     email?: string | null
>   } | null
> } | null
> ```

> [accordion] auto\_response full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   subject?: string | null,
>   from_name?: string | null,
>   logo_url?: string | null,
>   logo_height?: number | null,
>   template?: {
>     type?: string | null,
>     theme?: string | null,
>     message?: string | null,
>     html?: string | null
>   } | null
> } | null
> ```

> [accordion] after\_submit full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   page?: {
>     theme?: string | null,
>     mode?: string | null,
>     headline?: string | null,
>     message?: string | null,
>     logo_url?: string | null,
>     logo_dark_url?: string | null,
>     logo_size?: string | null,
>     primary_color?: string | null,
>     secondary_color?: string | null,
>     return_button?: {
>       text?: string | null,
>       url?: string | null
>     } | null,
>     download_button?: {
>       text?: string | null,
>       url?: string | null
>     } | null
>   } | null,
>   redirect?: {
>     success_url?: string | null,
>     fail_url?: string | null,
>     append_submission_to_url?: boolean | null
>   } | null
> } | null
> ```

> [accordion] webhooks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   url?: string | null,
>   enabled?: boolean | null,
>   description?: string | null,
>   events?: string[] | null,
>   signing?: {
>     algorithm?: string | null,
>     header?: string | null
>   } | null,
>   last_delivery?: {
>     at?: string | null,
>     status?: string | null,
>     response_status?: number | null,
>     attempt?: number | null
>   } | null,
>   created_at?: string | null
> }[] | null
> ```

> [accordion] validation full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   rules?: {
>     field?: string | null,
>     checks?: {
>       type?: string | null,
>       value?: string | null,
>       message?: string | null
>     }[] | null
>   }[] | null
> } | null
> ```

***

### uploadImage

`forms.uploadImage`

Upload an image

**Risk:** `write`

```ts theme={null}
await corsair.formcarry.api.forms.uploadImage({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `body` | `object` | Yes | — |

Upload a base64 encoded image up to 5 MiB. Use the returned URL in a separate forms.update call to place the image.

> [accordion] body full type
>
> ```ts theme={null}
> {
>   file: string,
>   use: self_email_notification_logo | auto_response_logo | after_submit_logo | after_submit_logo_dark,
>   name?: string
> }
> ```

**Output**

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

***

## Health

### check

`health.check`

Check that the API is up

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.health.check({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `ok` | Yes | — |

***

## Legacy

### createForm

`legacy.createForm`

Create a form with the legacy API

**Risk:** `write`

```ts theme={null}
await corsair.formcarry.api.legacy.createForm({});
```

**Input**

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

Send the form name in the name field. See the request example in the vendor Forms API reference.

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string,
>   email?: string,
>   returnUrl?: string,
>   failUrl?: string,
>   returnParams?: boolean,
>   googleRecaptcha?: string,
>   webhook?: string,
>   retention?: boolean,
>   thankYouPage_theme?: Fancy | Formal | Sweet,
>   thankYouPage_headline?: string,
>   thankYouPage_message?: string,
>   thankYouPage_mode?: Dark | System | Light,
>   thankYouPage_returnText?: string,
>   thankYouPage_returnUrl?: string,
>   selfEmail_theme?: Fancy | Formal | Custom,
>   selfEmail_code?: string,
>   selfEmail_from?: string,
>   selfEmail_subject?: string,
>   selfEmail_sendOnSpam?: boolean,
>   autoResponse?: boolean,
>   autoResponse_from?: string,
>   autoResponse_theme?: Fancy | Formal | Custom,
>   autoResponse_subject?: string,
>   autoResponse_message?: string,
>   autoResponse_code?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `200` | Yes | — |
| `type` | `success` | Yes | — |
| `title` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `formUrl` | `string \| null` | No | — |

***

### deleteForm

`legacy.deleteForm`

Delete a form with the legacy API

**Risk:** `destructive`

```ts theme={null}
await corsair.formcarry.api.legacy.deleteForm({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `200` | Yes | — |
| `type` | `success` | Yes | — |
| `title` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |

***

### listSubmissions

`legacy.listSubmissions`

List form submissions with legacy page numbers

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.legacy.listSubmissions({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `page` | `number` | No | — |
| `limit` | `number` | No | — |
| `sort` | `string` | No | — |
| `filter` | `string` | No | — |

Page numbering starts at 1. A wrong key comes back as an error inside HTTP 200, which fails the response check.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `form` | `string \| null` | No | — |
| `results` | `number \| null` | No | — |
| `pagination` | `object \| null` | No | — |
| `submissions` | `object[]` | Yes | — |

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   previous_page?: number | null,
>   next_page?: number | null,
>   total_page?: number | null,
>   total_submissions?: number | null
> } | null
> ```

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

***

### verify

`legacy.verify`

Call the legacy auth route. It answers success for any key, so use auth.verify to check a key

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.legacy.verify({});
```

**Input:** *empty object*

Formcarry answers success on this route for any key, including a wrong or missing one. Use auth.verify to check a key.

**Output**

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

***

## Recipients

### add

`recipients.add`

Add a recipient

**Risk:** `destructive`

```ts theme={null}
await corsair.formcarry.api.recipients.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `body` | `object` | Yes | — |

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `recipients` | `string[]` | Yes | — |
| `pending_approval` | `string[] \| null` | No | — |

***

### remove

`recipients.remove`

Remove a recipient

**Risk:** `destructive`

```ts theme={null}
await corsair.formcarry.api.recipients.remove({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `recipients` | `string[]` | Yes | — |
| `pending_approval` | `string[] \| null` | No | — |

***

## Submissions

### delete

`submissions.delete`

Delete a submission

**Risk:** `destructive`

```ts theme={null}
await corsair.formcarry.api.submissions.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `submission_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `deleted` | `true` | Yes | — |

***

### get

`submissions.get`

Retrieve a submission

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.submissions.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `submission_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `form_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `spam` | `boolean \| null` | No | — |
| `read` | `boolean \| null` | No | — |
| `ip` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `user_agent` | `string \| null` | No | — |
| `referer` | `string \| null` | No | — |
| `fields` | `object[] \| null` | No | — |
| `attachments` | `object[] \| null` | No | — |

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

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   url?: string | null,
>   mime_type?: string | null
> }[] | null
> ```

***

### list

`submissions.list`

List submissions

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.submissions.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `status` | `inbox \| spam \| all` | No | — |
| `read` | `true \| false` | No | — |
| `has_attachments` | `true \| false` | No | — |
| `created_after` | `string` | No | — |
| `created_before` | `string` | No | — |
| `country` | `string` | No | — |
| `q` | `string` | No | — |
| `order` | `newest \| oldest` | No | — |
| `limit` | `number` | No | — |
| `cursor` | `string` | No | — |
| `fields` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `has_more` | `boolean \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   form_id?: string | null,
>   created_at?: string | null,
>   spam?: boolean | null,
>   read?: boolean | null,
>   ip?: string | null,
>   country?: string | null,
>   user_agent?: string | null,
>   referer?: string | null,
>   fields?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   attachments?: {
>     key?: string | null,
>     url?: string | null,
>     mime_type?: string | null
>   }[] | null
> }[]
> ```

***

### listDeliveries

`submissions.listDeliveries`

Read what happened to submissions

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.submissions.listDeliveries({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `submission_ids` | `string` | Yes | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   submission_id?: string | null,
>   status?: string | null,
>   deliveries?: {
>     channel?: string | null,
>     target?: string | null,
>     webhook_id?: string | null,
>     name?: string | null,
>     status?: string | null,
>     code?: string | null,
>     attempt?: number | null,
>     http_status?: number | null,
>     smtp_code?: number | null,
>     node_error_code?: string | null,
>     message?: string | null,
>     occurred_at?: string | null
>   }[] | null
> }[]
> ```

***

### restore

`submissions.restore`

Restore a submission from spam

**Risk:** `write`

```ts theme={null}
await corsair.formcarry.api.submissions.restore({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `submission_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `form_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `spam` | `boolean \| null` | No | — |
| `read` | `boolean \| null` | No | — |
| `ip` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `user_agent` | `string \| null` | No | — |
| `referer` | `string \| null` | No | — |
| `fields` | `object[] \| null` | No | — |
| `attachments` | `object[] \| null` | No | — |

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

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   url?: string | null,
>   mime_type?: string | null
> }[] | null
> ```

***

### search

`submissions.search`

Search submissions across forms

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.submissions.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `inbox \| spam \| all` | No | — |
| `read` | `true \| false` | No | — |
| `has_attachments` | `true \| false` | No | — |
| `created_after` | `string` | No | — |
| `created_before` | `string` | No | — |
| `country` | `string` | No | — |
| `q` | `string` | No | — |
| `order` | `newest \| oldest` | No | — |
| `limit` | `number` | No | — |
| `fields` | `string` | No | — |
| `team_id` | `string` | No | — |
| `form_ids` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `forms_searched` | `number \| null` | No | — |
| `forms_matched` | `number \| null` | No | — |
| `complete` | `boolean \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   form_id?: string | null,
>   created_at?: string | null,
>   spam?: boolean | null,
>   read?: boolean | null,
>   ip?: string | null,
>   country?: string | null,
>   user_agent?: string | null,
>   referer?: string | null,
>   fields?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   attachments?: {
>     key?: string | null,
>     url?: string | null,
>     mime_type?: string | null
>   }[] | null
> }[]
> ```

***

### spam

`submissions.spam`

Mark a submission as spam

**Risk:** `write`

```ts theme={null}
await corsair.formcarry.api.submissions.spam({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `submission_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `form_id` | `string \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `spam` | `boolean \| null` | No | — |
| `read` | `boolean \| null` | No | — |
| `ip` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `user_agent` | `string \| null` | No | — |
| `referer` | `string \| null` | No | — |
| `fields` | `object[] \| null` | No | — |
| `attachments` | `object[] \| null` | No | — |

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

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   url?: string | null,
>   mime_type?: string | null
> }[] | null
> ```

***

### summary

`submissions.summary`

Count submissions

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.submissions.summary({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `status` | `inbox \| spam \| all` | No | — |
| `read` | `true \| false` | No | — |
| `has_attachments` | `true \| false` | No | — |
| `created_after` | `string` | No | — |
| `created_before` | `string` | No | — |
| `country` | `string` | No | — |
| `q` | `string` | No | — |
| `group_by` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `total` | `number` | Yes | — |
| `exact` | `boolean \| null` | No | — |
| `group_by` | `string \| null` | No | — |
| `buckets` | `object[] \| null` | No | — |
| `other` | `number \| null` | No | — |
| `truncated` | `boolean \| null` | No | — |

> [accordion] buckets full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   count?: number | null
> }[] | null
> ```

***

## Webhook Deliveries

### get

`webhookDeliveries.get`

Retrieve a delivery

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.webhookDeliveries.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `webhook_id` | `string` | Yes | — |
| `submission_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `submission_id` | `string \| null` | No | — |
| `webhook_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `attempt` | `number \| null` | No | — |
| `http_status` | `number \| null` | No | — |
| `node_error_code` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `occurred_at` | `string \| null` | No | — |

***

### list

`webhookDeliveries.list`

List deliveries

**Risk:** `read`

```ts theme={null}
await corsair.formcarry.api.webhookDeliveries.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `webhook_id` | `string` | Yes | — |
| `status` | `succeeded \| failed \| retrying \| pending \| skipped` | No | — |
| `limit` | `number` | No | — |
| `before` | `string` | No | — |

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   submission_id?: string | null,
>   webhook_id?: string | null,
>   status?: string | null,
>   code?: string | null,
>   attempt?: number | null,
>   http_status?: number | null,
>   node_error_code?: string | null,
>   message?: string | null,
>   occurred_at?: string | null
> }[]
> ```

***

### redeliver

`webhookDeliveries.redeliver`

Send a submission again

**Risk:** `destructive`

```ts theme={null}
await corsair.formcarry.api.webhookDeliveries.redeliver({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `webhook_id` | `string` | Yes | — |
| `submission_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `submission_id` | `string \| null` | No | — |
| `webhook_id` | `string \| null` | No | — |
| `queued` | `true` | Yes | — |

***

## Webhooks

### create

`webhooks.create`

Add a webhook

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `body` | `object` | Yes | — |

The webhook signing secret is returned once. Store it securely.

> [accordion] body full type
>
> ```ts theme={null}
> {
>   url: string,
>   enabled?: boolean,
>   description?: string | null,
>   events?: submission.created[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `url` | `string \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `description` | `string \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `signing` | `object \| null` | No | — |
| `last_delivery` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `secret` | `string` | Yes | — |

> [accordion] signing full type
>
> ```ts theme={null}
> {
>   algorithm?: string | null,
>   header?: string | null
> } | null
> ```

> [accordion] last\_delivery full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   status?: string | null,
>   response_status?: number | null,
>   attempt?: number | null
> } | null
> ```

***

### delete

`webhooks.delete`

Delete a webhook

**Risk:** `destructive`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `webhook_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `deleted` | `true` | Yes | — |

***

### get

`webhooks.get`

Retrieve a webhook

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `webhook_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `url` | `string \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `description` | `string \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `signing` | `object \| null` | No | — |
| `last_delivery` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |

> [accordion] signing full type
>
> ```ts theme={null}
> {
>   algorithm?: string | null,
>   header?: string | null
> } | null
> ```

> [accordion] last\_delivery full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   status?: string | null,
>   response_status?: number | null,
>   attempt?: number | null
> } | null
> ```

***

### list

`webhooks.list`

List webhooks

**Risk:** `read`

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

**Input**

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

**Output**

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

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   url?: string | null,
>   enabled?: boolean | null,
>   description?: string | null,
>   events?: string[] | null,
>   signing?: {
>     algorithm?: string | null,
>     header?: string | null
>   } | null,
>   last_delivery?: {
>     at?: string | null,
>     status?: string | null,
>     response_status?: number | null,
>     attempt?: number | null
>   } | null,
>   created_at?: string | null
> }[]
> ```

***

### update

`webhooks.update`

Update a webhook

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `form_id` | `string` | Yes | — |
| `webhook_id` | `string` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   url?: string,
>   enabled?: boolean,
>   description?: string | null,
>   events?: submission.created[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `url` | `string \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `description` | `string \| null` | No | — |
| `events` | `string[] \| null` | No | — |
| `signing` | `object \| null` | No | — |
| `last_delivery` | `object \| null` | No | — |
| `created_at` | `string \| null` | No | — |

> [accordion] signing full type
>
> ```ts theme={null}
> {
>   algorithm?: string | null,
>   header?: string | null
> } | null
> ```

> [accordion] last\_delivery full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   status?: string | null,
>   response_status?: number | null,
>   attempt?: number | null
> } | null
> ```

***


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