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

# Lob API reference

> API reference for the Lob plugin in Corsair: every `lob.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### getBalance

`account.getBalance`

Read the account's current Lob Credits balance (live keys only; a test key gets 401)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.account.getBalance({});
```

**Input:** *empty object*

Returns the Lob Credits balance; it can be negative. Needs a live key: Lob answers a test key with 401 `invalid_api_key` here, though every other route accepts it.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `balance` | `number` | Yes | The account's Lob Credits balance. |

***

## Addresses

### create

`addresses.create`

Create a US or international address in the Lob address book for reuse as a mail to or from address

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.addresses.create({ name: 'Jordan Lee', address_line1: '210 King St Ste 6100', address_city: 'San Francisco', address_state: 'CA', address_zip: '94107-1741' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | No | — |
| `company` | `string` | No | — |
| `phone` | `string` | No | — |
| `email` | `string` | No | — |
| `address_line1` | `string` | Yes | Street address. Up to 64 characters for US addresses. |
| `address_line2` | `string` | No | — |
| `address_city` | `string` | No | — |
| `address_state` | `string` | No | — |
| `address_zip` | `string` | No | — |
| `address_country` | `string` | No | Two-letter ISO country code. Omit or pass 'US' for a US address. |
| `description` | `string` | No | Internal note, up to 255 characters. |
| `metadata` | `Record<string, string>` | No | — |

Lob requires `name` or `company` (at least one). Omitting `address_country` means US, which requires the city, two-letter state and a US ZIP.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `company` | `string \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `address_line1` | `string \| null` | No | — |
| `address_line2` | `string \| null` | No | — |
| `address_city` | `string \| null` | No | — |
| `address_state` | `string \| null` | No | — |
| `address_zip` | `string \| null` | No | — |
| `address_country` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | String-to-string map; Lob caps the serialized form at 500 characters. |
| `recipient_moved` | `boolean \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### delete

`addresses.delete`

Permanently delete an address book entry. Lob marks it deleted and does not restore it

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

```ts theme={null}
await corsair.lob.api.addresses.delete({ id: 'adr_d0c7d5ac3f7e6b4' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The address's ID, prefixed with adr\_. |

Marks the entry deleted. Lob does not restore it, and mail already queued to that address still processes.

**Output**

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

***

### get

`addresses.get`

Read one address book entry by its adr\_ ID

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.addresses.get({ id: 'adr_d0c7d5ac3f7e6b4' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The address's ID, prefixed with adr\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `company` | `string \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `address_line1` | `string \| null` | No | — |
| `address_line2` | `string \| null` | No | — |
| `address_city` | `string \| null` | No | — |
| `address_state` | `string \| null` | No | — |
| `address_zip` | `string \| null` | No | — |
| `address_country` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | String-to-string map; Lob caps the serialized form at 500 characters. |
| `recipient_moved` | `boolean \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### list

`addresses.list`

Page through the address book with before/after cursors, optional metadata and date filters

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.addresses.list({ limit: 20, include: ['total_count'], after: 'adr_d0c7d5ac3f7e6b4' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor: rows created before this address ID. |
| `after` | `string` | No | Cursor: rows created after this address ID. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation timestamp. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |

Page with `before` or `after` (never both), up to 100 rows. `total_count` arrives only when you pass `include: ['total_count']`.

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present only when the request passed include: \[total\_count]. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   company?: string | null,
>   phone?: string | null,
>   email?: string | null,
>   address_line1?: string | null,
>   address_line2?: string | null,
>   address_city?: string | null,
>   address_state?: string | null,
>   address_zip?: string | null,
>   address_country?: string | null,
>   metadata?: Record<string, string> | null,
>   recipient_moved?: boolean | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null
> }[]
> ```

***

## Autocomplete

### usAutocomplete

`autocomplete.usAutocomplete`

Complete a partial US address into up to 10 suggestion lines, optionally restricted to deliverable addresses

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.autocomplete.usAutocomplete({ address_prefix: '185 Industrial P', valid_addresses: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `address_prefix` | `string` | Yes | Partial primary line to complete, such as '185 Industrial P'. |
| `city` | `string` | No | — |
| `state` | `string` | No | — |
| `zip_code` | `string` | No | — |
| `geo_ip_sort` | `boolean` | No | True to rank suggestions by distance to the caller IP; needs the X-Forwarded-For header Lob documents, which this plugin does not send. |
| `case` | `upper \| proper` | No | Casing of the returned address lines: 'upper' (default) or 'proper'. |
| `valid_addresses` | `boolean` | No | True to return only deliverable addresses. |

`geo_ip_sort` ranks by caller IP; the plugin does not send the `X-Forwarded-For` header Lob uses to pass the end user IP through.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `suggestions` | `object[]` | Yes | Up to 10 completed address lines. |
| `object` | `string \| null` | No | — |

> [accordion] suggestions full type
>
> ```ts theme={null}
> {
>   primary_line?: string | null,
>   city?: string | null,
>   state?: string | null,
>   zip_code?: string | null,
>   object?: string | null
> }[]
> ```

***

## Bank Accounts

### create

`bankAccounts.create`

Add a US bank account for checks. Lob sends micro-deposits that bankAccounts.verify confirms

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.bankAccounts.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `routing_number` | `string` | Yes | — |
| `account_number` | `string` | Yes | — |
| `account_type` | `company \| individual` | Yes | — |
| `signatory` | `string` | Yes | Name of the person who signs checks drawn on it. |
| `check_template` | `common \| jpm` | No | — |
| `fractional_routing_number` | `string` | No | — |
| `city` | `string` | No | — |
| `state` | `string` | No | — |
| `zipcode` | `string` | No | — |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `routing_number` | `string \| null` | No | — |
| `account_number` | `string \| null` | No | — |
| `account_type` | `string \| null` | No | — |
| `signatory` | `string \| null` | No | — |
| `check_template` | `string \| null` | No | — |
| `fractional_routing_number` | `string \| null` | No | — |
| `city` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `zipcode` | `string \| null` | No | — |
| `signature_url` | `string \| null` | No | — |
| `bank_name` | `string \| null` | No | — |
| `verified` | `boolean \| null` | No | — |
| `microdeposit_type` | `string \| null` | No | amounts or descriptor\_code. |

***

### delete

`bankAccounts.delete`

Permanently delete a bank account. Checks can no longer draw on it

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

```ts theme={null}
await corsair.lob.api.bankAccounts.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The bank account's ID, prefixed with bank\_. |

**Output**

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

***

### get

`bankAccounts.get`

Read one bank account by its bank\_ ID, including whether it is verified

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.bankAccounts.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The bank account's ID, prefixed with bank\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `routing_number` | `string \| null` | No | — |
| `account_number` | `string \| null` | No | — |
| `account_type` | `string \| null` | No | — |
| `signatory` | `string \| null` | No | — |
| `check_template` | `string \| null` | No | — |
| `fractional_routing_number` | `string \| null` | No | — |
| `city` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `zipcode` | `string \| null` | No | — |
| `signature_url` | `string \| null` | No | — |
| `bank_name` | `string \| null` | No | — |
| `verified` | `boolean \| null` | No | — |
| `microdeposit_type` | `string \| null` | No | amounts or descriptor\_code. |

***

### list

`bankAccounts.list`

Page through bank accounts with cursors, date and metadata filters

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.bankAccounts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | — |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   routing_number?: string | null,
>   account_number?: string | null,
>   account_type?: string | null,
>   signatory?: string | null,
>   check_template?: string | null,
>   fractional_routing_number?: string | null,
>   city?: string | null,
>   state?: string | null,
>   zipcode?: string | null,
>   signature_url?: string | null,
>   bank_name?: string | null,
>   verified?: boolean | null,
>   microdeposit_type?: string | null
> }[]
> ```

***

### verify

`bankAccounts.verify`

Verify a bank account with its two micro-deposit amounts or its descriptor code

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.bankAccounts.verify({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The bank account's ID, prefixed with bank\_. |
| `amounts` | `number[]` | No | The two micro-deposit amounts in cents, when microdeposit\_type is amounts. |
| `descriptor_code` | `string` | No | The 6-character code from the deposit, when microdeposit\_type is descriptor\_code. |

Pass the two micro-deposit `amounts` in cents, or the six-character `descriptor_code` (starts with SM), depending on the account's `microdeposit_type`.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `routing_number` | `string \| null` | No | — |
| `account_number` | `string \| null` | No | — |
| `account_type` | `string \| null` | No | — |
| `signatory` | `string \| null` | No | — |
| `check_template` | `string \| null` | No | — |
| `fractional_routing_number` | `string \| null` | No | — |
| `city` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `zipcode` | `string \| null` | No | — |
| `signature_url` | `string \| null` | No | — |
| `bank_name` | `string \| null` | No | — |
| `verified` | `boolean \| null` | No | — |
| `microdeposit_type` | `string \| null` | No | amounts or descriptor\_code. |

***

## Billing Groups

### create

`billingGroups.create`

Create a billing group to split mail costs by team or client

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.billingGroups.create({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |

***

### get

`billingGroups.get`

Read one billing group by its bg\_ ID

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.billingGroups.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The billing group's ID, prefixed with bg\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |

***

### list

`billingGroups.list`

Page through billing groups with limit/offset, date filters and sorting

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.billingGroups.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `offset` | `number` | No | Rows to skip. Defaults to 0. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | — |
| `date_modified` | `object` | No | — |
| `sort_by` | `object` | No | — |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] date\_modified full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   date_modified: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   name?: string | null
> }[]
> ```

***

### update

`billingGroups.update`

Change a billing group's name or description

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.billingGroups.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The billing group's ID, prefixed with bg\_. |
| `name` | `string` | No | — |
| `description` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |

***

## Booklets

### cancel

`booklets.cancel`

Cancel a booklet before it goes to production. A cancelled piece cannot be restored

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

```ts theme={null}
await corsair.lob.api.booklets.cancel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The booklet's ID, prefixed with ord\_. |

**Output**

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

***

### get

`booklets.get`

Read one booklet by its ord\_ ID, including status and tracking events

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.booklets.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The booklet's ID, prefixed with ord\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `template_version_id` | `string \| null` | No | — |
| `pages` | `number \| null` | No | — |
| `source_material` | `string \| null` | No | — |

***

### list

`booklets.list`

Page through booklets with cursors and filters (status, campaign, send date, metadata)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.booklets.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation time. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |
| `campaign_id` | `string` | No | — |
| `status` | `processed \| rendered \| failed` | No | Render status. |
| `scheduled` | `boolean` | No | True for pieces with a future send\_date only. |
| `send_date` | `object` | No | ISO 8601 bounds on send\_date. |
| `mail_type` | `usps_first_class \| usps_standard` | No | — |
| `sort_by` | `object` | No | Sort by date\_created or send\_date, not both. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] send\_date full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   send_date: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   to?: any,
>   from?: any,
>   carrier?: string | null,
>   thumbnails?: any,
>   expected_delivery_date?: string | null,
>   url?: string | null,
>   tracking_events?: any,
>   campaign_id?: string | null,
>   use_type?: string | null,
>   fsc?: boolean | null,
>   status?: string | null,
>   failure_reason?: any,
>   mail_type?: string | null,
>   merge_variables?: any,
>   send_date?: string | null,
>   size?: string | null,
>   template_id?: string | null,
>   template_version_id?: string | null,
>   pages?: number | null,
>   source_material?: string | null
> }[]
> ```

***

### send

`booklets.send`

Print and mail a real booklet. Billed per piece and not recallable once in production; pass an idempotency\_key

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

```ts theme={null}
await corsair.lob.api.booklets.send({ to: 'adr_210a8d4b0b76d77b', from: 'adr_fa64eaa6b3f335', file: 'tmpl_booklet', pages: 8, size: '8.375x5.375', use_type: 'marketing', idempotency_key: 'catalog-2026-adr_210a8d4b0b76d77b' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `string \| object` | Yes | Recipient: an address ID (adr\_...) or an inline address. |
| `from` | `string \| object` | Yes | Return address: an address ID (adr\_...) or an inline address. |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `mail_type` | `usps_first_class \| usps_standard` | No | Postage class. Defaults to 'usps\_first\_class'. |
| `merge_variables` | `Record<string, any> \| null` | No | Per-mailpiece template variables, keyed by merge variable name. |
| `send_date` | `string` | No | ISO 8601 date (2026-01-01) or datetime; Lob schedules production after it, up to 180 days out. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `idempotency_key` | `string` | No | Deduplication key, at most 256 characters. Lob replays within 24 hours return the original mailpiece instead of creating a duplicate. |
| `file` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `pages` | `number` | Yes | Page count of the booklet. |
| `size` | `8.375x5.375` | Yes | Only '8.375x5.375'. |
| `source_material` | `60# Gloss Text` | No | — |
| `qr_code` | `object` | No | Print a tracked QR code on the piece. |
| `fsc` | `boolean` | No | Print on FSC-certified paper. |

> [accordion] to full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] qr\_code full type
>
> ```ts theme={null}
> {
>   position: relative,
>   redirect_url?: string,
>   width: string,
>   top?: string,
>   right?: string,
>   left?: string,
>   bottom?: string,
>   pages?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `template_version_id` | `string \| null` | No | — |
| `pages` | `number \| null` | No | — |
| `source_material` | `string \| null` | No | — |

***

## Buckslips

### create

`buckslips.create`

Create a buckslip (a letter insert) from front and back artwork. Printing happens only when you order stock

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.buckslips.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `front` | `string` | Yes | https URL of a PDF, PNG or JPG file for this side. |
| `back` | `string` | No | https URL of a PDF, PNG or JPG file for this side. |
| `size` | `8.75x3.75` | No | — |
| `description` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `raw_url` | `string \| null` | No | — |
| `front_original_url` | `string \| null` | No | — |
| `back_original_url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `auto_reorder` | `boolean \| null` | No | — |
| `reorder_quantity` | `number \| null` | No | — |
| `threshold_amount` | `number \| null` | No | — |
| `available_quantity` | `number \| null` | No | — |
| `pending_quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `allocated_quantity` | `number \| null` | No | — |
| `onhand_quantity` | `number \| null` | No | — |
| `projected_quantity` | `number \| null` | No | — |
| `buckslip_orders` | `any` | No | — |
| `stock` | `string \| null` | No | — |
| `weight` | `string \| null` | No | — |
| `finish` | `string \| null` | No | — |

***

### createOrder

`buckslips.createOrder`

Order a print run of a buckslip (at least 5,000). Lob prints and bills the whole order

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

```ts theme={null}
await corsair.lob.api.buckslips.createOrder({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The buckslip's ID, prefixed with bck\_. |
| `quantity` | `number` | Yes | Pieces to print; Lob bills the order. Minimum 5000. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `quantity_ordered` | `number \| null` | No | — |
| `unit_price` | `number \| null` | No | — |
| `inventory` | `number \| null` | No | — |
| `cancelled_reason` | `string \| null` | No | — |
| `availability_date` | `string \| null` | No | — |
| `expected_availability_date` | `string \| null` | No | — |
| `buckslip_id` | `string \| null` | No | — |

***

### delete

`buckslips.delete`

Permanently delete a buckslip

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

```ts theme={null}
await corsair.lob.api.buckslips.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The buckslip's ID, prefixed with bck\_. |

**Output**

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

***

### get

`buckslips.get`

Read one buckslip by its bck\_ ID, including stock quantities and status

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.buckslips.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The buckslip's ID, prefixed with bck\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `raw_url` | `string \| null` | No | — |
| `front_original_url` | `string \| null` | No | — |
| `back_original_url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `auto_reorder` | `boolean \| null` | No | — |
| `reorder_quantity` | `number \| null` | No | — |
| `threshold_amount` | `number \| null` | No | — |
| `available_quantity` | `number \| null` | No | — |
| `pending_quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `allocated_quantity` | `number \| null` | No | — |
| `onhand_quantity` | `number \| null` | No | — |
| `projected_quantity` | `number \| null` | No | — |
| `buckslip_orders` | `any` | No | — |
| `stock` | `string \| null` | No | — |
| `weight` | `string \| null` | No | — |
| `finish` | `string \| null` | No | — |

***

### list

`buckslips.list`

Page through buckslips with cursors

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.buckslips.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   size?: string | null,
>   url?: string | null,
>   raw_url?: string | null,
>   front_original_url?: string | null,
>   back_original_url?: string | null,
>   thumbnails?: any,
>   auto_reorder?: boolean | null,
>   reorder_quantity?: number | null,
>   threshold_amount?: number | null,
>   available_quantity?: number | null,
>   pending_quantity?: number | null,
>   status?: string | null,
>   allocated_quantity?: number | null,
>   onhand_quantity?: number | null,
>   projected_quantity?: number | null,
>   buckslip_orders?: any,
>   stock?: string | null,
>   weight?: string | null,
>   finish?: string | null
> }[]
> ```

***

### listOrders

`buckslips.listOrders`

List the print orders placed for a buckslip

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.buckslips.listOrders({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The buckslip's ID, prefixed with bck\_. |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `offset` | `number` | No | Rows to skip. Defaults to 0. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   status?: string | null,
>   quantity_ordered?: number | null,
>   unit_price?: number | null,
>   inventory?: number | null,
>   cancelled_reason?: string | null,
>   availability_date?: string | null,
>   expected_availability_date?: string | null,
>   buckslip_id?: string | null
> }[]
> ```

***

### update

`buckslips.update`

Change a buckslip's description or auto-reorder settings. Auto-reorder places billed print orders when stock runs low

**Risk:** `destructive`

```ts theme={null}
await corsair.lob.api.buckslips.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The buckslip's ID, prefixed with bck\_. |
| `description` | `string` | No | — |
| `auto_reorder` | `boolean` | No | Reorder automatically when stock falls below the threshold. |
| `reorder_quantity` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `raw_url` | `string \| null` | No | — |
| `front_original_url` | `string \| null` | No | — |
| `back_original_url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `auto_reorder` | `boolean \| null` | No | — |
| `reorder_quantity` | `number \| null` | No | — |
| `threshold_amount` | `number \| null` | No | — |
| `available_quantity` | `number \| null` | No | — |
| `pending_quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `allocated_quantity` | `number \| null` | No | — |
| `onhand_quantity` | `number \| null` | No | — |
| `projected_quantity` | `number \| null` | No | — |
| `buckslip_orders` | `any` | No | — |
| `stock` | `string \| null` | No | — |
| `weight` | `string \| null` | No | — |
| `finish` | `string \| null` | No | — |

***

## Campaigns

### create

`campaigns.create`

Create a draft campaign for bulk mail. Nothing mails until campaigns.send

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.campaigns.create({ name: 'Spring offer', schedule_type: 'immediate', use_type: 'marketing' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `description` | `string` | No | — |
| `schedule_type` | `immediate` | Yes | When the campaign goes out. Only 'immediate'. |
| `target_delivery_date` | `string` | No | — |
| `send_date` | `string` | No | — |
| `cancel_window_campaign_minutes` | `number` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `auto_cancel_if_ncoa` | `boolean` | No | Cancel pieces whose recipient filed a change of address. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `billing_group_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `schedule_type` | `string \| null` | No | — |
| `target_delivery_date` | `string \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `cancel_window_campaign_minutes` | `number \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `auto_cancel_if_ncoa` | `boolean \| null` | No | — |
| `print_speed` | `string \| null` | No | — |
| `is_draft` | `boolean \| null` | No | — |
| `creatives` | `any` | No | — |
| `uploads` | `any` | No | — |

***

### delete

`campaigns.delete`

Permanently delete a campaign

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

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign's ID, prefixed with cmp\_. |

**Output**

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

***

### get

`campaigns.get`

Read one campaign by its cmp\_ ID, with its creatives and uploads

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign's ID, prefixed with cmp\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `billing_group_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `schedule_type` | `string \| null` | No | — |
| `target_delivery_date` | `string \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `cancel_window_campaign_minutes` | `number \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `auto_cancel_if_ncoa` | `boolean \| null` | No | — |
| `print_speed` | `string \| null` | No | — |
| `is_draft` | `boolean \| null` | No | — |
| `creatives` | `any` | No | — |
| `uploads` | `any` | No | — |

***

### list

`campaigns.list`

Page through campaigns with cursors

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   billing_group_id?: string | null,
>   name?: string | null,
>   schedule_type?: string | null,
>   target_delivery_date?: string | null,
>   send_date?: string | null,
>   cancel_window_campaign_minutes?: number | null,
>   use_type?: string | null,
>   auto_cancel_if_ncoa?: boolean | null,
>   print_speed?: string | null,
>   is_draft?: boolean | null,
>   creatives?: any,
>   uploads?: any
> }[]
> ```

***

### send

`campaigns.send`

Send a campaign: Lob prints, mails and bills a piece for every row of its audience upload. Cannot be undone after the cancel window

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

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign's ID, prefixed with cmp\_. |

Mails every validated row of the campaign upload. Check `uploads.getReport` first.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `billing_group_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `schedule_type` | `string \| null` | No | — |
| `target_delivery_date` | `string \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `cancel_window_campaign_minutes` | `number \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `auto_cancel_if_ncoa` | `boolean \| null` | No | — |
| `print_speed` | `string \| null` | No | — |
| `is_draft` | `boolean \| null` | No | — |
| `creatives` | `any` | No | — |
| `uploads` | `any` | No | — |

***

### update

`campaigns.update`

Change a campaign's name, schedule, use type or other settings

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The campaign's ID, prefixed with cmp\_. |
| `name` | `string` | No | — |
| `description` | `string` | No | — |
| `schedule_type` | `immediate` | No | When the campaign goes out. Only 'immediate'. |
| `target_delivery_date` | `string` | No | — |
| `send_date` | `string` | No | — |
| `cancel_window_campaign_minutes` | `number` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `use_type` | `marketing \| operational \| null` | No | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `auto_cancel_if_ncoa` | `boolean` | No | Cancel pieces whose recipient filed a change of address. |
| `is_draft` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `billing_group_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `schedule_type` | `string \| null` | No | — |
| `target_delivery_date` | `string \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `cancel_window_campaign_minutes` | `number \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `auto_cancel_if_ncoa` | `boolean \| null` | No | — |
| `print_speed` | `string \| null` | No | — |
| `is_draft` | `boolean \| null` | No | — |
| `creatives` | `any` | No | — |
| `uploads` | `any` | No | — |

***

## Cards

### create

`cards.create`

Create a card (a plastic or paper insert) from front and back artwork. Printing happens only when you order stock

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.cards.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `front` | `string` | Yes | https URL of a PDF, PNG or JPG file for this side. |
| `back` | `string` | No | https URL of a PDF, PNG or JPG file for this side. |
| `size` | `3.375x2.125 \| 2.125x3.375` | No | Card size and orientation. Defaults to '2.125x3.375'. |
| `description` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `raw_url` | `string \| null` | No | — |
| `front_original_url` | `string \| null` | No | — |
| `back_original_url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `auto_reorder` | `boolean \| null` | No | — |
| `reorder_quantity` | `number \| null` | No | — |
| `threshold_amount` | `number \| null` | No | — |
| `available_quantity` | `number \| null` | No | — |
| `pending_quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `orientation` | `string \| null` | No | — |

***

### createOrder

`cards.createOrder`

Order a print run of a card (at least 10,000). Lob prints and bills the whole order

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

```ts theme={null}
await corsair.lob.api.cards.createOrder({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The card's ID, prefixed with card\_. |
| `quantity` | `number` | Yes | Pieces to print; Lob bills the order. Minimum 10000. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `quantity_ordered` | `number \| null` | No | — |
| `unit_price` | `number \| null` | No | — |
| `inventory` | `number \| null` | No | — |
| `cancelled_reason` | `string \| null` | No | — |
| `availability_date` | `string \| null` | No | — |
| `expected_availability_date` | `string \| null` | No | — |
| `card_id` | `string \| null` | No | — |

***

### delete

`cards.delete`

Permanently delete a card

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

```ts theme={null}
await corsair.lob.api.cards.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The card's ID, prefixed with card\_. |

**Output**

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

***

### get

`cards.get`

Read one card by its card\_ ID, including stock quantities and status

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.cards.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The card's ID, prefixed with card\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `raw_url` | `string \| null` | No | — |
| `front_original_url` | `string \| null` | No | — |
| `back_original_url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `auto_reorder` | `boolean \| null` | No | — |
| `reorder_quantity` | `number \| null` | No | — |
| `threshold_amount` | `number \| null` | No | — |
| `available_quantity` | `number \| null` | No | — |
| `pending_quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `orientation` | `string \| null` | No | — |

***

### list

`cards.list`

Page through cards with cursors

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.cards.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   size?: string | null,
>   url?: string | null,
>   raw_url?: string | null,
>   front_original_url?: string | null,
>   back_original_url?: string | null,
>   thumbnails?: any,
>   auto_reorder?: boolean | null,
>   reorder_quantity?: number | null,
>   threshold_amount?: number | null,
>   available_quantity?: number | null,
>   pending_quantity?: number | null,
>   status?: string | null,
>   orientation?: string | null
> }[]
> ```

***

### listOrders

`cards.listOrders`

List the print orders placed for a card

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.cards.listOrders({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The card's ID, prefixed with card\_. |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `offset` | `number` | No | Rows to skip. Defaults to 0. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   status?: string | null,
>   quantity_ordered?: number | null,
>   unit_price?: number | null,
>   inventory?: number | null,
>   cancelled_reason?: string | null,
>   availability_date?: string | null,
>   expected_availability_date?: string | null,
>   card_id?: string | null
> }[]
> ```

***

### update

`cards.update`

Change a card's description or auto-reorder settings. Auto-reorder places billed print orders when stock runs low

**Risk:** `destructive`

```ts theme={null}
await corsair.lob.api.cards.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The card's ID, prefixed with card\_. |
| `description` | `string` | No | — |
| `auto_reorder` | `boolean` | No | Reorder automatically when stock falls below the threshold. |
| `reorder_quantity` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `raw_url` | `string \| null` | No | — |
| `front_original_url` | `string \| null` | No | — |
| `back_original_url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `auto_reorder` | `boolean \| null` | No | — |
| `reorder_quantity` | `number \| null` | No | — |
| `threshold_amount` | `number \| null` | No | — |
| `available_quantity` | `number \| null` | No | — |
| `pending_quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `orientation` | `string \| null` | No | — |

***

## Checks

### cancel

`checks.cancel`

Cancel a check before it goes to production. A cancelled check cannot be restored

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

```ts theme={null}
await corsair.lob.api.checks.cancel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The check's ID, prefixed with chk\_. |

**Output**

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

***

### get

`checks.get`

Read one check by its chk\_ ID, including status, tracking events and the PDF preview URL

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.checks.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The check's ID, prefixed with chk\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `amount` | `number \| null` | No | — |
| `memo` | `string \| null` | No | — |
| `check_number` | `number \| null` | No | — |
| `message` | `string \| null` | No | — |
| `bank_account` | `any` | No | — |
| `check_bottom_template_id` | `string \| null` | No | — |
| `attachment_template_id` | `string \| null` | No | — |
| `check_bottom_template_version_id` | `string \| null` | No | — |
| `attachment_template_version_id` | `string \| null` | No | — |

***

### list

`checks.list`

Page through checks with cursors and filters (status, send date, metadata)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.checks.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation time. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |
| `status` | `processed \| rendered \| failed` | No | Render status. |
| `scheduled` | `boolean` | No | True for pieces with a future send\_date only. |
| `send_date` | `object` | No | ISO 8601 bounds on send\_date. |
| `mail_type` | `usps_first_class \| usps_standard` | No | — |
| `sort_by` | `object` | No | Sort by date\_created or send\_date, not both. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] send\_date full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   send_date: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   to?: any,
>   from?: any,
>   carrier?: string | null,
>   thumbnails?: any,
>   expected_delivery_date?: string | null,
>   url?: string | null,
>   tracking_events?: any,
>   campaign_id?: string | null,
>   use_type?: string | null,
>   fsc?: boolean | null,
>   status?: string | null,
>   failure_reason?: any,
>   mail_type?: string | null,
>   merge_variables?: any,
>   send_date?: string | null,
>   size?: string | null,
>   amount?: number | null,
>   memo?: string | null,
>   check_number?: number | null,
>   message?: string | null,
>   bank_account?: any,
>   check_bottom_template_id?: string | null,
>   attachment_template_id?: string | null,
>   check_bottom_template_version_id?: string | null,
>   attachment_template_version_id?: string | null
> }[]
> ```

***

### send

`checks.send`

Print and mail a real check drawn on a verified bank account. Moves money and is billed per piece; pass an idempotency\_key so a replay returns the original check

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

```ts theme={null}
await corsair.lob.api.checks.send({ to: 'adr_210a8d4b0b76d77b', from: 'adr_fa64eaa6b3f335', bank_account: 'bank_8cad8df5354d33f', amount: 22.5, memo: 'rent', message: 'Thank you', use_type: 'operational', idempotency_key: 'rent-2026-12' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `string \| object` | Yes | Recipient: an address ID (adr\_...) or an inline address. |
| `from` | `string \| object` | Yes | Return address: an address ID (adr\_...) or an inline address. |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `mail_type` | `usps_first_class` | No | Checks mail only 'usps\_first\_class'. |
| `merge_variables` | `Record<string, any> \| null` | No | Per-mailpiece template variables, keyed by merge variable name. |
| `send_date` | `string` | No | ISO 8601 date (2026-01-01) or datetime; Lob schedules production after it, up to 180 days out. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `idempotency_key` | `string` | No | Deduplication key, at most 256 characters. Lob replays within 24 hours return the original mailpiece instead of creating a duplicate. |
| `bank_account` | `string` | Yes | bank\_ ID of a verified bank account to draw on. |
| `amount` | `number` | Yes | Check amount in dollars, up to 999999.99. |
| `memo` | `string` | No | — |
| `check_number` | `number` | No | — |
| `message` | `string` | No | Text printed on the check bottom. Use this or check\_bottom. |
| `logo` | `string` | No | https URL of a square PNG or JPG logo. |
| `check_bottom` | `string \| string \| string` | No | Artwork for the check bottom. Use this or message. |
| `attachment` | `string \| string \| string` | No | Artwork for a page attached after the check. |
| `service_request_number` | `string \| null` | No | SR# of an approved USPS promotion to apply. Top-level only: Lob ignores it inside merge\_variables. |

Draws on a verified bank account (bankAccounts.create, then bankAccounts.verify). Provide `message` or `check_bottom`, not both. Test keys never move money.

> [accordion] to full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `amount` | `number \| null` | No | — |
| `memo` | `string \| null` | No | — |
| `check_number` | `number \| null` | No | — |
| `message` | `string \| null` | No | — |
| `bank_account` | `any` | No | — |
| `check_bottom_template_id` | `string \| null` | No | — |
| `attachment_template_id` | `string \| null` | No | — |
| `check_bottom_template_version_id` | `string \| null` | No | — |
| `attachment_template_version_id` | `string \| null` | No | — |

***

## Creatives

### create

`creatives.create`

Add the artwork (a postcard, letter or self mailer creative) to a campaign

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.creatives.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `campaign_id` | `string` | Yes | cmp\_ ID the creative belongs to. |
| `resource_type` | `postcard \| letter \| self_mailer` | Yes | The mail format. |
| `details` | `Record<string, any>` | Yes | Format details, such as \{ size: "4x6", mail\_type: "usps\_first\_class" } for a postcard. |
| `from` | `string \| object` | No | Return address: an address ID (adr\_...) or an inline address. |
| `front` | `string \| string \| string` | No | Postcards: front artwork. |
| `back` | `string \| string \| string` | No | Postcards: back artwork. |
| `file` | `string \| string \| string` | No | Letters: the letter artwork. |
| `inside` | `string \| string \| string` | No | Self mailers: inside artwork. |
| `outside` | `string \| string \| string` | No | Self mailers: outside artwork. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `campaigns` | `any` | No | — |
| `resource_type` | `string \| null` | No | — |
| `details` | `any` | No | — |
| `from` | `any` | No | — |
| `template_preview_urls` | `any` | No | — |
| `template_previews` | `any` | No | — |

***

### get

`creatives.get`

Read one creative by its crv\_ ID

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.creatives.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The creative's ID, prefixed with crv\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `campaigns` | `any` | No | — |
| `resource_type` | `string \| null` | No | — |
| `details` | `any` | No | — |
| `from` | `any` | No | — |
| `template_preview_urls` | `any` | No | — |
| `template_previews` | `any` | No | — |

***

### update

`creatives.update`

Change a creative's return address, description or metadata

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.creatives.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The creative's ID, prefixed with crv\_. |
| `from` | `string \| object` | No | Return address: an address ID (adr\_...) or an inline address. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `campaigns` | `any` | No | — |
| `resource_type` | `string \| null` | No | — |
| `details` | `any` | No | — |
| `from` | `any` | No | — |
| `template_preview_urls` | `any` | No | — |
| `template_previews` | `any` | No | — |

***

## Domains

### create

`domains.create`

Register a custom domain for short links

**Risk:** `write`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | A domain you own, such as lob.st. |
| `error_redirect_link` | `string` | No | Where unknown short links redirect. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `error_redirect_link` | `string \| null` | No | — |
| `status` | `string \| null` | No | configured or not\_configured. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### delete

`domains.delete`

Permanently delete a short-link domain; its links stop resolving

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

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The domain's ID. |

**Output**

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

***

### get

`domains.get`

Read one short-link domain, including whether its DNS is configured

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The domain's ID. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `error_redirect_link` | `string \| null` | No | — |
| `status` | `string \| null` | No | configured or not\_configured. |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### list

`domains.list`

Page through short-link domains

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `status` | `configured \| not_configured` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   domain?: string | null,
>   error_redirect_link?: string | null,
>   status?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   object?: string | null
> }[]
> ```

***

## Identity Validation

### validate

`identityValidation.validate`

Score how likely a person or company is associated with a US address (0-100, with a high/medium/low confidence)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.identityValidation.validate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `recipient` | `string` | No | — |
| `company` | `string` | No | — |
| `primary_line` | `string` | Yes | — |
| `secondary_line` | `string` | No | — |
| `urbanization` | `string` | No | — |
| `city` | `string` | No | — |
| `state` | `string` | No | — |
| `zip_code` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `recipient` | `string \| null` | No | — |
| `company` | `string \| null` | No | — |
| `primary_line` | `string \| null` | No | — |
| `secondary_line` | `string \| null` | No | — |
| `urbanization` | `string \| null` | No | — |
| `last_line` | `string \| null` | No | — |
| `score` | `number \| null` | No | 0-100 likelihood the name is associated with the address. |
| `confidence` | `string \| null` | No | high, medium, low or none. |
| `object` | `string \| null` | No | — |

***

## Informed Delivery

### create

`informedDelivery.create`

Create a USPS Informed Delivery campaign (an email preview with a ride-along image and link). Lob approves it on create unless status is 'pending\_approval'

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.informedDelivery.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `quantity` | `number` | No | — |
| `ride_along_url` | `string` | No | Where the ride-along image links to. |
| `start_date` | `string` | No | YYYY-MM-DD. |
| `brand_name` | `string` | No | — |
| `usps_title` | `string` | No | — |
| `lob_campaign_id` | `string` | No | — |
| `ride_along_image` | `string \| object` | No | An image: a public URL, \{url, filename?, contentType?}, or \{base64, filename?, contentType?}. |
| `representative_image` | `string \| object` | No | An image: a public URL, \{url, filename?, contentType?}, or \{base64, filename?, contentType?}. |
| `status` | `pending_approval` | No | Pass 'pending\_approval' to keep the campaign editable and inactive. When omitted, Lob creates it approved: active and no longer editable. |

> [accordion] ride\_along\_image full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> }
> ```

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `ride_along_url` | `string \| null` | No | — |
| `start_date` | `string \| null` | No | — |
| `end_date` | `string \| null` | No | — |
| `brand_name` | `string \| null` | No | — |
| `usps_title` | `string \| null` | No | — |
| `lob_campaign_id` | `string \| null` | No | — |
| `account_id` | `string \| null` | No | — |
| `usps_campaign_id` | `string \| null` | No | — |
| `start_serial` | `number \| null` | No | — |
| `end_serial` | `number \| null` | No | — |
| `ride_along_image_s3_link` | `string \| null` | No | — |
| `representative_image_s3_link` | `string \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `campaign_code` | `string \| null` | No | — |
| `service_request_number` | `string \| null` | No | — |

***

### get

`informedDelivery.get`

Read one Informed Delivery campaign by its USPS campaign ID

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.informedDelivery.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The usps\_campaign\_id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `ride_along_url` | `string \| null` | No | — |
| `start_date` | `string \| null` | No | — |
| `end_date` | `string \| null` | No | — |
| `brand_name` | `string \| null` | No | — |
| `usps_title` | `string \| null` | No | — |
| `lob_campaign_id` | `string \| null` | No | — |
| `account_id` | `string \| null` | No | — |
| `usps_campaign_id` | `string \| null` | No | — |
| `start_serial` | `number \| null` | No | — |
| `end_serial` | `number \| null` | No | — |
| `ride_along_image_s3_link` | `string \| null` | No | — |
| `representative_image_s3_link` | `string \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `campaign_code` | `string \| null` | No | — |
| `service_request_number` | `string \| null` | No | — |

***

### list

`informedDelivery.list`

List USPS Informed Delivery campaigns

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.informedDelivery.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   quantity?: number | null,
>   status?: string | null,
>   ride_along_url?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   brand_name?: string | null,
>   usps_title?: string | null,
>   lob_campaign_id?: string | null,
>   account_id?: string | null,
>   usps_campaign_id?: string | null,
>   start_serial?: number | null,
>   end_serial?: number | null,
>   ride_along_image_s3_link?: string | null,
>   representative_image_s3_link?: string | null,
>   mode?: string | null,
>   campaign_code?: string | null,
>   service_request_number?: string | null
> }[]
> ```

***

### update

`informedDelivery.update`

Change an Informed Delivery campaign's details or approve it

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.informedDelivery.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The usps\_campaign\_id. |
| `quantity` | `number` | No | — |
| `ride_along_url` | `string` | No | Where the ride-along image links to. |
| `start_date` | `string` | No | YYYY-MM-DD. |
| `brand_name` | `string` | No | — |
| `usps_title` | `string` | No | — |
| `lob_campaign_id` | `string` | No | — |
| `ride_along_image` | `string \| object` | No | An image: a public URL, \{url, filename?, contentType?}, or \{base64, filename?, contentType?}. |
| `representative_image` | `string \| object` | No | An image: a public URL, \{url, filename?, contentType?}, or \{base64, filename?, contentType?}. |
| `status` | `approved` | No | Pass 'approved' to approve the campaign. |

> [accordion] ride\_along\_image full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> }
> ```

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `quantity` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `ride_along_url` | `string \| null` | No | — |
| `start_date` | `string \| null` | No | — |
| `end_date` | `string \| null` | No | — |
| `brand_name` | `string \| null` | No | — |
| `usps_title` | `string \| null` | No | — |
| `lob_campaign_id` | `string \| null` | No | — |
| `account_id` | `string \| null` | No | — |
| `usps_campaign_id` | `string \| null` | No | — |
| `start_serial` | `number \| null` | No | — |
| `end_serial` | `number \| null` | No | — |
| `ride_along_image_s3_link` | `string \| null` | No | — |
| `representative_image_s3_link` | `string \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `campaign_code` | `string \| null` | No | — |
| `service_request_number` | `string \| null` | No | — |

***

## Intl Verifications

### bulk

`intlVerifications.bulk`

Verify up to 20 international addresses in one call; each row comes back as a verification or a per-row error. Bills each row on a live key

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.intlVerifications.bulk({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `addresses` | `object[]` | Yes | Up to 20 international addresses. |

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   recipient?: string,
>   primary_line: string,
>   secondary_line?: string,
>   city?: string,
>   state?: string,
>   postal_code?: string,
>   country: AD | AE | AF | AG | AI | AL | AN | AO | AQ | AR | AT | AU | AW | AZ | BA | BB | BD | BE | BF | BG | BH | BI | BJ | BM | BN | BO | BQ | BR | BS | BT | BW | BY | BZ | CA | CD | CG | CH | CI | CK | CL | CM | CN | CO | CR | CS | CU | CV | CW | CY | CZ | DE | DJ | DK | DM | DO | DZ | EC | EE | EG | EH | ER | ES | ET | FI | FJ | FK | FO | FR | GA | GB | GD | GE | GH | GI | GL | GM | GN | GQ | GR | GS | GT | GW | GY | HK | HN | HR | HT | HU | ID | IE | IL | IN | IO | IQ | IR | IS | IT | JM | JO | JP | KE | KG | KH | KI | KM | KN | KP | KR | KW | KY | KZ | LA | LB | LC | LI | LK | LR | LS | LT | LU | LV | LY | MA | MC | MD | ME | MG | MK | ML | MM | MN | MO | MR | MS | MT | MU | MV | MW | MX | MY | MZ | NA | NE | NF | NG | NI | NL | NO | NP | NR | NU | NZ | OM | PA | PE | PG | PH | PK | PL | PN | PT | PY | QA | RO | RS | RU | RW | SA | SB | SC | SD | SE | SG | SH | SI | SK | SL | SM | SN | SO | SR | SS | ST | SV | SX | SY | SZ | TC | TD | TG | TH | TJ | TK | TL | TM | TN | TO | TR | TT | TV | TW | TZ | UA | UG | UY | UZ | VA | VC | VE | VG | VN | VU | WS | YE | ZA | ZM | ZW
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addresses` | `object[] \| null` | No | — |
| `errors` | `boolean \| null` | No | True when at least one row failed. |

> [accordion] addresses full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     recipient?: string | null,
>     primary_line?: string | null,
>     secondary_line?: string | null,
>     last_line?: string | null,
>     country?: string | null,
>     coverage?: string | null,
>     deliverability?: string | null,
>     status?: string | null,
>     components?: Record<string, any> | null,
>     object?: string | null
>   } | {
>     error: {
>       message?: string | null,
>       status_code?: number | null,
>       code?: string | null
>     }
>   }
> )[] | null
> ```

***

### verify

`intlVerifications.verify`

Verify one international address and get its deliverability, coverage level and parsed components

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.intlVerifications.verify({ primary_line: '123 Paramount Rd', city: 'Toronto', state: 'ON', postal_code: 'M5V 2T6', country: 'CA' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `recipient` | `string` | No | — |
| `primary_line` | `string` | No | Delivery line, such as 'Delancey Street 123'. |
| `secondary_line` | `string` | No | — |
| `city` | `string` | No | — |
| `state` | `string` | No | — |
| `postal_code` | `string` | No | — |
| `country` | `AD \| AE \| AF \| AG \| AI \| AL \| AN \| AO \| AQ \| AR \| AT \| AU \| AW \| AZ \| BA \| BB \| BD \| BE \| BF \| BG \| BH \| BI \| BJ \| BM \| BN \| BO \| BQ \| BR \| BS \| BT \| BW \| BY \| BZ \| CA \| CD \| CG \| CH \| CI \| CK \| CL \| CM \| CN \| CO \| CR \| CS \| CU \| CV \| CW \| CY \| CZ \| DE \| DJ \| DK \| DM \| DO \| DZ \| EC \| EE \| EG \| EH \| ER \| ES \| ET \| FI \| FJ \| FK \| FO \| FR \| GA \| GB \| GD \| GE \| GH \| GI \| GL \| GM \| GN \| GQ \| GR \| GS \| GT \| GW \| GY \| HK \| HN \| HR \| HT \| HU \| ID \| IE \| IL \| IN \| IO \| IQ \| IR \| IS \| IT \| JM \| JO \| JP \| KE \| KG \| KH \| KI \| KM \| KN \| KP \| KR \| KW \| KY \| KZ \| LA \| LB \| LC \| LI \| LK \| LR \| LS \| LT \| LU \| LV \| LY \| MA \| MC \| MD \| ME \| MG \| MK \| ML \| MM \| MN \| MO \| MR \| MS \| MT \| MU \| MV \| MW \| MX \| MY \| MZ \| NA \| NE \| NF \| NG \| NI \| NL \| NO \| NP \| NR \| NU \| NZ \| OM \| PA \| PE \| PG \| PH \| PK \| PL \| PN \| PT \| PY \| QA \| RO \| RS \| RU \| RW \| SA \| SB \| SC \| SD \| SE \| SG \| SH \| SI \| SK \| SL \| SM \| SN \| SO \| SR \| SS \| ST \| SV \| SX \| SY \| SZ \| TC \| TD \| TG \| TH \| TJ \| TK \| TL \| TM \| TN \| TO \| TR \| TT \| TV \| TW \| TZ \| UA \| UG \| UY \| UZ \| VA \| VC \| VE \| VG \| VN \| VU \| WS \| YE \| ZA \| ZM \| ZW` | Yes | Two-letter ISO 3166-1 alpha-2 country code. Outside the US and US territories this selects international processing. |
| `address` | `string` | No | Full address on one line. When set, it replaces the component fields. |

The `country` code selects international processing; it must not be US. A live key bills each verification.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `recipient` | `string \| null` | No | — |
| `primary_line` | `string \| null` | No | — |
| `secondary_line` | `string \| null` | No | — |
| `last_line` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `coverage` | `string \| null` | No | — |
| `deliverability` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `components` | `Record<string, any> \| null` | No | — |
| `object` | `string \| null` | No | — |

***

## Letters

### cancel

`letters.cancel`

Cancel a letter before it goes to production. Works only within the cancellation window; a cancelled piece cannot be restored

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

```ts theme={null}
await corsair.lob.api.letters.cancel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The letter's ID, prefixed with ltr\_. |

**Output**

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

***

### get

`letters.get`

Read one letter by its ltr\_ ID, including tracking number and events on certified or registered mail

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.letters.get({ id: 'ltr_489a2ce9d621bde' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The letter's ID, prefixed with ltr\_. |

`tracking_number` and `tracking_events` appear on certified and registered mail.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `to` | `Record<string, any> \| null` | No | — |
| `from` | `Record<string, any> \| null` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `Record<string, any>[] \| null` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `template_version_id` | `string \| null` | No | — |
| `tracking_events` | `Record<string, any>[] \| null` | No | — |
| `tracking_number` | `string \| null` | No | Present on certified and registered mail. |
| `extra_service` | `string \| null` | No | — |
| `return_address` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `Record<string, any> \| null` | No | — |
| `color` | `boolean \| null` | No | — |
| `double_sided` | `boolean \| null` | No | — |
| `address_placement` | `string \| null` | No | — |
| `perforated_page` | `number \| null` | No | — |
| `return_envelope` | `any` | No | — |
| `custom_envelope` | `any` | No | — |
| `cards` | `any` | No | — |
| `buckslips` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `Record<string, any> \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### list

`letters.list`

Page through letters with cursors and filters (status, color, campaign, send date, metadata)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.letters.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation time. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |
| `campaign_id` | `string` | No | — |
| `status` | `processed \| rendered \| failed` | No | Render status. |
| `scheduled` | `boolean` | No | True for pieces with a future send\_date only. |
| `send_date` | `object` | No | ISO 8601 bounds on send\_date. |
| `mail_type` | `usps_first_class \| usps_standard` | No | — |
| `sort_by` | `object` | No | Sort by date\_created or send\_date, not both. |
| `color` | `boolean` | No | Only color or black-and-white. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] send\_date full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   send_date: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   to?: Record<string, any> | null,
>   from?: Record<string, any> | null,
>   carrier?: string | null,
>   thumbnails?: Record<string, any>[] | null,
>   expected_delivery_date?: string | null,
>   url?: string | null,
>   template_id?: string | null,
>   template_version_id?: string | null,
>   tracking_events?: Record<string, any>[] | null,
>   tracking_number?: string | null,
>   extra_service?: string | null,
>   return_address?: any,
>   campaign_id?: string | null,
>   use_type?: string | null,
>   fsc?: boolean | null,
>   status?: string | null,
>   failure_reason?: Record<string, any> | null,
>   color?: boolean | null,
>   double_sided?: boolean | null,
>   address_placement?: string | null,
>   perforated_page?: number | null,
>   return_envelope?: any,
>   custom_envelope?: any,
>   cards?: any,
>   buckslips?: any,
>   mail_type?: string | null,
>   merge_variables?: Record<string, any> | null,
>   send_date?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null
> }[]
> ```

***

### send

`letters.send`

Send a real letter that Lob prints, stuffs and mails. Each piece is billed and cannot be recalled once in production; pass an idempotency\_key so a replay returns the original instead of mailing twice

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

```ts theme={null}
await corsair.lob.api.letters.send({ to: 'adr_210a8d4b0b76d77b', from: 'adr_fa64eaa6b3f335', file: '<html>Invoice 1234 due Friday</html>', color: false, use_type: 'operational', idempotency_key: 'invoice-1234' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `string \| object` | Yes | Recipient: an address ID (adr\_...) or an inline address. |
| `from` | `string \| object` | Yes | Return address: an address ID (adr\_...) or an inline address. |
| `file` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `color` | `boolean` | Yes | Print in color. Lob requires this field; it defaults to false when omitted server-side. |
| `extra_service` | `certified \| certified_return_receipt \| registered \| null` | No | Adds USPS tracking; certified and registered add fees. |
| `double_sided` | `boolean` | No | Print on both sides of the paper. Defaults to true. |
| `address_placement` | `top_first_page \| insert_blank_page \| bottom_first_page_center \| bottom_first_page` | No | Where the address window sits. Defaults to 'top\_first\_page'. |
| `size` | `us_letter \| us_legal` | No | Paper size. Defaults to 'us\_letter'; only accepted with Lob-Version 2024-01-01 or newer. |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `mail_type` | `usps_first_class \| usps_standard` | No | Postage class. Defaults to 'usps\_first\_class'. |
| `merge_variables` | `Record<string, any> \| null` | No | Per-mailpiece template variables, keyed by merge variable name. |
| `send_date` | `string` | No | ISO 8601 date (2026-01-01) or datetime; Lob schedules production after it, up to 180 days out. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `return_envelope` | `boolean \| string` | No | Include a return envelope: true for the standard one, or a custom envelope ID. |
| `perforated_page` | `number` | No | Page to perforate for a tear-off; needs return\_envelope. |
| `custom_envelope` | `string` | No | env\_ ID of a custom envelope. |
| `cards` | `string[]` | No | card\_ IDs of cards to insert (one per letter). |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `qr_code` | `object` | No | Print a tracked QR code on the piece. |
| `fsc` | `boolean` | No | Print on FSC-certified paper. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `service_request_number` | `string \| null` | No | SR# of an approved USPS promotion to apply. Top-level only: Lob ignores it inside merge\_variables. |
| `lob_version` | `string` | No | Sent as the Lob-Version header, such as '2024-01-01'; letter size needs 2024-01-01 or newer. |
| `idempotency_key` | `string` | No | Deduplication key, at most 256 characters. Lob replays within 24 hours return the original mailpiece instead of creating a duplicate. |

Bills a physical mailpiece. `color` is required by Lob (defaults to false server-side). `extra_service` adds certified or registered tracking and its fees. With an `idempotency_key`, replays within 24 hours return the original piece.

> [accordion] to full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] qr\_code full type
>
> ```ts theme={null}
> {
>   position: relative,
>   redirect_url?: string,
>   width: string,
>   top?: string,
>   right?: string,
>   left?: string,
>   bottom?: string,
>   pages?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `to` | `Record<string, any> \| null` | No | — |
| `from` | `Record<string, any> \| null` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `Record<string, any>[] \| null` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `template_version_id` | `string \| null` | No | — |
| `tracking_events` | `Record<string, any>[] \| null` | No | — |
| `tracking_number` | `string \| null` | No | Present on certified and registered mail. |
| `extra_service` | `string \| null` | No | — |
| `return_address` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `Record<string, any> \| null` | No | — |
| `color` | `boolean \| null` | No | — |
| `double_sided` | `boolean \| null` | No | — |
| `address_placement` | `string \| null` | No | — |
| `perforated_page` | `number \| null` | No | — |
| `return_envelope` | `any` | No | — |
| `custom_envelope` | `any` | No | — |
| `cards` | `any` | No | — |
| `buckslips` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `Record<string, any> \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |

***

## Links

### create

`links.create`

Create a short link that redirects to a long URL

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.links.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `redirect_link` | `string` | Yes | The long URL. |
| `title` | `string` | No | — |
| `domain` | `string` | No | A configured custom domain; Lob's own domain when omitted. |
| `slug` | `string` | No | Custom path for the short link. |
| `metadata` | `Record<string, string>` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `domain_id` | `string \| null` | No | — |
| `redirect_link` | `string \| null` | No | — |
| `short_link` | `string \| null` | No | — |
| `metadata` | `any` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### delete

`links.delete`

Permanently delete a short link; printed copies stop resolving

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

```ts theme={null}
await corsair.lob.api.links.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The short link's ID. |

**Output**

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

***

### get

`links.get`

Read one short link

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.links.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The short link's ID. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `domain_id` | `string \| null` | No | — |
| `redirect_link` | `string \| null` | No | — |
| `short_link` | `string \| null` | No | — |
| `metadata` | `any` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### list

`links.list`

Page through short links, optionally by campaign or domain

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.links.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `campaign_id` | `string` | No | — |
| `domain_id` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   title?: string | null,
>   domain_id?: string | null,
>   redirect_link?: string | null,
>   short_link?: string | null,
>   metadata?: any,
>   created_at?: string | null,
>   updated_at?: string | null,
>   object?: string | null
> }[]
> ```

***

### update

`links.update`

Change a short link's target URL, title or metadata

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.links.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The short link's ID. |
| `redirect_link` | `string` | Yes | — |
| `title` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `domain_id` | `string \| null` | No | — |
| `redirect_link` | `string \| null` | No | — |
| `short_link` | `string \| null` | No | — |
| `metadata` | `any` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `object` | `string \| null` | No | — |

***

## Postcards

### cancel

`postcards.cancel`

Cancel a postcard before it goes to production. Works only within the cancellation window; a cancelled piece cannot be restored

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

```ts theme={null}
await corsair.lob.api.postcards.cancel({ id: 'psc_208e45e48d271294' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The postcard's ID, prefixed with psc\_. |

**Output**

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

***

### get

`postcards.get`

Read one postcard by its psc\_ ID, including print status and the signed PDF preview URL

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.postcards.get({ id: 'psc_208e45e48d271294' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The postcard's ID, prefixed with psc\_. |

The signed `url` expires after 30 days. `status` moves through `rendered` and `processed` (or `failed` with a `failure_reason`).

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `to` | `Record<string, any> \| null` | No | — |
| `from` | `Record<string, any> \| null` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `Record<string, any>[] \| null` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `front_template_id` | `string \| null` | No | — |
| `back_template_id` | `string \| null` | No | — |
| `front_template_version_id` | `string \| null` | No | — |
| `back_template_version_id` | `string \| null` | No | — |
| `tracking_events` | `Record<string, any>[] \| null` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `Record<string, any> \| null` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `Record<string, any> \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |

***

### list

`postcards.list`

Page through postcards with cursors and filters (status, size, campaign, send date, metadata)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.postcards.list({ limit: 10, status: 'rendered', include: ['total_count'], sort_by: { date_created: 'desc' } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation time. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |
| `campaign_id` | `string` | No | — |
| `status` | `processed \| rendered \| failed` | No | Render status. |
| `scheduled` | `boolean` | No | True for pieces with a future send\_date only. |
| `send_date` | `object` | No | ISO 8601 bounds on send\_date. |
| `mail_type` | `usps_first_class \| usps_standard` | No | — |
| `sort_by` | `object` | No | Sort by date\_created or send\_date, not both. |
| `size` | `(4x6 \| 6x9 \| 6x11)[]` | No | Only these sizes. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] send\_date full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   send_date: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   size?: string | null,
>   to?: Record<string, any> | null,
>   from?: Record<string, any> | null,
>   carrier?: string | null,
>   thumbnails?: Record<string, any>[] | null,
>   expected_delivery_date?: string | null,
>   url?: string | null,
>   front_template_id?: string | null,
>   back_template_id?: string | null,
>   front_template_version_id?: string | null,
>   back_template_version_id?: string | null,
>   tracking_events?: Record<string, any>[] | null,
>   campaign_id?: string | null,
>   use_type?: string | null,
>   fsc?: boolean | null,
>   status?: string | null,
>   failure_reason?: Record<string, any> | null,
>   mail_type?: string | null,
>   merge_variables?: Record<string, any> | null,
>   send_date?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null
> }[]
> ```

***

### send

`postcards.send`

Send a real postcard that Lob prints and mails. Each piece is billed and cannot be recalled once in production; pass an idempotency\_key so a replay returns the original instead of mailing twice

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

```ts theme={null}
await corsair.lob.api.postcards.send({ to: 'adr_210a8d4b0b76d77b', front: '<html style="font-size:36px">Sale ends Friday</html>', back: '<html style="font-size:24px">Acme Logistics</html>', use_type: 'marketing', idempotency_key: 'welcome-series-42' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `string \| object` | Yes | Recipient: an address ID (adr\_...) or an inline address. |
| `from` | `string \| object` | No | Return address. Lob falls back to a permanent return address on file when omitted. |
| `front` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `back` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `size` | `4x6 \| 6x9 \| 6x11` | No | Postcard size. Defaults to '4x6'. |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `mail_type` | `usps_first_class \| usps_standard` | No | Postage class. Defaults to 'usps\_first\_class'. |
| `merge_variables` | `Record<string, any> \| null` | No | Per-mailpiece template variables, keyed by merge variable name. |
| `send_date` | `string` | No | ISO 8601 date (2026-01-01) or datetime; Lob schedules production after it, up to 180 days out. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `qr_code` | `object` | No | Print a tracked QR code on the piece. |
| `fsc` | `boolean` | No | Print on FSC-certified paper. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `service_request_number` | `string \| null` | No | SR# of an approved USPS promotion to apply. Top-level only: Lob ignores it inside merge\_variables. |
| `idempotency_key` | `string` | No | Deduplication key, at most 256 characters. Lob replays within 24 hours return the original mailpiece instead of creating a duplicate. |

Bills a physical mailpiece. `use_type` is required by Lob and accepts `marketing` or `operational` (`null` only when the account has a default use type set in Lob's settings); `size` defaults to 4x6. With an `idempotency_key`, replays within 24 hours return the original piece.

> [accordion] to full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] qr\_code full type
>
> ```ts theme={null}
> {
>   position: relative,
>   redirect_url?: string,
>   width: string,
>   top?: string,
>   right?: string,
>   left?: string,
>   bottom?: string,
>   pages?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `to` | `Record<string, any> \| null` | No | — |
| `from` | `Record<string, any> \| null` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `Record<string, any>[] \| null` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `front_template_id` | `string \| null` | No | — |
| `back_template_id` | `string \| null` | No | — |
| `front_template_version_id` | `string \| null` | No | — |
| `back_template_version_id` | `string \| null` | No | — |
| `tracking_events` | `Record<string, any>[] \| null` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `Record<string, any> \| null` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `Record<string, any> \| null` | No | — |
| `send_date` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |

***

## Qr Codes

### list

`qrCodes.list`

List QR code scan analytics for mailpieces, optionally only scanned codes or given piece IDs

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.qrCodes.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `offset` | `number` | No | Rows to skip. Defaults to 0. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | — |
| `scanned` | `boolean` | No | Only scanned or unscanned codes. |
| `resource_ids` | `string[]` | No | Only these mailpiece IDs. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | — |
| `scanned_count` | `number \| null` | No | — |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   resource_id?: string | null,
>   date_created?: string | null,
>   number_of_scans?: number | null,
>   scans?: any
> }[]
> ```

***

## Resource Proofs

### create

`resourceProofs.create`

Render a proof of a postcard, letter or self mailer for review, without mailing anything

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.resourceProofs.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `resource_type` | `postcard \| letter \| self_mailer` | Yes | — |
| `resource_parameters` | `Record<string, any>` | Yes | The mailpiece fields to render, as for a send, such as \{ to, front, back } for a postcard. |
| `template_id` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `resource_type` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `resource_parameters` | `any` | No | — |
| `status` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |

***

### get

`resourceProofs.get`

Read one resource proof by its res\_prf\_ ID, including the rendered PDF URL

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.resourceProofs.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The resource proof's ID, prefixed with res\_prf\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `resource_type` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `resource_parameters` | `any` | No | — |
| `status` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |

***

### update

`resourceProofs.update`

Re-render a resource proof with a different template

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.resourceProofs.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The resource proof's ID, prefixed with res\_prf\_. |
| `template_id` | `string` | Yes | tmpl\_ ID to render instead. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `resource_type` | `string \| null` | No | — |
| `template_id` | `string \| null` | No | — |
| `resource_parameters` | `any` | No | — |
| `status` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |

***

## Reverse Geocode

### lookup

`reverseGeocode.lookup`

Find the US ZIP and ZIP+4 areas nearest a latitude and longitude, sorted by distance

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.reverseGeocode.lookup({ latitude: 37.777456, longitude: -122.393039, size: 3 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `latitude` | `number` | Yes | — |
| `longitude` | `number` | Yes | — |
| `size` | `number` | No | How many nearby ZIP+4 areas to return. Defaults to 5. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `addresses` | `Record<string, any>[] \| null` | No | — |
| `object` | `string \| null` | No | — |

***

## Self Mailers

### cancel

`selfMailers.cancel`

Cancel a self mailer before it goes to production. A cancelled piece cannot be restored

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

```ts theme={null}
await corsair.lob.api.selfMailers.cancel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The self mailer's ID, prefixed with sfm\_. |

**Output**

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

***

### get

`selfMailers.get`

Read one self mailer by its sfm\_ ID, including status and tracking events

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.selfMailers.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The self mailer's ID, prefixed with sfm\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `inside_template_id` | `string \| null` | No | — |
| `outside_template_id` | `string \| null` | No | — |
| `inside_template_version_id` | `string \| null` | No | — |
| `outside_template_version_id` | `string \| null` | No | — |

***

### list

`selfMailers.list`

Page through self mailers with cursors and filters (status, size, campaign, send date, metadata)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.selfMailers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation time. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |
| `campaign_id` | `string` | No | — |
| `status` | `processed \| rendered \| failed` | No | Render status. |
| `scheduled` | `boolean` | No | True for pieces with a future send\_date only. |
| `send_date` | `object` | No | ISO 8601 bounds on send\_date. |
| `mail_type` | `usps_first_class \| usps_standard` | No | — |
| `sort_by` | `object` | No | Sort by date\_created or send\_date, not both. |
| `size` | `(6x18_bifold \| 11x9_bifold \| 12x9_bifold \| 17.75x9_trifold)[]` | No | — |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] send\_date full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   send_date: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   to?: any,
>   from?: any,
>   carrier?: string | null,
>   thumbnails?: any,
>   expected_delivery_date?: string | null,
>   url?: string | null,
>   tracking_events?: any,
>   campaign_id?: string | null,
>   use_type?: string | null,
>   fsc?: boolean | null,
>   status?: string | null,
>   failure_reason?: any,
>   mail_type?: string | null,
>   merge_variables?: any,
>   send_date?: string | null,
>   size?: string | null,
>   inside_template_id?: string | null,
>   outside_template_id?: string | null,
>   inside_template_version_id?: string | null,
>   outside_template_version_id?: string | null
> }[]
> ```

***

### send

`selfMailers.send`

Print and mail a real self mailer (a folded piece, no envelope). Billed per piece and not recallable once in production; pass an idempotency\_key

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

```ts theme={null}
await corsair.lob.api.selfMailers.send({ to: 'adr_210a8d4b0b76d77b', inside: 'tmpl_inside', outside: 'tmpl_outside', size: '6x18_bifold', use_type: 'marketing', idempotency_key: 'spring-promo-adr_210a8d4b0b76d77b' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `string \| object` | Yes | Recipient: an address ID (adr\_...) or an inline address. |
| `from` | `string \| object` | No | Return address: an address ID (adr\_...) or an inline address. |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `mail_type` | `usps_first_class \| usps_standard` | No | Postage class. Defaults to 'usps\_first\_class'. |
| `merge_variables` | `Record<string, any> \| null` | No | Per-mailpiece template variables, keyed by merge variable name. |
| `send_date` | `string` | No | ISO 8601 date (2026-01-01) or datetime; Lob schedules production after it, up to 180 days out. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `idempotency_key` | `string` | No | Deduplication key, at most 256 characters. Lob replays within 24 hours return the original mailpiece instead of creating a duplicate. |
| `inside` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `outside` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `size` | `6x18_bifold \| 11x9_bifold \| 12x9_bifold \| 17.75x9_trifold` | No | Self mailer size. Defaults to '6x18\_bifold'. |
| `qr_code` | `object` | No | Print a tracked QR code on the piece. |
| `fsc` | `boolean` | No | Print on FSC-certified paper. |
| `service_request_number` | `string \| null` | No | SR# of an approved USPS promotion to apply. Top-level only: Lob ignores it inside merge\_variables. |

> [accordion] to full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] qr\_code full type
>
> ```ts theme={null}
> {
>   position: relative,
>   redirect_url?: string,
>   width: string,
>   top?: string,
>   right?: string,
>   left?: string,
>   bottom?: string,
>   pages?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `inside_template_id` | `string \| null` | No | — |
| `outside_template_id` | `string \| null` | No | — |
| `inside_template_version_id` | `string \| null` | No | — |
| `outside_template_version_id` | `string \| null` | No | — |

***

## Snap Packs

### cancel

`snapPacks.cancel`

Cancel a snap pack before it goes to production. A cancelled piece cannot be restored

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

```ts theme={null}
await corsair.lob.api.snapPacks.cancel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The snap pack's ID, prefixed with ord\_. |

**Output**

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

***

### get

`snapPacks.get`

Read one snap pack by its ord\_ ID, including status and tracking events

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.snapPacks.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The snap pack's ID, prefixed with ord\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `inside_template_id` | `string \| null` | No | — |
| `outside_template_id` | `string \| null` | No | — |
| `inside_template_version_id` | `string \| null` | No | — |
| `outside_template_version_id` | `string \| null` | No | — |
| `color` | `boolean \| null` | No | — |

***

### list

`snapPacks.list`

Page through snap packs with cursors and filters (status, campaign, send date, metadata)

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.snapPacks.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | ISO 8601 bounds on the creation time. |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |
| `campaign_id` | `string` | No | — |
| `status` | `processed \| rendered \| failed` | No | Render status. |
| `scheduled` | `boolean` | No | True for pieces with a future send\_date only. |
| `send_date` | `object` | No | ISO 8601 bounds on send\_date. |
| `mail_type` | `usps_first_class \| usps_standard` | No | — |
| `sort_by` | `object` | No | Sort by date\_created or send\_date, not both. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] send\_date full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

> [accordion] sort\_by full type
>
> ```ts theme={null}
> {
>   date_created: asc | desc
> } | {
>   send_date: asc | desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   to?: any,
>   from?: any,
>   carrier?: string | null,
>   thumbnails?: any,
>   expected_delivery_date?: string | null,
>   url?: string | null,
>   tracking_events?: any,
>   campaign_id?: string | null,
>   use_type?: string | null,
>   fsc?: boolean | null,
>   status?: string | null,
>   failure_reason?: any,
>   mail_type?: string | null,
>   merge_variables?: any,
>   send_date?: string | null,
>   size?: string | null,
>   inside_template_id?: string | null,
>   outside_template_id?: string | null,
>   inside_template_version_id?: string | null,
>   outside_template_version_id?: string | null,
>   color?: boolean | null
> }[]
> ```

***

### send

`snapPacks.send`

Print and mail a real snap pack (a sealed pressure-seal mailer). Billed per piece and not recallable once in production; pass an idempotency\_key

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

```ts theme={null}
await corsair.lob.api.snapPacks.send({ to: 'adr_210a8d4b0b76d77b', inside: 'tmpl_inside', outside: 'tmpl_outside', use_type: 'operational', idempotency_key: 'statement-2026-12-adr_210a8d4b0b76d77b' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `string \| object` | Yes | Recipient: an address ID (adr\_...) or an inline address. |
| `from` | `string \| object` | No | Return address: an address ID (adr\_...) or an inline address. |
| `use_type` | `marketing \| operational \| null` | Yes | The send's purpose for Lob's mail-use tracking: 'marketing' or 'operational'. null is accepted only when the Lob account has a default use\_type set in its settings. |
| `mail_type` | `usps_first_class \| usps_standard` | No | Postage class. Defaults to 'usps\_first\_class'. |
| `merge_variables` | `Record<string, any> \| null` | No | Per-mailpiece template variables, keyed by merge variable name. |
| `send_date` | `string` | No | ISO 8601 date (2026-01-01) or datetime; Lob schedules production after it, up to 180 days out. |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `billing_group_id` | `string` | No | bg\_ ID of the billing group to charge. |
| `print_speed` | `core` | No | Production speed. Only 'core' is offered. |
| `idempotency_key` | `string` | No | Deduplication key, at most 256 characters. Lob replays within 24 hours return the original mailpiece instead of creating a duplicate. |
| `inside` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `outside` | `string \| string \| string` | Yes | HTML string (up to 10000 characters), tmpl\_... template ID, or an https URL to an html, pdf, png or jpg file. |
| `size` | `8.5x11` | No | Only '8.5x11'. |
| `color` | `boolean` | No | Print in color. |
| `qr_code` | `object` | No | Print a tracked QR code on the piece. |

> [accordion] to full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] from full type
>
> ```ts theme={null}
> string | {
>   name?: string,
>   company?: string,
>   phone?: string,
>   email?: string,
>   address_line1: string,
>   address_line2?: string,
>   address_city?: string,
>   address_state?: string,
>   address_zip?: string,
>   address_country?: string
> }
> ```

> [accordion] qr\_code full type
>
> ```ts theme={null}
> {
>   position: relative,
>   redirect_url?: string,
>   width: string,
>   top?: string,
>   right?: string,
>   left?: string,
>   bottom?: string,
>   pages?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `to` | `any` | No | — |
| `from` | `any` | No | — |
| `carrier` | `string \| null` | No | — |
| `thumbnails` | `any` | No | — |
| `expected_delivery_date` | `string \| null` | No | — |
| `url` | `string \| null` | No | Signed PDF preview; expires after 30 days. |
| `tracking_events` | `any` | No | — |
| `campaign_id` | `string \| null` | No | — |
| `use_type` | `string \| null` | No | — |
| `fsc` | `boolean \| null` | No | — |
| `status` | `string \| null` | No | — |
| `failure_reason` | `any` | No | — |
| `mail_type` | `string \| null` | No | — |
| `merge_variables` | `any` | No | — |
| `send_date` | `string \| null` | No | — |
| `size` | `string \| null` | No | — |
| `inside_template_id` | `string \| null` | No | — |
| `outside_template_id` | `string \| null` | No | — |
| `inside_template_version_id` | `string \| null` | No | — |
| `outside_template_version_id` | `string \| null` | No | — |
| `color` | `boolean \| null` | No | — |

***

## Templates

### create

`templates.create`

Save an HTML template that mailpieces can name by tmpl\_ ID

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.templates.create({ html: '<html>Hi {{name}}</html>', engine: 'handlebars', description: 'Welcome card' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `html` | `string` | Yes | — |
| `description` | `string` | No | — |
| `metadata` | `Record<string, string>` | No | — |
| `engine` | `legacy \| handlebars` | No | Template engine. Defaults to 'legacy'. |
| `required_vars` | `string[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `versions` | `any` | No | — |
| `published_version` | `any` | No | — |

***

### delete

`templates.delete`

Permanently delete a template and its versions

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

```ts theme={null}
await corsair.lob.api.templates.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |

**Output**

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

***

### get

`templates.get`

Read one template by its tmpl\_ ID, with its published version

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.templates.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `versions` | `any` | No | — |
| `published_version` | `any` | No | — |

***

### list

`templates.list`

Page through templates with cursors, date and metadata filters

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.templates.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | — |
| `metadata` | `Record<string, string>` | No | Only rows whose metadata carries every given key and value. |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   versions?: any,
>   published_version?: any
> }[]
> ```

***

### update

`templates.update`

Change a template's description or which version is published

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.templates.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |
| `description` | `string` | No | — |
| `published_version` | `string` | No | vrsn\_ ID to publish. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `versions` | `any` | No | — |
| `published_version` | `any` | No | — |

***

## Template Versions

### create

`templateVersions.create`

Add a new HTML version to a template

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.templateVersions.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |
| `html` | `string` | Yes | — |
| `description` | `string` | No | — |
| `engine` | `legacy \| handlebars` | No | Template engine. Defaults to 'legacy'. |
| `required_vars` | `string[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `html` | `string \| null` | No | — |
| `engine` | `string \| null` | No | — |
| `required_vars` | `string[] \| null` | No | — |
| `suggest_json_editor` | `boolean \| null` | No | — |
| `merge_variables` | `any` | No | — |

***

### delete

`templateVersions.delete`

Permanently delete a template version (not the published one)

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

```ts theme={null}
await corsair.lob.api.templateVersions.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |
| `id` | `string` | Yes | The template version's ID, prefixed with vrsn\_. |

**Output**

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

***

### get

`templateVersions.get`

Read one template version by its vrsn\_ ID

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.templateVersions.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |
| `id` | `string` | Yes | The template version's ID, prefixed with vrsn\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `html` | `string \| null` | No | — |
| `engine` | `string \| null` | No | — |
| `required_vars` | `string[] \| null` | No | — |
| `suggest_json_editor` | `boolean \| null` | No | — |
| `merge_variables` | `any` | No | — |

***

### list

`templateVersions.list`

Page through a template's versions

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.templateVersions.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `before` | `string` | No | Cursor from previous\_url: rows before this one. |
| `after` | `string` | No | Cursor from next\_url: rows after this one. |
| `include` | `total_count[]` | No | Pass \['total\_count'] to have total\_count filled in. |
| `date_created` | `object` | No | — |

> [accordion] date\_created full type
>
> ```ts theme={null}
> {
>   gt?: string,
>   gte?: string,
>   lt?: string,
>   lte?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string \| null` | No | — |
| `next_url` | `string \| null` | No | Pre-built URL for the next page; null on the last page. |
| `previous_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | Present when the request passed include: \['total\_count']. |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   description?: string | null,
>   metadata?: Record<string, string> | null,
>   date_created?: string | null,
>   date_modified?: string | null,
>   deleted?: boolean | null,
>   object?: string | null,
>   html?: string | null,
>   engine?: string | null,
>   required_vars?: string[] | null,
>   suggest_json_editor?: boolean | null,
>   merge_variables?: any
> }[]
> ```

***

### update

`templateVersions.update`

Change a template version's description, engine or required variables

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.templateVersions.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_id` | `string` | Yes | The template's ID, prefixed with tmpl\_. |
| `id` | `string` | Yes | The template version's ID, prefixed with vrsn\_. |
| `description` | `string` | No | — |
| `engine` | `legacy \| handlebars` | No | Template engine. Defaults to 'legacy'. |
| `required_vars` | `string[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `metadata` | `Record<string, string> \| null` | No | — |
| `date_created` | `string \| null` | No | — |
| `date_modified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `object` | `string \| null` | No | — |
| `html` | `string \| null` | No | — |
| `engine` | `string \| null` | No | — |
| `required_vars` | `string[] \| null` | No | — |
| `suggest_json_editor` | `boolean \| null` | No | — |
| `merge_variables` | `any` | No | — |

***

## Uploads

### create

`uploads.create`

Create an audience upload for a campaign and map its CSV columns to address fields and merge variables

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.uploads.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `campaignId` | `string` | Yes | cmp\_ ID the audience is for. |
| `requiredAddressColumnMapping` | `Record<string, string \| null>` | No | CSV column for each required address field (name, address\_line1, address\_city, address\_state, address\_zip). |
| `optionalAddressColumnMapping` | `Record<string, string \| null>` | No | — |
| `mergeVariableColumnMapping` | `Record<string, string \| null>` | No | CSV column for each template merge variable. |
| `metadata` | `Record<string, any>` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `accountId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `failuresUrl` | `string \| null` | No | — |
| `originalFilename` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `totalMailpieces` | `number \| null` | No | — |
| `failedMailpieces` | `number \| null` | No | — |
| `validatedMailpieces` | `number \| null` | No | — |
| `bytesProcessed` | `number \| null` | No | — |
| `dateCreated` | `string \| null` | No | — |
| `dateModified` | `string \| null` | No | — |
| `requiredAddressColumnMapping` | `any` | No | — |
| `optionalAddressColumnMapping` | `any` | No | — |
| `mergeVariableColumnMapping` | `any` | No | — |
| `metadata` | `any` | No | — |

***

### createExport

`uploads.createExport`

Start an export of an upload's rows (all, failures or successes)

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.uploads.createExport({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |
| `type` | `all \| failures \| successes` | No | Which rows to export. Defaults to all. |

**Output**

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

***

### delete

`uploads.delete`

Permanently delete an audience upload

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

```ts theme={null}
await corsair.lob.api.uploads.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |

Lob answers 204 with no body; the plugin returns `{ id, deleted: true }`.

**Output**

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

***

### get

`uploads.get`

Read one upload by its upl\_ ID, including processing state and row counts

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.uploads.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `accountId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `failuresUrl` | `string \| null` | No | — |
| `originalFilename` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `totalMailpieces` | `number \| null` | No | — |
| `failedMailpieces` | `number \| null` | No | — |
| `validatedMailpieces` | `number \| null` | No | — |
| `bytesProcessed` | `number \| null` | No | — |
| `dateCreated` | `string \| null` | No | — |
| `dateModified` | `string \| null` | No | — |
| `requiredAddressColumnMapping` | `any` | No | — |
| `optionalAddressColumnMapping` | `any` | No | — |
| `mergeVariableColumnMapping` | `any` | No | — |
| `metadata` | `any` | No | — |

***

### getExport

`uploads.getExport`

Read an upload export, including its download URL once ready

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.uploads.getExport({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |
| `export_id` | `string` | Yes | The export's ID, prefixed with ex\_. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `dateCreated` | `string \| null` | No | — |
| `dateModified` | `string \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |
| `s3Url` | `string \| null` | No | Signed download URL once the export is done. |
| `state` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `uploadId` | `string \| null` | No | — |

***

### getReport

`uploads.getReport`

Page through an upload's per-row validation report

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.uploads.getReport({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |
| `status` | `Validated \| Failed \| Processing` | No | — |
| `limit` | `number` | No | Rows per page, 1-100. Defaults to 10. |
| `offset` | `number` | No | Rows to skip. Defaults to 0. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `Record<string, any>[] \| null` | No | — |
| `next_url` | `string \| null` | No | — |
| `prev_url` | `string \| null` | No | — |
| `count` | `number \| null` | No | — |
| `total_count` | `number \| null` | No | — |

***

### list

`uploads.list`

List audience uploads, optionally for one campaign

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.uploads.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `campaignId` | `string` | No | Only uploads for this cmp\_ ID. |

Lob answers a bare array here, not the list envelope.

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   accountId?: string | null,
>   campaignId?: string | null,
>   mode?: string | null,
>   failuresUrl?: string | null,
>   originalFilename?: string | null,
>   state?: string | null,
>   totalMailpieces?: number | null,
>   failedMailpieces?: number | null,
>   validatedMailpieces?: number | null,
>   bytesProcessed?: number | null,
>   dateCreated?: string | null,
>   dateModified?: string | null,
>   requiredAddressColumnMapping?: any,
>   optionalAddressColumnMapping?: any,
>   mergeVariableColumnMapping?: any,
>   metadata?: any
> }[]
> ```

***

### update

`uploads.update`

Change an upload's column mappings or metadata

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.uploads.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |
| `originalFilename` | `string` | No | — |
| `requiredAddressColumnMapping` | `Record<string, string \| null>` | No | CSV column for each required address field (name, address\_line1, address\_city, address\_state, address\_zip). |
| `optionalAddressColumnMapping` | `Record<string, string \| null>` | No | — |
| `mergeVariableColumnMapping` | `Record<string, string \| null>` | No | CSV column for each template merge variable. |
| `metadata` | `Record<string, any>` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `accountId` | `string \| null` | No | — |
| `campaignId` | `string \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `failuresUrl` | `string \| null` | No | — |
| `originalFilename` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `totalMailpieces` | `number \| null` | No | — |
| `failedMailpieces` | `number \| null` | No | — |
| `validatedMailpieces` | `number \| null` | No | — |
| `bytesProcessed` | `number \| null` | No | — |
| `dateCreated` | `string \| null` | No | — |
| `dateModified` | `string \| null` | No | — |
| `requiredAddressColumnMapping` | `any` | No | — |
| `optionalAddressColumnMapping` | `any` | No | — |
| `mergeVariableColumnMapping` | `any` | No | — |
| `metadata` | `any` | No | — |

***

### uploadFile

`uploads.uploadFile`

Attach the audience CSV file (at most 50 MiB here) to an upload; Lob validates its rows asynchronously

**Risk:** `write`

```ts theme={null}
await corsair.lob.api.uploads.uploadFile({ id: 'upl_71be866e430b11e9', file: 'https://example.com/audience.csv' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The upload's ID, prefixed with upl\_. |
| `file` | `string \| object` | Yes | The audience CSV, at most 50 MiB (the plugin reads it into memory; Lob accepts up to 500 MB): a public URL, \{url, filename?}, or \{base64, filename?}. |

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

**Output**

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

***

## Us Verifications

### bulk

`usVerifications.bulk`

Verify up to 20 US addresses in one synchronous call; each row comes back as a verification or a per-row error

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.usVerifications.bulk({ addresses: [{ primary_line: '210 King Street', zip_code: '94107' }, { primary_line: 'Ave Wilson Churchill 123', city: 'Rio Piedras', state: 'PR', zip_code: '00926' }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `addresses` | `object[]` | Yes | Up to 20 US addresses, verified synchronously in one call. |
| `case` | `upper \| proper` | No | Casing of the returned address lines: 'upper' (default) or 'proper'. |

Requires a live API key; a test key answers a dummy response. Each input row returns a verification or a row error, and the top-level `errors` flag says whether any row failed.

> [accordion] addresses full type
>
> ```ts theme={null}
> {
>   recipient?: string,
>   primary_line?: string,
>   secondary_line?: string,
>   urbanization?: string,
>   city?: string,
>   state?: string,
>   zip_code?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addresses` | `object[]` | Yes | One result per input, in order: a verification, or a row error whose 'error' object carries message and code. |
| `errors` | `boolean \| null` | No | True when at least one row failed. |

> [accordion] addresses full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     recipient?: string | null,
>     primary_line?: string | null,
>     secondary_line?: string | null,
>     urbanization?: string | null,
>     last_line?: string | null,
>     deliverability?: string | null,
>     valid_address?: boolean | null,
>     components?: Record<string, any> | null,
>     deliverability_analysis?: Record<string, any> | null,
>     lob_confidence_score?: {
>       score?: number | null,
>       level?: string | null
>     } | null,
>     object?: string | null
>   } | {
>     error: {
>       message?: string | null,
>       status_code?: number | null,
>       code?: string | null
>     }
>   }
> )[]
> ```

***

### verify

`usVerifications.verify`

Verify one US address with USPS data and get its deliverability, standardized components and confidence score

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.usVerifications.verify({ primary_line: '210 King Street', city: 'San Francisco', state: 'CA', zip_code: '94107', case: 'proper' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `recipient` | `string` | No | — |
| `primary_line` | `string` | No | Delivery line, such as '210 King Street'. |
| `secondary_line` | `string` | No | — |
| `urbanization` | `string` | No | Puerto Rico urbanization name, when the address has one. |
| `city` | `string` | No | — |
| `state` | `string` | No | — |
| `zip_code` | `string` | No | — |
| `address` | `string` | No | Full address on one line. When set, it replaces the component fields. |
| `case` | `upper \| proper` | No | Casing of the returned address lines: 'upper' (default) or 'proper'. |

Verify with either the single-line `address` field, or the component fields (`primary_line` plus `zip_code`, or `primary_line` plus `city` and `state`). Test keys simulate outcomes: a primary line containing `undeliverable` comes back undeliverable.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `recipient` | `string \| null` | No | — |
| `primary_line` | `string \| null` | No | — |
| `secondary_line` | `string \| null` | No | — |
| `urbanization` | `string \| null` | No | — |
| `last_line` | `string \| null` | No | — |
| `deliverability` | `string \| null` | No | — |
| `valid_address` | `boolean \| null` | No | — |
| `components` | `Record<string, any> \| null` | No | — |
| `deliverability_analysis` | `Record<string, any> \| null` | No | — |
| `lob_confidence_score` | `object \| null` | No | — |
| `object` | `string \| null` | No | — |

> [accordion] lob\_confidence\_score full type
>
> ```ts theme={null}
> {
>   score?: number | null,
>   level?: string | null
> } | null
> ```

***

## Zip

### usZipLookup

`zip.usZipLookup`

Look up a 5-digit US ZIP code and get its cities, county, FIPS code and default city

**Risk:** `read`

```ts theme={null}
await corsair.lob.api.zip.usZipLookup({ zip_code: '94107' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `zip_code` | `string` | Yes | A 5-digit US ZIP code, such as 94107. |

Accepts exactly five digits. The first city in `cities` is the USPS default and carries `preferred: true`.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `zip_code` | `string \| null` | No | — |
| `cities` | `object[]` | Yes | Cities sharing the ZIP; the USPS default city is first with preferred: true. |
| `zip_code_type` | `string \| null` | No | — |
| `object` | `string \| null` | No | — |

> [accordion] cities full type
>
> ```ts theme={null}
> {
>   city?: string | null,
>   state?: string | null,
>   county?: string | null,
>   county_fips?: string | null,
>   preferred?: boolean | null
> }[]
> ```

***


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