# @zapier/zapier-sdk

## Table of Contents

- [Documentation](#documentation)
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Walkthrough](#walkthrough)
- [Factory](#factory)
- [Available Functions](#available-functions)
- [Accounts](#accounts)
  - [`getProfile`](#getprofile)
- [Actions](#actions)
  - [`getAction`](#getaction)
  - [`getActionInputFieldsSchema`](#getactioninputfieldsschema)
  - [`listActionInputFieldChoices`](#listactioninputfieldchoices)
  - [`listActionInputFields`](#listactioninputfields)
  - [`listActions`](#listactions)
  - [`runAction`](#runaction)
- [Apps](#apps)
  - [`apps.{appKey}`](#appsappkey)
  - [`apps.{appKey}.{actionType}.{actionKey}`](#appsappkeyactiontypeactionkey)
  - [`getApp`](#getapp)
  - [`listApps`](#listapps)
- [Client Credentials](#client-credentials)
  - [`createClientCredentials`](#createclientcredentials)
  - [`deleteClientCredentials`](#deleteclientcredentials)
  - [`listClientCredentials`](#listclientcredentials)
- [Connections](#connections)
  - [`findFirstConnection`](#findfirstconnection)
  - [`findUniqueConnection`](#finduniqueconnection)
  - [`getConnection`](#getconnection)
  - [`listConnections`](#listconnections)
- [HTTP Requests](#http-requests)
  - [`fetch`](#fetch)
- [Tables](#tables)
  - [`createTable`](#createtable)
  - [`createTableFields`](#createtablefields)
  - [`createTableRecords`](#createtablerecords)
  - [`deleteTable`](#deletetable)
  - [`deleteTableFields`](#deletetablefields)
  - [`deleteTableRecords`](#deletetablerecords)
  - [`getTable`](#gettable)
  - [`getTableRecord`](#gettablerecord)
  - [`listTableFields`](#listtablefields)
  - [`listTableRecords`](#listtablerecords)
  - [`listTables`](#listtables)
  - [`updateTableRecords`](#updatetablerecords)
- [Triggers (Experimental)](#triggers-experimental)
  - [`ackTriggerInboxMessages`](#acktriggerinboxmessages--experimental)
  - [`createTriggerInbox`](#createtriggerinbox--experimental)
  - [`deleteTriggerInbox`](#deletetriggerinbox--experimental)
  - [`drainTriggerInbox`](#draintriggerinbox--experimental)
  - [`ensureTriggerInbox`](#ensuretriggerinbox--experimental)
  - [`getTriggerInbox`](#gettriggerinbox--experimental)
  - [`getTriggerInputFieldsSchema`](#gettriggerinputfieldsschema--experimental)
  - [`leaseTriggerInboxMessages`](#leasetriggerinboxmessages--experimental)
  - [`listTriggerInboxMessages`](#listtriggerinboxmessages--experimental)
  - [`listTriggerInboxes`](#listtriggerinboxes--experimental)
  - [`listTriggerInputFieldChoices`](#listtriggerinputfieldchoices--experimental)
  - [`listTriggerInputFields`](#listtriggerinputfields--experimental)
  - [`listTriggers`](#listtriggers--experimental)
  - [`pauseTriggerInbox`](#pausetriggerinbox--experimental)
  - [`releaseTriggerInboxMessages`](#releasetriggerinboxmessages--experimental)
  - [`resumeTriggerInbox`](#resumetriggerinbox--experimental)
  - [`updateTriggerInbox`](#updatetriggerinbox--experimental)
  - [`watchTriggerInbox`](#watchtriggerinbox--experimental)

## Documentation

The official documentation is available at:

https://docs.zapier.com/sdk

Agents are sometimes blocked from viewing docs on npm, so you may want to provide them a link to the official docs or copy the docs here into a prompt.

## Quick Start

_For new projects._

The following will create a new project from scratch, set up the SDK and the SDK CLI, and give you a working starter example to get you going:

```bash
# Create a new Zapier SDK project (scaffolds files, installs deps, and logs you in).
npx @zapier/zapier-sdk-cli init my-zapier-app

# Or skip the interactive prompts and accept all defaults.
npx @zapier/zapier-sdk-cli init my-zapier-app --skip-prompts
```

## Installation

_For existing projects._

If you already have a project and want to start integrating apps through Zapier using the SDK:

```bash
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript
```

## Walkthrough

Assuming you've installed the CLI package into your project (see instructions above), you (or an agent) can start using it right away. This is useful for introspecting actions, connections, etc. that you want to use in code, but you can also use it to directly use integrations.

```bash
# See all available commands
npx zapier-sdk --help

# Login to Zapier.
npx zapier-sdk login

# Search from thousands of supported apps.
npx zapier-sdk list-apps --search "gmail"
# The output will show you the valid keys next to the app title like this:
# 1. Gmail (GoogleMailV2CLIAPI, gmail)

# Run any action for the app, using one of the app keys.
npx zapier-sdk run-action gmail
# This will ask you for the type of action you want to run.
# `search` or `write` are typically great for testing.
# Note that you usually need a connection to the app to run
# the action. If you don't already have one, you can create a new one at:
# https://zapier.com/app/assets/connections

# List connections for an app.
npx zapier-sdk list-connections gmail
# Or only list the ones you own.
npx zapier-sdk list-connections gmail --owner me
# Or just grab the first one.
npx zapier-sdk find-first-connection gmail --owner me

# Make any API request to an app using your connection.
npx zapier-sdk fetch "https://gmail.googleapis.com/gmail/v1/users/me/labels" --connection-id 123
```

The following is optional, but if you want to call our actions from code, it can be helpful to install TypeScript types for those actions. You can also just use `fetch` to make arbitrary API requests. In that case, you don't really need this, and instead you might need types or a good agent that will look up third party API docs.

```bash
# Search for apps that you want to use.
npx zapier-sdk list-apps --search "slack"
npx zapier-sdk list-apps --search "google sheets"
# The output will show you the valid keys next to the app title like this:
# 1. Slack (SlackCLIAPI, slack)
# 1. Google Sheets (GoogleSheetsV2CLIAPI, google-sheets, google_sheets)

# Generate TypeScript types for actions and fields of any apps you want to use.
npx zapier-sdk add slack google-sheets

# By default, types will be generated inside your `src` or `lib` folder if you
# have one or otherwise the root folder. Make sure your `tsconfig.json` file
# includes the generated type files.

# Alternatively, you can specify a custom output directory.
npx zapier-sdk add slack google-sheets --types-output ./types
```

Now let's write some code!

```typescript
import { createZapierSdk } from "@zapier/zapier-sdk";

// ######## Initialize Zapier SDK ########
// Option 1: Running `zapier-sdk login` authenticates through your browser and
// stores a token on your local machine. As long as you have the CLI package
// installed as a development dependency, the SDK will automatically use it.
const zapier = createZapierSdk();

// Option 2: Provide a client ID and client secret.
// You can get these by running `zapier-sdk create-client-credentials`.
// This allows you to run the SDK in a server/serverless environment.
// const zapier = createZapierSdk({
//   credentials: {
//     clientId: "your_client_id_here", // or use ZAPIER_CREDENTIALS_CLIENT_ID env var
//     clientSecret: "your_client_secret_here", // or use ZAPIER_CREDENTIALS_CLIENT_SECRET env var
//   },
// });

// Option 3: Provide a valid Zapier token.
// This is for partner OAuth or internal Zapier use.
// const zapier = createZapierSdk({
//   credentials: "your_zapier_token_here", // or use ZAPIER_CREDENTIALS env var
// });

// ######## Access Apps ########
// List methods return a promise for a page with {data, nextCursor}.
const { data: firstPageApps, nextCursor } = await zapier.listApps();
// Use the cursor to get the next page:
const { data: secondPageApps } = await zapier.listApps({ cursor: nextCursor });

console.log({
  firstPageApps,
  secondPageApps,
});

// List methods also return an iterable for all pages.
// Be careful with lots of pages, note the `search` to filter.
for await (const page of zapier.listApps({ search: "slack" })) {
  const { data: apps } = page;
  console.log({
    apps,
  });
}

// Use `.items()` to iterate over all items of all pages:
// Again, be careful with lots of items. Note the `maxItems` to limit the total items.
for await (const app of zapier.listApps({ maxItems: 100 }).items()) {
  console.log({
    app,
  });
}

// You can collect all results, but this could take a while for long lists!
const allApps = await Array.fromAsync(
  zapier.listApps({ maxItems: 100 }).items(),
);

console.log({
  allApps,
});

// The item methods return a promise for a single item, wrapped with {data}.
// This is just to give us room to add metadata in the future.
const { data: app } = await zapier.getApp({ app: "slack" });

console.log({
  app,
});

// ######## Connection Usage ########
const { data: myConnections } = await zapier.listConnections({
  app: "slack",
  owner: "me",
});

console.log({
  myConnections,
});

// ######## Find Actions ########
// Option 1: List actions
// Remember, this is just the first page which may not include them all!
// See `.items()` usage above, which can be used to make sure you get all actions.
const { data: actions } = await zapier.listActions({ app: "slack" });

console.log({
  actions,
});

const singleAction = await zapier.getAction({
  app: "slack",
  actionType: actions[0].action_type,
  action: actions[0].key,
});

console.log({
  singleAction,
});

// Option 2: Access actions via the `apps` proxy
// If you've generated TS types for an app using `zapier-sdk add`, you can
// access the app's actions like this:

// await zapier.apps.slack.read.channles({});
// await zapier.apps.slack.write.send_message({})

// ######## Run Actions ########
// Option 1:
const { data: channels } = await zapier.runAction({
  app: "slack",
  actionType: "read",
  action: "channels",
  connection: myConnections[0].id,
});

console.log({
  channels,
});

const { data: profile } = await zapier.getProfile();

// Option 2:
// Create an app binding to your connection.
const mySlack = zapier.apps.slack({
  connection: myConnections[0].id,
});

// Use your app binding to run the action.
const { data: users } = await mySlack.search.user_by_email({
  inputs: {
    email: profile.email,
  },
});

console.log({
  users,
});

// You can also skip the app binding and pass the connection into the action.
const { data: sameUsers } = await zapier.apps.slack.search.user_by_email({
  inputs: {
    email: profile.email,
  },
  connection: myConnections[0].id,
});

console.log({
  sameUsers,
});

// If the slug for an app has dashes, you can also use a snake_cased app key.
// For example, either of the following are valid:
// zapier.apps["google-sheets"]
// zapier.apps.google_sheets

// We have tens of thousands of actions across thousands of apps, but you're
// still not limited to those. You can make any arbitrary API request to an app
// using the same connections with `.fetch`! This returns a response just
// like a normal `fetch` call in JavaScript.
const emojiResponse = await zapier.fetch("https://slack.com/api/emoji.list", {
  connection: myConnections[0].id,
});

const emojiData = await emojiResponse.json();

console.log(emojiData.emoji);
```

## Factory

The `createZapierSdk(...)` factory function is the main entry point for the SDK. It provides methods for managing connections, listing apps, running actions, and more.

| Name                          | Type                       | Required | Default | Possible Values             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------- | -------------------------- | -------- | ------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `credentials`                 | `string, object, function` | ❌       | —       | —                           | Authentication credentials. Can be a string (token or API key), a client credentials object ({ clientId, clientSecret }), a PKCE object ({ clientId }), or a function returning any of those.                                                                                                                                                                                                                                                                                                      |
| `debug`                       | `boolean`                  | ❌       | —       | —                           | Enable debug logging.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `baseUrl`                     | `string`                   | ❌       | —       | —                           | Base URL for Zapier API endpoints.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `trackingBaseUrl`             | `string`                   | ❌       | —       | —                           | Base URL for Zapier tracking endpoints.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `maxNetworkRetries`           | `number`                   | ❌       | —       | —                           | Max retries for rate-limited requests (default: 3).                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `maxNetworkRetryDelayMs`      | `number`                   | ❌       | —       | —                           | Max delay in ms to wait for retry (default: 60000).                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `maxConcurrentRequests`       | `number, literal`          | ❌       | —       | —                           | Max concurrent in-flight HTTP requests (default: 200, max: 10000).                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `approvalTimeoutMs`           | `number`                   | ❌       | —       | —                           | Timeout in ms for approval polling. Default: 600000 (10 min).                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `maxApprovalRetries`          | `number`                   | ❌       | —       | —                           | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2.                                                                                                                                                                                                                                                                                                                                                                                     |
| `approvalMode`                | `string`                   | ❌       | —       | `disabled`, `poll`, `throw` | Approval flow behavior. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. "disabled" throws a ZapierApprovalError on approval-required responses without creating an approval. Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then the default behavior (poll for interactive TTY, throw otherwise). |
| `canIncludeSharedConnections` | `boolean`                  | ❌       | —       | —                           | Allow listing shared connections.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `canIncludeSharedTables`      | `boolean`                  | ❌       | —       | —                           | Allow listing shared tables.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `canDeleteTables`             | `boolean`                  | ❌       | —       | —                           | Allow deleting tables.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

## Named Connections

Named connections let you decouple workflow code from specific connection IDs. Instead of hardcoding an ID, you reference a connection by name and the SDK resolves it from a mapping.

This is useful when an execution engine or deployment system manages which connections a workflow should use.

### Providing the mapping

Connections are configured in `.zapierrc` alongside app version pins, or inline via the `manifest` option:

```typescript
const zapier = createZapierSdk({
  manifest: {
    apps: { slack: { implementationName: "SlackCLIAPI", version: "1.21.1" } },
    connections: {
      slack_work: { connectionId: "01234567-89ab-cdef-0123-456789abcdef" },
      google_sheets: { connectionId: 67890 },
    },
  },
});
```

Each connection entry maps a name to a `connectionId`. The Zapier connections API returns UUID-format IDs (the `id` field on entries from `listConnections`); positive integers from older connections are also accepted. App version resolution is handled separately via the `apps` section of `.zapierrc`.

### Using named connections

Reference connections using the `connection` parameter. Pass a connection name to be resolved from the connections map, or a connection ID to be used directly.

```typescript
// Per-call with alias
await zapier.apps.slack.read.channels({ connection: "slack_work" });

// Factory binding
const slack = zapier.apps.slack({ connection: "slack_work" });
await slack.read.channels({});

// Lower-level runAction
await zapier.runAction({
  app: "slack",
  actionType: "read",
  action: "channels",
  connection: "slack_work",
});

// Authenticated fetch
await zapier.fetch("https://slack.com/api/auth.test", {
  connection: "slack_work",
});

// Direct connection ID also works (UUID or legacy positive integer)
await zapier.apps.slack.read.channels({
  connection: "01234567-89ab-cdef-0123-456789abcdef",
});
```

## Available Functions

### Accounts

#### `getProfile`

Get current user's profile information

**Parameters:**

| Name      | Type     | Required | Default | Possible Values | Description |
| --------- | -------- | -------- | ------- | --------------- | ----------- |
| `options` | `object` | ❌       | —       | —               |             |

**Returns:** `Promise<ProfileItem>`

| Name                  | Type      | Required | Possible Values | Description |
| --------------------- | --------- | -------- | --------------- | ----------- |
| `data`                | `object`  | ✅       | —               |             |
| ​ ↳ `id`              | `string`  | ✅       | —               |             |
| ​ ↳ `first_name`      | `string`  | ✅       | —               |             |
| ​ ↳ `last_name`       | `string`  | ✅       | —               |             |
| ​ ↳ `full_name`       | `string`  | ✅       | —               |             |
| ​ ↳ `email`           | `string`  | ✅       | —               |             |
| ​ ↳ `email_confirmed` | `boolean` | ✅       | —               |             |
| ​ ↳ `timezone`        | `string`  | ✅       | —               |             |

**Example:**

```typescript
const { data: profile } = await zapier.getProfile();
```

### Actions

#### `getAction`

Get detailed information about a specific action

**Parameters:**

| Name             | Type     | Required | Default | Possible Values                                                                                | Description                                                                                                  |
| ---------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `options`        | `object` | ✅       | —       | —                                                                                              |                                                                                                              |
| ​ ↳ `app`        | `string` | ✅       | —       | —                                                                                              | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
| ​ ↳ `actionType` | `string` | ✅       | —       | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type                                                           |
| ​ ↳ `action`     | `string` | ✅       | —       | —                                                                                              | Action key (e.g., 'send_message' or 'find_row')                                                              |

**Returns:** `Promise<ActionItem>`

| Name               | Type      | Required | Possible Values                                                                                | Description |
| ------------------ | --------- | -------- | ---------------------------------------------------------------------------------------------- | ----------- |
| `data`             | `object`  | ✅       | —                                                                                              |             |
| ​ ↳ `id`           | `string`  | ❌       | —                                                                                              |             |
| ​ ↳ `key`          | `string`  | ✅       | —                                                                                              |             |
| ​ ↳ `description`  | `string`  | ✅       | —                                                                                              |             |
| ​ ↳ `is_important` | `boolean` | ❌       | —                                                                                              |             |
| ​ ↳ `is_hidden`    | `boolean` | ❌       | —                                                                                              |             |
| ​ ↳ `app_key`      | `string`  | ✅       | —                                                                                              |             |
| ​ ↳ `app_version`  | `string`  | ❌       | —                                                                                              |             |
| ​ ↳ `action_type`  | `string`  | ✅       | `filter`, `read`, `read_bulk`, `run`, `search`, `search_and_write`, `search_or_write`, `write` |             |
| ​ ↳ `title`        | `string`  | ✅       | —                                                                                              |             |
| ​ ↳ `type`         | `string`  | ✅       | `action`                                                                                       |             |

**Example:**

```typescript
const { data: action } = await zapier.getAction({
  app: "example-app",
  actionType: "read",
  action: "example-action",
});
```

#### `getActionInputFieldsSchema`

Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.

**Parameters:**

| Name             | Type             | Required | Default | Possible Values                                                                                | Description                                                                                                                                                                                                                           |
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —                                                                                              |                                                                                                                                                                                                                                       |
| ​ ↳ `app`        | `string`         | ✅       | —       | —                                                                                              | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for                                                                                                                                                       |
| ​ ↳ `actionType` | `string`         | ✅       | —       | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type                                                                                                                                                                                    |
| ​ ↳ `action`     | `string`         | ✅       | —       | —                                                                                              | Action key to get the input schema for                                                                                                                                                                                                |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —                                                                                              | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —                                                                                              | Current input values that may affect the schema (e.g., when fields depend on other field values)                                                                                                                                      |

**Returns:** `Promise<InputSchemaItem>`

**Example:**

```typescript
const { data: inputSchema } = await zapier.getActionInputFieldsSchema({
  app: "example-app",
  actionType: "read",
  action: "example-action",
});
```

#### `listActionInputFieldChoices`

Get the available choices for a dynamic dropdown input field

**Parameters:**

| Name             | Type             | Required | Default | Possible Values                                                                                | Description                                                                                                                                                                                                                           |
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —                                                                                              |                                                                                                                                                                                                                                       |
| ​ ↳ `app`        | `string`         | ✅       | —       | —                                                                                              | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')                                                                                                                          |
| ​ ↳ `actionType` | `string`         | ✅       | —       | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type                                                                                                                                                                                    |
| ​ ↳ `action`     | `string`         | ✅       | —       | —                                                                                              | Action key (e.g., 'send_message' or 'find_row')                                                                                                                                                                                       |
| ​ ↳ `inputField` | `string`         | ✅       | —       | —                                                                                              | Input field key to get choices for                                                                                                                                                                                                    |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —                                                                                              | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —                                                                                              | Current input values that may affect available choices                                                                                                                                                                                |
| ​ ↳ `page`       | `number`         | ❌       | —       | —                                                                                              | Page number for paginated results                                                                                                                                                                                                     |
| ​ ↳ `pageSize`   | `number`         | ❌       | —       | —                                                                                              | Number of choices per page                                                                                                                                                                                                            |
| ​ ↳ `maxItems`   | `number`         | ❌       | —       | —                                                                                              | Maximum total items to return across all pages                                                                                                                                                                                        |
| ​ ↳ `cursor`     | `string`         | ❌       | —       | —                                                                                              | Cursor to start from                                                                                                                                                                                                                  |

**Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`

| Name         | Type       | Required | Possible Values | Description                                                    |
| ------------ | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`     | `object[]` | ✅       | —               |                                                                |
| ​ ↳ `key`    | `string`   | ❌       | —               |                                                                |
| ​ ↳ `label`  | `string`   | ❌       | —               |                                                                |
| ​ ↳ `sample` | `string`   | ❌       | —               |                                                                |
| ​ ↳ `value`  | `string`   | ❌       | —               |                                                                |
| `nextCursor` | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: inputFieldChoices, nextCursor } =
  await zapier.listActionInputFieldChoices({
    app: "example-app",
    actionType: "read",
    action: "example-action",
    inputField: "example-input-field",
  });

// Or iterate over all pages
for await (const page of zapier.listActionInputFieldChoices({
  app: "example-app",
  actionType: "read",
  action: "example-action",
  inputField: "example-input-field",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
  .listActionInputFieldChoices({
    app: "example-app",
    actionType: "read",
    action: "example-action",
    inputField: "example-input-field",
  })
  .items()) {
  // Do something with each inputFieldChoice
}
```

#### `listActionInputFields`

Get the input fields required for a specific action

**Parameters:**

| Name             | Type             | Required | Default | Possible Values                                                                                | Description                                                                                                                                                                                                                           |
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —                                                                                              |                                                                                                                                                                                                                                       |
| ​ ↳ `app`        | `string`         | ✅       | —       | —                                                                                              | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')                                                                                                                          |
| ​ ↳ `actionType` | `string`         | ✅       | —       | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type                                                                                                                                                                                    |
| ​ ↳ `action`     | `string`         | ✅       | —       | —                                                                                              | Action key (e.g., 'send_message' or 'find_row')                                                                                                                                                                                       |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —                                                                                              | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —                                                                                              | Current input values that may affect available fields                                                                                                                                                                                 |
| ​ ↳ `pageSize`   | `number`         | ❌       | —       | —                                                                                              | Number of input fields per page                                                                                                                                                                                                       |
| ​ ↳ `maxItems`   | `number`         | ❌       | —       | —                                                                                              | Maximum total items to return across all pages                                                                                                                                                                                        |
| ​ ↳ `cursor`     | `string`         | ❌       | —       | —                                                                                              | Cursor to start from                                                                                                                                                                                                                  |

**Returns:** `Promise<PaginatedResult<RootFieldItem>>`

| Name         | Type       | Required | Possible Values | Description                                                    |
| ------------ | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`     | `object[]` | ✅       | —               | One of the variants below, distinguished by `type`             |
| `nextCursor` | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**When `type` is `"input_field"`:**

| Name                       | Type      | Required | Possible Values | Description |
| -------------------------- | --------- | -------- | --------------- | ----------- |
| `type`                     | `string`  | ✅       | `input_field`   |             |
| `key`                      | `string`  | ✅       | —               |             |
| `default_value`            | `string`  | ✅       | —               |             |
| `depends_on`               | `array`   | ✅       | —               |             |
| `description`              | `string`  | ✅       | —               |             |
| `invalidates_input_fields` | `boolean` | ✅       | —               |             |
| `is_required`              | `boolean` | ✅       | —               |             |
| `placeholder`              | `string`  | ✅       | —               |             |
| `title`                    | `string`  | ✅       | —               |             |
| `value_type`               | `string`  | ✅       | —               |             |
| `format`                   | `string`  | ❌       | —               |             |
| `items`                    | `object`  | ❌       | —               |             |
| ​ ↳ `type`                 | `string`  | ✅       | —               |             |

**When `type` is `"info_field"`:**

| Name          | Type     | Required | Possible Values | Description |
| ------------- | -------- | -------- | --------------- | ----------- |
| `type`        | `string` | ✅       | `info_field`    |             |
| `key`         | `string` | ✅       | —               |             |
| `description` | `string` | ✅       | —               |             |
| `title`       | `string` | ❌       | —               |             |

**When `type` is `"fieldset"`:**

| Name     | Type     | Required | Possible Values | Description |
| -------- | -------- | -------- | --------------- | ----------- |
| `type`   | `string` | ✅       | `fieldset`      |             |
| `key`    | `string` | ✅       | —               |             |
| `title`  | `string` | ✅       | —               |             |
| `fields` | `array`  | ✅       | —               |             |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: rootFields, nextCursor } = await zapier.listActionInputFields({
  app: "example-app",
  actionType: "read",
  action: "example-action",
});

// Or iterate over all pages
for await (const page of zapier.listActionInputFields({
  app: "example-app",
  actionType: "read",
  action: "example-action",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const rootField of zapier
  .listActionInputFields({
    app: "example-app",
    actionType: "read",
    action: "example-action",
  })
  .items()) {
  // Do something with each rootField
}
```

#### `listActions`

List all actions for a specific app

**Parameters:**

| Name             | Type     | Required | Default | Possible Values                                                                                | Description                                                            |
| ---------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `options`        | `object` | ✅       | —       | —                                                                                              |                                                                        |
| ​ ↳ `app`        | `string` | ✅       | —       | —                                                                                              | App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github') |
| ​ ↳ `actionType` | `string` | ❌       | —       | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type                                                 |
| ​ ↳ `pageSize`   | `number` | ❌       | —       | —                                                                                              | Number of actions per page                                             |
| ​ ↳ `maxItems`   | `number` | ❌       | —       | —                                                                                              | Maximum total items to return across all pages                         |
| ​ ↳ `cursor`     | `string` | ❌       | —       | —                                                                                              | Cursor to start from                                                   |

**Returns:** `Promise<PaginatedResult<ActionItem>>`

| Name               | Type       | Required | Possible Values                                                                                | Description                                                    |
| ------------------ | ---------- | -------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `data[]`           | `object[]` | ✅       | —                                                                                              |                                                                |
| ​ ↳ `id`           | `string`   | ❌       | —                                                                                              |                                                                |
| ​ ↳ `key`          | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `description`  | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `is_important` | `boolean`  | ❌       | —                                                                                              |                                                                |
| ​ ↳ `is_hidden`    | `boolean`  | ❌       | —                                                                                              |                                                                |
| ​ ↳ `app_key`      | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `app_version`  | `string`   | ❌       | —                                                                                              |                                                                |
| ​ ↳ `action_type`  | `string`   | ✅       | `filter`, `read`, `read_bulk`, `run`, `search`, `search_and_write`, `search_or_write`, `write` |                                                                |
| ​ ↳ `title`        | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `type`         | `string`   | ✅       | `action`                                                                                       |                                                                |
| `nextCursor`       | `string`   | ❌       | —                                                                                              | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: actions, nextCursor } = await zapier.listActions({
  app: "example-app",
});

// Or iterate over all pages
for await (const page of zapier.listActions({
  app: "example-app",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const action of zapier
  .listActions({
    app: "example-app",
  })
  .items()) {
  // Do something with each action
}
```

#### `runAction`

Execute an action with the given inputs

**Parameters:**

| Name             | Type             | Required | Default | Possible Values                                                                                | Description                                                                                                                                                                                                                           |
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —                                                                                              |                                                                                                                                                                                                                                       |
| ​ ↳ `app`        | `string`         | ✅       | —       | —                                                                                              | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')                                                                                                                          |
| ​ ↳ `actionType` | `string`         | ✅       | —       | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type                                                                                                                                                                                    |
| ​ ↳ `action`     | `string`         | ✅       | —       | —                                                                                              | Action key (e.g., 'send_message' or 'find_row')                                                                                                                                                                                       |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —                                                                                              | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —                                                                                              | Input parameters for the action                                                                                                                                                                                                       |
| ​ ↳ `timeoutMs`  | `number`         | ❌       | —       | —                                                                                              | Maximum time to wait for action completion in milliseconds (default: 180000)                                                                                                                                                          |
| ​ ↳ `pageSize`   | `number`         | ❌       | —       | —                                                                                              | Number of results per page                                                                                                                                                                                                            |
| ​ ↳ `maxItems`   | `number`         | ❌       | —       | —                                                                                              | Maximum total items to return across all pages                                                                                                                                                                                        |
| ​ ↳ `cursor`     | `string`         | ❌       | —       | —                                                                                              | Cursor to start from                                                                                                                                                                                                                  |

**Returns:** `Promise<PaginatedResult<ActionResultItem>>`

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: actionResults, nextCursor } = await zapier.runAction({
  app: "example-app",
  actionType: "read",
  action: "example-action",
});

// Or iterate over all pages
for await (const page of zapier.runAction({
  app: "example-app",
  actionType: "read",
  action: "example-action",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const actionResult of zapier
  .runAction({
    app: "example-app",
    actionType: "read",
    action: "example-action",
  })
  .items()) {
  // Do something with each actionResult
}
```

### Apps

#### `apps.{appKey}`

Bind a connection alias or numeric connectionId to an app

**Parameters:**

| Name             | Type             | Required | Default | Possible Values | Description                                                                                                                                                                                     |
| ---------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —               |                                                                                                                                                                                                 |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —               | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |

**Returns:** `Promise<AppProxy>`

**Example:**

```typescript
const result = await zapier.apps.appKey();
```

#### `apps.{appKey}.{actionType}.{actionKey}`

Execute an action with the given inputs for the bound app, as an alternative to runAction

**Parameters:**

| Name             | Type             | Required | Default | Possible Values | Description                                                                                                                                                                                     |
| ---------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —               |                                                                                                                                                                                                 |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —               |                                                                                                                                                                                                 |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —               | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
| ​ ↳ `timeoutMs`  | `number`         | ❌       | —       | —               | Maximum time to wait for action completion in milliseconds (default: 180000)                                                                                                                    |

**Returns:** `Promise<PaginatedResult<ActionResultItem>>`

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: actionResults, nextCursor } =
  await zapier.apps.appKey.actionType.actionKey();

// Or iterate over all pages
for await (const page of zapier.apps.appKey.actionType.actionKey()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const actionResult of zapier.apps.appKey.actionType
  .actionKey()
  .items()) {
  // Do something with each actionResult
}
```

#### `getApp`

Get detailed information about a specific app

**Parameters:**

| Name      | Type     | Required | Default | Possible Values | Description                                                                                                  |
| --------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| `options` | `object` | ✅       | —       | —               |                                                                                                              |
| ​ ↳ `app` | `string` | ✅       | —       | —               | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |

**Returns:** `Promise<AppItem>`

| Name                         | Type       | Required | Possible Values | Description                                         |
| ---------------------------- | ---------- | -------- | --------------- | --------------------------------------------------- |
| `data`                       | `object`   | ✅       | —               |                                                     |
| ​ ↳ `slug`                   | `string`   | ✅       | —               | URL-friendly slug identifier                        |
| ​ ↳ `age_in_days`            | `number`   | ❌       | —               | Number of days since the implementation was created |
| ​ ↳ `auth_type`              | `string`   | ❌       | —               | Authentication type (e.g., oauth2, api_key)         |
| ​ ↳ `banner`                 | `string`   | ❌       | —               | Banner message or status indicator                  |
| ​ ↳ `categories[]`           | `object[]` | ❌       | —               | Categories the implementation belongs to            |
| ​   ↳ `id`                   | `number`   | ✅       | —               | Unique identifier for the category                  |
| ​   ↳ `name`                 | `string`   | ✅       | —               | Display name of the category                        |
| ​   ↳ `slug`                 | `string`   | ✅       | —               | URL-friendly slug for the category                  |
| ​ ↳ `images`                 | `object`   | ❌       | —               | Icon images at various sizes                        |
| ​   ↳ `url_16x16`            | `string`   | ❌       | —               | 16x16 pixel icon URL                                |
| ​   ↳ `url_32x32`            | `string`   | ❌       | —               | 32x32 pixel icon URL                                |
| ​   ↳ `url_64x64`            | `string`   | ❌       | —               | 64x64 pixel icon URL                                |
| ​   ↳ `url_128x128`          | `string`   | ❌       | —               | 128x128 pixel icon URL                              |
| ​ ↳ `popularity`             | `number`   | ❌       | —               | Popularity score for ranking apps                   |
| ​ ↳ `has_filters`            | `boolean`  | ❌       | —               | Whether the app has filter actions                  |
| ​ ↳ `has_reads`              | `boolean`  | ❌       | —               | Whether the app has read actions                    |
| ​ ↳ `has_searches`           | `boolean`  | ❌       | —               | Whether the app has search actions                  |
| ​ ↳ `has_searches_or_writes` | `boolean`  | ❌       | —               | Whether the app has search or write actions         |
| ​ ↳ `has_upfront_fields`     | `boolean`  | ❌       | —               | Whether the app has upfront input fields            |
| ​ ↳ `has_writes`             | `boolean`  | ❌       | —               | Whether the app has write actions                   |
| ​ ↳ `is_beta`                | `boolean`  | ❌       | —               | Whether the app is in beta                          |
| ​ ↳ `is_built_in`            | `boolean`  | ❌       | —               | Whether the app is a built-in Zapier app            |
| ​ ↳ `is_deprecated`          | `boolean`  | ❌       | —               | Whether the app is deprecated                       |
| ​ ↳ `is_featured`            | `boolean`  | ❌       | —               | Whether the app is featured                         |
| ​ ↳ `is_hidden`              | `boolean`  | ❌       | —               | Whether the app is hidden from listings             |
| ​ ↳ `is_invite`              | `boolean`  | ❌       | —               | Whether the app is invite-only                      |
| ​ ↳ `is_premium`             | `boolean`  | ❌       | —               | Whether the app requires a premium plan             |
| ​ ↳ `is_public`              | `boolean`  | ❌       | —               | Whether the app is publicly available               |
| ​ ↳ `is_upcoming`            | `boolean`  | ❌       | —               | Whether the app is upcoming/not yet released        |
| ​ ↳ `version`                | `string`   | ❌       | —               | App version                                         |
| ​ ↳ `visibility`             | `string`   | ❌       | —               | Visibility status (e.g., public, private)           |
| ​ ↳ `actions`                | `object`   | ❌       | —               | Count of available actions by type                  |
| ​   ↳ `read`                 | `number`   | ❌       | —               | Number of read actions                              |
| ​   ↳ `read_bulk`            | `number`   | ❌       | —               | Number of bulk read actions                         |
| ​   ↳ `write`                | `number`   | ❌       | —               | Number of write actions                             |
| ​   ↳ `search`               | `number`   | ❌       | —               | Number of search actions                            |
| ​   ↳ `search_or_write`      | `number`   | ❌       | —               | Number of search-or-write actions                   |
| ​   ↳ `search_and_write`     | `number`   | ❌       | —               | Number of search-and-write actions                  |
| ​   ↳ `filter`               | `number`   | ❌       | —               | Number of filter actions                            |
| ​ ↳ `description`            | `string`   | ❌       | —               | Description of the app                              |
| ​ ↳ `primary_color`          | `string`   | ❌       | —               | Primary brand color (hex)                           |
| ​ ↳ `secondary_color`        | `string`   | ❌       | —               | Secondary brand color (hex)                         |
| ​ ↳ `classification`         | `string`   | ❌       | —               | App classification category                         |
| ​ ↳ `api_docs_url`           | `string`   | ❌       | —               | URL to API documentation                            |
| ​ ↳ `image`                  | `string`   | ❌       | —               | Default image URL for the app                       |
| ​ ↳ `title`                  | `string`   | ✅       | —               | Display name of the app                             |
| ​ ↳ `key`                    | `string`   | ✅       | —               | App key (versionless implementation name)           |
| ​ ↳ `implementation_id`      | `string`   | ✅       | —               | Full implementation ID including version            |

**Example:**

```typescript
const { data: app } = await zapier.getApp({
  app: "example-app",
});
```

#### `listApps`

List all available apps with optional filtering

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                                         |
| -------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                                     |
| ​ ↳ `search`   | `string` | ❌       | —       | —               | Search term to filter apps by name                                  |
| ​ ↳ `pageSize` | `number` | ❌       | —       | —               | Number of apps per page                                             |
| ​ ↳ `apps`     | `array`  | ❌       | —       | —               | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
| ​ ↳ `maxItems` | `number` | ❌       | —       | —               | Maximum total items to return across all pages                      |
| ​ ↳ `cursor`   | `string` | ❌       | —       | —               | Cursor to start from                                                |

**Returns:** `Promise<PaginatedResult<AppItem>>`

| Name                         | Type       | Required | Possible Values | Description                                                    |
| ---------------------------- | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`                     | `object[]` | ✅       | —               |                                                                |
| ​ ↳ `slug`                   | `string`   | ✅       | —               | URL-friendly slug identifier                                   |
| ​ ↳ `age_in_days`            | `number`   | ❌       | —               | Number of days since the implementation was created            |
| ​ ↳ `auth_type`              | `string`   | ❌       | —               | Authentication type (e.g., oauth2, api_key)                    |
| ​ ↳ `banner`                 | `string`   | ❌       | —               | Banner message or status indicator                             |
| ​ ↳ `categories[]`           | `object[]` | ❌       | —               | Categories the implementation belongs to                       |
| ​   ↳ `id`                   | `number`   | ✅       | —               | Unique identifier for the category                             |
| ​   ↳ `name`                 | `string`   | ✅       | —               | Display name of the category                                   |
| ​   ↳ `slug`                 | `string`   | ✅       | —               | URL-friendly slug for the category                             |
| ​ ↳ `images`                 | `object`   | ❌       | —               | Icon images at various sizes                                   |
| ​   ↳ `url_16x16`            | `string`   | ❌       | —               | 16x16 pixel icon URL                                           |
| ​   ↳ `url_32x32`            | `string`   | ❌       | —               | 32x32 pixel icon URL                                           |
| ​   ↳ `url_64x64`            | `string`   | ❌       | —               | 64x64 pixel icon URL                                           |
| ​   ↳ `url_128x128`          | `string`   | ❌       | —               | 128x128 pixel icon URL                                         |
| ​ ↳ `popularity`             | `number`   | ❌       | —               | Popularity score for ranking apps                              |
| ​ ↳ `has_filters`            | `boolean`  | ❌       | —               | Whether the app has filter actions                             |
| ​ ↳ `has_reads`              | `boolean`  | ❌       | —               | Whether the app has read actions                               |
| ​ ↳ `has_searches`           | `boolean`  | ❌       | —               | Whether the app has search actions                             |
| ​ ↳ `has_searches_or_writes` | `boolean`  | ❌       | —               | Whether the app has search or write actions                    |
| ​ ↳ `has_upfront_fields`     | `boolean`  | ❌       | —               | Whether the app has upfront input fields                       |
| ​ ↳ `has_writes`             | `boolean`  | ❌       | —               | Whether the app has write actions                              |
| ​ ↳ `is_beta`                | `boolean`  | ❌       | —               | Whether the app is in beta                                     |
| ​ ↳ `is_built_in`            | `boolean`  | ❌       | —               | Whether the app is a built-in Zapier app                       |
| ​ ↳ `is_deprecated`          | `boolean`  | ❌       | —               | Whether the app is deprecated                                  |
| ​ ↳ `is_featured`            | `boolean`  | ❌       | —               | Whether the app is featured                                    |
| ​ ↳ `is_hidden`              | `boolean`  | ❌       | —               | Whether the app is hidden from listings                        |
| ​ ↳ `is_invite`              | `boolean`  | ❌       | —               | Whether the app is invite-only                                 |
| ​ ↳ `is_premium`             | `boolean`  | ❌       | —               | Whether the app requires a premium plan                        |
| ​ ↳ `is_public`              | `boolean`  | ❌       | —               | Whether the app is publicly available                          |
| ​ ↳ `is_upcoming`            | `boolean`  | ❌       | —               | Whether the app is upcoming/not yet released                   |
| ​ ↳ `version`                | `string`   | ❌       | —               | App version                                                    |
| ​ ↳ `visibility`             | `string`   | ❌       | —               | Visibility status (e.g., public, private)                      |
| ​ ↳ `actions`                | `object`   | ❌       | —               | Count of available actions by type                             |
| ​   ↳ `read`                 | `number`   | ❌       | —               | Number of read actions                                         |
| ​   ↳ `read_bulk`            | `number`   | ❌       | —               | Number of bulk read actions                                    |
| ​   ↳ `write`                | `number`   | ❌       | —               | Number of write actions                                        |
| ​   ↳ `search`               | `number`   | ❌       | —               | Number of search actions                                       |
| ​   ↳ `search_or_write`      | `number`   | ❌       | —               | Number of search-or-write actions                              |
| ​   ↳ `search_and_write`     | `number`   | ❌       | —               | Number of search-and-write actions                             |
| ​   ↳ `filter`               | `number`   | ❌       | —               | Number of filter actions                                       |
| ​ ↳ `description`            | `string`   | ❌       | —               | Description of the app                                         |
| ​ ↳ `primary_color`          | `string`   | ❌       | —               | Primary brand color (hex)                                      |
| ​ ↳ `secondary_color`        | `string`   | ❌       | —               | Secondary brand color (hex)                                    |
| ​ ↳ `classification`         | `string`   | ❌       | —               | App classification category                                    |
| ​ ↳ `api_docs_url`           | `string`   | ❌       | —               | URL to API documentation                                       |
| ​ ↳ `image`                  | `string`   | ❌       | —               | Default image URL for the app                                  |
| ​ ↳ `title`                  | `string`   | ✅       | —               | Display name of the app                                        |
| ​ ↳ `key`                    | `string`   | ✅       | —               | App key (versionless implementation name)                      |
| ​ ↳ `implementation_id`      | `string`   | ✅       | —               | Full implementation ID including version                       |
| `nextCursor`                 | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: apps, nextCursor } = await zapier.listApps();

// Or iterate over all pages
for await (const page of zapier.listApps()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const app of zapier.listApps().items()) {
  // Do something with each app
}
```

### Client Credentials

#### `createClientCredentials`

Create new client credentials for the authenticated user

**Parameters:**

| Name                | Type     | Required | Default        | Possible Values | Description                                    |
| ------------------- | -------- | -------- | -------------- | --------------- | ---------------------------------------------- |
| `options`           | `object` | ✅       | —              | —               |                                                |
| ​ ↳ `name`          | `string` | ✅       | —              | —               | Human-readable name for the client credentials |
| ​ ↳ `allowedScopes` | `array`  | ❌       | `["external"]` | —               | Scopes to allow for these credentials          |

**Returns:** `Promise<ClientCredentialsItem>`

| Name                | Type     | Required | Possible Values | Description                                                |
| ------------------- | -------- | -------- | --------------- | ---------------------------------------------------------- |
| `data`              | `object` | ✅       | —               |                                                            |
| ​ ↳ `client_id`     | `string` | ✅       | —               | The public identifier (Client ID) of the OAuth application |
| ​ ↳ `name`          | `string` | ✅       | —               | Human-readable name of the OAuth application               |
| ​ ↳ `client_secret` | `string` | ✅       | —               | The client secret (only shown once on creation)            |

**Example:**

```typescript
const result = await zapier.createClientCredentials({
  name: "example-name",
});
```

#### `deleteClientCredentials`

Delete client credentials by client ID

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                       |
| -------------- | -------- | -------- | ------- | --------------- | ------------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                   |
| ​ ↳ `clientId` | `string` | ✅       | —       | —               | The client ID of the client credentials to delete |

**Returns:** `Promise<{ success: boolean }>`

**Example:**

```typescript
const result = await zapier.deleteClientCredentials({
  clientId: "example-client-id",
});
```

#### `listClientCredentials`

List client credentials for the authenticated user

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                    |
| -------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                |
| ​ ↳ `pageSize` | `number` | ❌       | —       | —               | Number of credentials per page                 |
| ​ ↳ `maxItems` | `number` | ❌       | —       | —               | Maximum total items to return across all pages |
| ​ ↳ `cursor`   | `string` | ❌       | —       | —               | Cursor to start from                           |

**Returns:** `Promise<PaginatedResult<ClientCredentialsItem>>`

| Name                 | Type       | Required | Possible Values | Description                                                      |
| -------------------- | ---------- | -------- | --------------- | ---------------------------------------------------------------- |
| `data[]`             | `object[]` | ✅       | —               |                                                                  |
| ​ ↳ `client_id`      | `string`   | ✅       | —               | The public identifier (Client ID) of the OAuth application       |
| ​ ↳ `name`           | `string`   | ✅       | —               | Human-readable name of the OAuth application                     |
| ​ ↳ `allowed_scopes` | `array`    | ✅       | —               | List of OAuth scopes that this application is allowed to request |
| ​ ↳ `created_at`     | `string`   | ❌       | —               | When the application was created (ISO 8601)                      |
| ​ ↳ `updated_at`     | `string`   | ❌       | —               | When the application was last updated (ISO 8601)                 |
| `nextCursor`         | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages   |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: clientCredentials, nextCursor } =
  await zapier.listClientCredentials();

// Or iterate over all pages
for await (const page of zapier.listClientCredentials()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const clientCredentials of zapier.listClientCredentials().items()) {
  // Do something with each clientCredentials
}
```

### Connections

#### `findFirstConnection`

Find the first connection matching the criteria

**Parameters:**

| Name                | Type      | Required | Default | Possible Values | Description                                                                                                                                         |
| ------------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`           | `object`  | ✅       | —       | —               |                                                                                                                                                     |
| ​ ↳ `search`        | `string`  | ❌       | —       | —               | Search term to filter connections by title                                                                                                          |
| ​ ↳ `title`         | `string`  | ❌       | —       | —               | Filter connections by exact title match (searches first, then filters locally)                                                                      |
| ​ ↳ `owner`         | `string`  | ❌       | —       | —               | Filter by owner, 'me' for your own connections or a specific user ID                                                                                |
| ​ ↳ `app`           | `string`  | ❌       | —       | —               | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')                                                                          |
| ​ ↳ `account`       | `string`  | ❌       | —       | —               | Account to filter by                                                                                                                                |
| ​ ↳ `includeShared` | `boolean` | ❌       | —       | —               | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
| ​ ↳ `expired`       | `boolean` | ❌       | —       | —               | Show only expired connections (default: only non-expired connections are returned)                                                                  |

**Returns:** `Promise<ConnectionItem>`

| Name                           | Type      | Required | Possible Values | Description                                                |
| ------------------------------ | --------- | -------- | --------------- | ---------------------------------------------------------- |
| `data`                         | `object`  | ✅       | —               |                                                            |
| ​ ↳ `id`                       | `string`  | ✅       | —               | Unique identifier for the connection                       |
| ​ ↳ `date`                     | `string`  | ✅       | —               | Date created                                               |
| ​ ↳ `lastchanged`              | `string`  | ❌       | —               | Date last changed                                          |
| ​ ↳ `account_id`               | `string`  | ✅       | —               | Account ID associated with this connection                 |
| ​ ↳ `destination_selected_api` | `string`  | ❌       | —               | Destination API key (if applicable)                        |
| ​ ↳ `is_invite_only`           | `boolean` | ✅       | —               | Whether the connection is invite-only                      |
| ​ ↳ `is_private`               | `boolean` | ✅       | —               | Whether the connection is private                          |
| ​ ↳ `shared_with_all`          | `boolean` | ✅       | —               | Whether the connection is shared with all users            |
| ​ ↳ `is_stale`                 | `string`  | ❌       | —               | Stale status string                                        |
| ​ ↳ `is_shared`                | `string`  | ❌       | —               | Shared status string                                       |
| ​ ↳ `marked_stale_at`          | `string`  | ❌       | —               | Date when marked stale                                     |
| ​ ↳ `label`                    | `string`  | ❌       | —               | User label for the connection                              |
| ​ ↳ `identifier`               | `string`  | ❌       | —               | Identifier                                                 |
| ​ ↳ `title`                    | `string`  | ❌       | —               | Title of the connection                                    |
| ​ ↳ `url`                      | `string`  | ❌       | —               | URL to the connection resource                             |
| ​ ↳ `groups`                   | `array`   | ❌       | —               | Array of groups associated with the connection             |
| ​ ↳ `members`                  | `string`  | ❌       | —               | Members associated with the connection                     |
| ​ ↳ `permissions`              | `object`  | ❌       | —               | Permissions for the connection                             |
| ​ ↳ `public_id`                | `string`  | ❌       | —               | Public UUID for the connection                             |
| ​ ↳ `account_public_id`        | `string`  | ❌       | —               | Public UUID for the associated account                     |
| ​ ↳ `customuser_public_id`     | `string`  | ❌       | —               | Public UUID for the associated custom user                 |
| ​ ↳ `implementation_id`        | `string`  | ❌       | —               | Implementation ID (was selected_api)                       |
| ​ ↳ `profile_id`               | `string`  | ❌       | —               | Profile ID (was customuser_id)                             |
| ​ ↳ `is_expired`               | `string`  | ❌       | —               | Whether the connection is expired (mapped from is_stale)   |
| ​ ↳ `expired_at`               | `string`  | ❌       | —               | Date when connection expired (mapped from marked_stale_at) |
| ​ ↳ `app_key`                  | `string`  | ❌       | —               | App Key extracted from implementation_id                   |
| ​ ↳ `app_version`              | `string`  | ❌       | —               | App Version extracted from implementation_id               |

**Example:**

```typescript
const { data: connection } = await zapier.findFirstConnection();
```

#### `findUniqueConnection`

Find a unique connection matching the criteria

**Parameters:**

| Name                | Type      | Required | Default | Possible Values | Description                                                                                                                                         |
| ------------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`           | `object`  | ✅       | —       | —               |                                                                                                                                                     |
| ​ ↳ `search`        | `string`  | ❌       | —       | —               | Search term to filter connections by title                                                                                                          |
| ​ ↳ `title`         | `string`  | ❌       | —       | —               | Filter connections by exact title match (searches first, then filters locally)                                                                      |
| ​ ↳ `owner`         | `string`  | ❌       | —       | —               | Filter by owner, 'me' for your own connections or a specific user ID                                                                                |
| ​ ↳ `app`           | `string`  | ❌       | —       | —               | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')                                                                          |
| ​ ↳ `account`       | `string`  | ❌       | —       | —               | Account to filter by                                                                                                                                |
| ​ ↳ `includeShared` | `boolean` | ❌       | —       | —               | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
| ​ ↳ `expired`       | `boolean` | ❌       | —       | —               | Show only expired connections (default: only non-expired connections are returned)                                                                  |

**Returns:** `Promise<ConnectionItem>`

| Name                           | Type      | Required | Possible Values | Description                                                |
| ------------------------------ | --------- | -------- | --------------- | ---------------------------------------------------------- |
| `data`                         | `object`  | ✅       | —               |                                                            |
| ​ ↳ `id`                       | `string`  | ✅       | —               | Unique identifier for the connection                       |
| ​ ↳ `date`                     | `string`  | ✅       | —               | Date created                                               |
| ​ ↳ `lastchanged`              | `string`  | ❌       | —               | Date last changed                                          |
| ​ ↳ `account_id`               | `string`  | ✅       | —               | Account ID associated with this connection                 |
| ​ ↳ `destination_selected_api` | `string`  | ❌       | —               | Destination API key (if applicable)                        |
| ​ ↳ `is_invite_only`           | `boolean` | ✅       | —               | Whether the connection is invite-only                      |
| ​ ↳ `is_private`               | `boolean` | ✅       | —               | Whether the connection is private                          |
| ​ ↳ `shared_with_all`          | `boolean` | ✅       | —               | Whether the connection is shared with all users            |
| ​ ↳ `is_stale`                 | `string`  | ❌       | —               | Stale status string                                        |
| ​ ↳ `is_shared`                | `string`  | ❌       | —               | Shared status string                                       |
| ​ ↳ `marked_stale_at`          | `string`  | ❌       | —               | Date when marked stale                                     |
| ​ ↳ `label`                    | `string`  | ❌       | —               | User label for the connection                              |
| ​ ↳ `identifier`               | `string`  | ❌       | —               | Identifier                                                 |
| ​ ↳ `title`                    | `string`  | ❌       | —               | Title of the connection                                    |
| ​ ↳ `url`                      | `string`  | ❌       | —               | URL to the connection resource                             |
| ​ ↳ `groups`                   | `array`   | ❌       | —               | Array of groups associated with the connection             |
| ​ ↳ `members`                  | `string`  | ❌       | —               | Members associated with the connection                     |
| ​ ↳ `permissions`              | `object`  | ❌       | —               | Permissions for the connection                             |
| ​ ↳ `public_id`                | `string`  | ❌       | —               | Public UUID for the connection                             |
| ​ ↳ `account_public_id`        | `string`  | ❌       | —               | Public UUID for the associated account                     |
| ​ ↳ `customuser_public_id`     | `string`  | ❌       | —               | Public UUID for the associated custom user                 |
| ​ ↳ `implementation_id`        | `string`  | ❌       | —               | Implementation ID (was selected_api)                       |
| ​ ↳ `profile_id`               | `string`  | ❌       | —               | Profile ID (was customuser_id)                             |
| ​ ↳ `is_expired`               | `string`  | ❌       | —               | Whether the connection is expired (mapped from is_stale)   |
| ​ ↳ `expired_at`               | `string`  | ❌       | —               | Date when connection expired (mapped from marked_stale_at) |
| ​ ↳ `app_key`                  | `string`  | ❌       | —               | App Key extracted from implementation_id                   |
| ​ ↳ `app_version`              | `string`  | ❌       | —               | App Version extracted from implementation_id               |

**Example:**

```typescript
const { data: connection } = await zapier.findUniqueConnection();
```

#### `getConnection`

Execute getConnection

**Parameters:**

| Name             | Type             | Required | Default | Possible Values | Description                                                                                                                                                                                     |
| ---------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —               |                                                                                                                                                                                                 |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —               | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |

**Returns:** `Promise<ConnectionItem>`

| Name                           | Type      | Required | Possible Values | Description                                                |
| ------------------------------ | --------- | -------- | --------------- | ---------------------------------------------------------- |
| `data`                         | `object`  | ✅       | —               |                                                            |
| ​ ↳ `id`                       | `string`  | ✅       | —               | Unique identifier for the connection                       |
| ​ ↳ `date`                     | `string`  | ✅       | —               | Date created                                               |
| ​ ↳ `lastchanged`              | `string`  | ❌       | —               | Date last changed                                          |
| ​ ↳ `account_id`               | `string`  | ✅       | —               | Account ID associated with this connection                 |
| ​ ↳ `destination_selected_api` | `string`  | ❌       | —               | Destination API key (if applicable)                        |
| ​ ↳ `is_invite_only`           | `boolean` | ✅       | —               | Whether the connection is invite-only                      |
| ​ ↳ `is_private`               | `boolean` | ✅       | —               | Whether the connection is private                          |
| ​ ↳ `shared_with_all`          | `boolean` | ✅       | —               | Whether the connection is shared with all users            |
| ​ ↳ `is_stale`                 | `string`  | ❌       | —               | Stale status string                                        |
| ​ ↳ `is_shared`                | `string`  | ❌       | —               | Shared status string                                       |
| ​ ↳ `marked_stale_at`          | `string`  | ❌       | —               | Date when marked stale                                     |
| ​ ↳ `label`                    | `string`  | ❌       | —               | User label for the connection                              |
| ​ ↳ `identifier`               | `string`  | ❌       | —               | Identifier                                                 |
| ​ ↳ `title`                    | `string`  | ❌       | —               | Title of the connection                                    |
| ​ ↳ `url`                      | `string`  | ❌       | —               | URL to the connection resource                             |
| ​ ↳ `groups`                   | `array`   | ❌       | —               | Array of groups associated with the connection             |
| ​ ↳ `members`                  | `string`  | ❌       | —               | Members associated with the connection                     |
| ​ ↳ `permissions`              | `object`  | ❌       | —               | Permissions for the connection                             |
| ​ ↳ `public_id`                | `string`  | ❌       | —               | Public UUID for the connection                             |
| ​ ↳ `account_public_id`        | `string`  | ❌       | —               | Public UUID for the associated account                     |
| ​ ↳ `customuser_public_id`     | `string`  | ❌       | —               | Public UUID for the associated custom user                 |
| ​ ↳ `implementation_id`        | `string`  | ❌       | —               | Implementation ID (was selected_api)                       |
| ​ ↳ `profile_id`               | `string`  | ❌       | —               | Profile ID (was customuser_id)                             |
| ​ ↳ `is_expired`               | `string`  | ❌       | —               | Whether the connection is expired (mapped from is_stale)   |
| ​ ↳ `expired_at`               | `string`  | ❌       | —               | Date when connection expired (mapped from marked_stale_at) |
| ​ ↳ `app_key`                  | `string`  | ❌       | —               | App Key extracted from implementation_id                   |
| ​ ↳ `app_version`              | `string`  | ❌       | —               | App Version extracted from implementation_id               |

**Example:**

```typescript
const { data: connection } = await zapier.getConnection();
```

#### `listConnections`

List available connections with optional filtering

**Parameters:**

| Name                | Type      | Required | Default | Possible Values | Description                                                                                                                                         |
| ------------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`           | `object`  | ✅       | —       | —               |                                                                                                                                                     |
| ​ ↳ `search`        | `string`  | ❌       | —       | —               | Search term to filter connections by title                                                                                                          |
| ​ ↳ `title`         | `string`  | ❌       | —       | —               | Filter connections by exact title match (searches first, then filters locally)                                                                      |
| ​ ↳ `owner`         | `string`  | ❌       | —       | —               | Filter by owner, 'me' for your own connections or a specific user ID                                                                                |
| ​ ↳ `app`           | `string`  | ❌       | —       | —               | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')                                                                          |
| ​ ↳ `connections`   | `array`   | ❌       | —       | —               | List of connection IDs to filter by                                                                                                                 |
| ​ ↳ `account`       | `string`  | ❌       | —       | —               | Account to filter by                                                                                                                                |
| ​ ↳ `includeShared` | `boolean` | ❌       | —       | —               | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
| ​ ↳ `expired`       | `boolean` | ❌       | —       | —               | Show only expired connections (default: only non-expired connections are returned)                                                                  |
| ​ ↳ `pageSize`      | `number`  | ❌       | —       | —               | Number of connections per page                                                                                                                      |
| ​ ↳ `maxItems`      | `number`  | ❌       | —       | —               | Maximum total items to return across all pages                                                                                                      |
| ​ ↳ `cursor`        | `string`  | ❌       | —       | —               | Cursor to start from                                                                                                                                |

**Returns:** `Promise<PaginatedResult<ConnectionItem>>`

| Name                           | Type       | Required | Possible Values | Description                                                    |
| ------------------------------ | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`                       | `object[]` | ✅       | —               |                                                                |
| ​ ↳ `id`                       | `string`   | ✅       | —               | Unique identifier for the connection                           |
| ​ ↳ `date`                     | `string`   | ✅       | —               | Date created                                                   |
| ​ ↳ `lastchanged`              | `string`   | ❌       | —               | Date last changed                                              |
| ​ ↳ `account_id`               | `string`   | ✅       | —               | Account ID associated with this connection                     |
| ​ ↳ `destination_selected_api` | `string`   | ❌       | —               | Destination API key (if applicable)                            |
| ​ ↳ `is_invite_only`           | `boolean`  | ✅       | —               | Whether the connection is invite-only                          |
| ​ ↳ `is_private`               | `boolean`  | ✅       | —               | Whether the connection is private                              |
| ​ ↳ `shared_with_all`          | `boolean`  | ✅       | —               | Whether the connection is shared with all users                |
| ​ ↳ `is_stale`                 | `string`   | ❌       | —               | Stale status string                                            |
| ​ ↳ `is_shared`                | `string`   | ❌       | —               | Shared status string                                           |
| ​ ↳ `marked_stale_at`          | `string`   | ❌       | —               | Date when marked stale                                         |
| ​ ↳ `label`                    | `string`   | ❌       | —               | User label for the connection                                  |
| ​ ↳ `identifier`               | `string`   | ❌       | —               | Identifier                                                     |
| ​ ↳ `title`                    | `string`   | ❌       | —               | Title of the connection                                        |
| ​ ↳ `url`                      | `string`   | ❌       | —               | URL to the connection resource                                 |
| ​ ↳ `groups`                   | `array`    | ❌       | —               | Array of groups associated with the connection                 |
| ​ ↳ `members`                  | `string`   | ❌       | —               | Members associated with the connection                         |
| ​ ↳ `permissions`              | `object`   | ❌       | —               | Permissions for the connection                                 |
| ​ ↳ `public_id`                | `string`   | ❌       | —               | Public UUID for the connection                                 |
| ​ ↳ `account_public_id`        | `string`   | ❌       | —               | Public UUID for the associated account                         |
| ​ ↳ `customuser_public_id`     | `string`   | ❌       | —               | Public UUID for the associated custom user                     |
| ​ ↳ `implementation_id`        | `string`   | ❌       | —               | Implementation ID (was selected_api)                           |
| ​ ↳ `profile_id`               | `string`   | ❌       | —               | Profile ID (was customuser_id)                                 |
| ​ ↳ `is_expired`               | `string`   | ❌       | —               | Whether the connection is expired (mapped from is_stale)       |
| ​ ↳ `expired_at`               | `string`   | ❌       | —               | Date when connection expired (mapped from marked_stale_at)     |
| ​ ↳ `app_key`                  | `string`   | ❌       | —               | App Key extracted from implementation_id                       |
| ​ ↳ `app_version`              | `string`   | ❌       | —               | App Version extracted from implementation_id                   |
| `nextCursor`                   | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: connections, nextCursor } = await zapier.listConnections();

// Or iterate over all pages
for await (const page of zapier.listConnections()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const connection of zapier.listConnections().items()) {
  // Do something with each connection
}
```

### HTTP Requests

#### `fetch`

Make authenticated HTTP requests to any API through Zapier. Pass a connectionId to automatically inject the user's stored credentials (OAuth tokens, API keys, etc.) into the outgoing request. Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.

**Parameters:**

| Name              | Type                     | Required | Default | Possible Values                                            | Description                                                                                                                                                                                     |
| ----------------- | ------------------------ | -------- | ------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `url`             | `string, custom`         | ✅       | —       | —                                                          | The full URL of the API endpoint to call (proxied through Zapier's Relay service)                                                                                                               |
| `init`            | `object`                 | ❌       | —       | —                                                          | Request options including method, headers, body, and authentication                                                                                                                             |
| ​ ↳ `method`      | `string`                 | ❌       | —       | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method for the request (defaults to GET)                                                                                                                                                   |
| ​ ↳ `headers`     | `object`                 | ❌       | —       | —                                                          | HTTP headers to include in the request                                                                                                                                                          |
| ​ ↳ `body`        | `string, custom, record` | ❌       | —       | —                                                          | Request body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly                                                                                             |
| ​ ↳ `connection`  | `string, number`         | ❌       | —       | —                                                          | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
| ​ ↳ `callbackUrl` | `string`                 | ❌       | —       | —                                                          | URL to send async response to (makes request async)                                                                                                                                             |
| ​ ↳ `maxTime`     | `number`                 | ❌       | —       | —                                                          | Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling.                                                                        |

**Returns:** `Promise<Response>`

**Example:**

```typescript
const result = await zapier.fetch("https://example.com", {});
```

### Tables

#### `createTable`

Create a new table

**Parameters:**

| Name              | Type     | Required | Default | Possible Values | Description                          |
| ----------------- | -------- | -------- | ------- | --------------- | ------------------------------------ |
| `options`         | `object` | ✅       | —       | —               |                                      |
| ​ ↳ `name`        | `string` | ✅       | —       | —               | The name for the new table           |
| ​ ↳ `description` | `string` | ❌       | —       | —               | An optional description of the table |

**Returns:** `Promise<TableItem>`

| Name                  | Type     | Required | Possible Values          | Description |
| --------------------- | -------- | -------- | ------------------------ | ----------- |
| `data`                | `object` | ✅       | —                        |             |
| ​ ↳ `id`              | `string` | ✅       | —                        |             |
| ​ ↳ `name`            | `string` | ✅       | —                        |             |
| ​ ↳ `description`     | `string` | ❌       | —                        |             |
| ​ ↳ `created_at`      | `string` | ✅       | —                        |             |
| ​ ↳ `edited_at`       | `string` | ✅       | —                        |             |
| ​ ↳ `kind`            | `string` | ✅       | `table`, `virtual_table` |             |
| ​ ↳ `account_id`      | `string` | ✅       | —                        |             |
| ​ ↳ `profile_id`      | `string` | ✅       | —                        |             |
| ​ ↳ `parent_table_id` | `string` | ❌       | —                        |             |

**Example:**

```typescript
const result = await zapier.createTable({
  name: "example-name",
});
```

#### `createTableFields`

Create one or more fields in a table

**Parameters:**

| Name            | Type       | Required | Default | Possible Values                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description                              |
| --------------- | ---------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| `options`       | `object`   | ✅       | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                          |
| ​ ↳ `table`     | `string`   | ✅       | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | The unique identifier of the table       |
| ​ ↳ `fields[]`  | `object[]` | ✅       | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Array of field definitions to create     |
| ​   ↳ `type`    | `string`   | ✅       | —       | `string`, `multiple_string`, `labeled_string`, `multiple_labeled_string`, `text`, `multiple_text`, `boolean`, `multiple_boolean`, `number`, `multiple_number`, `decimal`, `multiple_decimal`, `datetime`, `multiple_datetime`, `uuid`, `multiple_uuid`, `json`, `multiple_json`, `formula`, `button_trigger_zap`, `button_continue_zap`, `email`, `multiple_email`, `link`, `multiple_link`, `currency`, `phone_number`, `ai_formula`, `linked_record`, `multiple_linked_record` | The data type of the field               |
| ​   ↳ `name`    | `string`   | ✅       | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | The display name of the field            |
| ​   ↳ `options` | `object`   | ❌       | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Data configuration options for the field |
| ​   ↳ `config`  | `object`   | ❌       | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Display configuration for the field      |

**Returns:** `Promise<FieldItem[]>`

| Name             | Type       | Required | Possible Values                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description |
| ---------------- | ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `data[]`         | `object[]` | ✅       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| ​ ↳ `id`         | `string`   | ✅       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| ​ ↳ `type`       | `string`   | ✅       | `string`, `multiple_string`, `labeled_string`, `multiple_labeled_string`, `text`, `multiple_text`, `boolean`, `multiple_boolean`, `number`, `multiple_number`, `decimal`, `multiple_decimal`, `datetime`, `multiple_datetime`, `uuid`, `multiple_uuid`, `json`, `multiple_json`, `formula`, `button_trigger_zap`, `button_continue_zap`, `email`, `multiple_email`, `link`, `multiple_link`, `currency`, `phone_number`, `ai_formula`, `linked_record`, `multiple_linked_record` |             |
| ​ ↳ `name`       | `string`   | ✅       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| ​ ↳ `created_at` | `string`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| ​ ↳ `edited_at`  | `string`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| ​ ↳ `options`    | `object`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| ​ ↳ `config`     | `object`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |

**Example:**

```typescript
const result = await zapier.createTableFields({
  table: "example-table",
  fields: [
    {
      type: "string",
      name: "example-name",
    },
  ],
});
```

#### `createTableRecords`

Create one or more records in a table

**Parameters:**

| Name            | Type       | Required | Default   | Possible Values | Description                                                                                                                       |
| --------------- | ---------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `options`       | `object`   | ✅       | —         | —               |                                                                                                                                   |
| ​ ↳ `table`     | `string`   | ✅       | —         | —               | The unique identifier of the table                                                                                                |
| ​ ↳ `records[]` | `object[]` | ✅       | —         | —               | Array of records to create (max 100)                                                                                              |
| ​   ↳ `data`    | `object`   | ✅       | —         | —               | The field values for the record, keyed by field ID                                                                                |
| ​ ↳ `keyMode`   | `string`   | ❌       | `"names"` | —               | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |

**Returns:** `Promise<RecordItem[]>`

| Name             | Type       | Required | Possible Values | Description |
| ---------------- | ---------- | -------- | --------------- | ----------- |
| `data[]`         | `object[]` | ✅       | —               |             |
| ​ ↳ `id`         | `string`   | ✅       | —               |             |
| ​ ↳ `data`       | `object`   | ✅       | —               |             |
| ​ ↳ `created_at` | `string`   | ✅       | —               |             |
| ​ ↳ `edited_at`  | `string`   | ✅       | —               |             |

**Example:**

```typescript
const result = await zapier.createTableRecords({
  table: "example-table",
  records: [
    {
      data: {},
    },
  ],
});
```

#### `deleteTable`

Delete a table by its ID

**Parameters:**

| Name        | Type     | Required | Default | Possible Values | Description                        |
| ----------- | -------- | -------- | ------- | --------------- | ---------------------------------- |
| `options`   | `object` | ✅       | —       | —               |                                    |
| ​ ↳ `table` | `string` | ✅       | —       | —               | The unique identifier of the table |

**Returns:** `Promise<{ success: boolean }>`

**Example:**

```typescript
const result = await zapier.deleteTable({
  table: "example-table",
});
```

#### `deleteTableFields`

Delete one or more fields from a table

**Parameters:**

| Name         | Type     | Required | Default | Possible Values | Description                                                                               |
| ------------ | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------- |
| `options`    | `object` | ✅       | —       | —               |                                                                                           |
| ​ ↳ `table`  | `string` | ✅       | —       | —               | The unique identifier of the table                                                        |
| ​ ↳ `fields` | `array`  | ✅       | —       | —               | Fields to operate on. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6). |

**Returns:** `Promise<{ success: boolean }>`

**Example:**

```typescript
const result = await zapier.deleteTableFields({
  table: "example-table",
  fields: ["example-field"],
});
```

#### `deleteTableRecords`

Delete one or more records from a table

**Parameters:**

| Name          | Type     | Required | Default | Possible Values | Description                        |
| ------------- | -------- | -------- | ------- | --------------- | ---------------------------------- |
| `options`     | `object` | ✅       | —       | —               |                                    |
| ​ ↳ `table`   | `string` | ✅       | —       | —               | The unique identifier of the table |
| ​ ↳ `records` | `array`  | ✅       | —       | —               | Record IDs to operate on           |

**Returns:** `Promise<{ success: boolean }>`

**Example:**

```typescript
const result = await zapier.deleteTableRecords({
  table: "example-table",
  records: ["example-record"],
});
```

#### `getTable`

Get detailed information about a specific table

**Parameters:**

| Name        | Type     | Required | Default | Possible Values | Description                        |
| ----------- | -------- | -------- | ------- | --------------- | ---------------------------------- |
| `options`   | `object` | ✅       | —       | —               |                                    |
| ​ ↳ `table` | `string` | ✅       | —       | —               | The unique identifier of the table |

**Returns:** `Promise<TableItem>`

| Name                  | Type     | Required | Possible Values          | Description |
| --------------------- | -------- | -------- | ------------------------ | ----------- |
| `data`                | `object` | ✅       | —                        |             |
| ​ ↳ `id`              | `string` | ✅       | —                        |             |
| ​ ↳ `name`            | `string` | ✅       | —                        |             |
| ​ ↳ `description`     | `string` | ❌       | —                        |             |
| ​ ↳ `created_at`      | `string` | ✅       | —                        |             |
| ​ ↳ `edited_at`       | `string` | ✅       | —                        |             |
| ​ ↳ `kind`            | `string` | ✅       | `table`, `virtual_table` |             |
| ​ ↳ `account_id`      | `string` | ✅       | —                        |             |
| ​ ↳ `profile_id`      | `string` | ✅       | —                        |             |
| ​ ↳ `parent_table_id` | `string` | ❌       | —                        |             |

**Example:**

```typescript
const { data: table } = await zapier.getTable({
  table: "example-table",
});
```

#### `getTableRecord`

Get a single record from a table by ID

**Parameters:**

| Name          | Type     | Required | Default   | Possible Values | Description                                                                                                                       |
| ------------- | -------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `options`     | `object` | ✅       | —         | —               |                                                                                                                                   |
| ​ ↳ `table`   | `string` | ✅       | —         | —               | The unique identifier of the table                                                                                                |
| ​ ↳ `record`  | `string` | ✅       | —         | —               | The unique identifier of the record                                                                                               |
| ​ ↳ `keyMode` | `string` | ❌       | `"names"` | —               | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |

**Returns:** `Promise<RecordItem>`

| Name             | Type     | Required | Possible Values | Description |
| ---------------- | -------- | -------- | --------------- | ----------- |
| `data`           | `object` | ✅       | —               |             |
| ​ ↳ `id`         | `string` | ✅       | —               |             |
| ​ ↳ `data`       | `object` | ✅       | —               |             |
| ​ ↳ `created_at` | `string` | ✅       | —               |             |
| ​ ↳ `edited_at`  | `string` | ✅       | —               |             |

**Example:**

```typescript
const { data: record } = await zapier.getTableRecord({
  table: "example-table",
  record: "example-record",
});
```

#### `listTableFields`

List fields for a table

**Parameters:**

| Name         | Type     | Required | Default | Possible Values | Description                                                                               |
| ------------ | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------- |
| `options`    | `object` | ✅       | —       | —               |                                                                                           |
| ​ ↳ `table`  | `string` | ✅       | —       | —               | The unique identifier of the table                                                        |
| ​ ↳ `fields` | `array`  | ❌       | —       | —               | Fields to operate on. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6). |

**Returns:** `Promise<PaginatedResult<FieldItem>>`

| Name             | Type       | Required | Possible Values                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description                                                    |
| ---------------- | ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `data[]`         | `object[]` | ✅       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| ​ ↳ `id`         | `string`   | ✅       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| ​ ↳ `type`       | `string`   | ✅       | `string`, `multiple_string`, `labeled_string`, `multiple_labeled_string`, `text`, `multiple_text`, `boolean`, `multiple_boolean`, `number`, `multiple_number`, `decimal`, `multiple_decimal`, `datetime`, `multiple_datetime`, `uuid`, `multiple_uuid`, `json`, `multiple_json`, `formula`, `button_trigger_zap`, `button_continue_zap`, `email`, `multiple_email`, `link`, `multiple_link`, `currency`, `phone_number`, `ai_formula`, `linked_record`, `multiple_linked_record` |                                                                |
| ​ ↳ `name`       | `string`   | ✅       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| ​ ↳ `created_at` | `string`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| ​ ↳ `edited_at`  | `string`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| ​ ↳ `options`    | `object`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| ​ ↳ `config`     | `object`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                |
| `nextCursor`     | `string`   | ❌       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: fields, nextCursor } = await zapier.listTableFields({
  table: "example-table",
});

// Or iterate over all pages
for await (const page of zapier.listTableFields({
  table: "example-table",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const field of zapier
  .listTableFields({
    table: "example-table",
  })
  .items()) {
  // Do something with each field
}
```

#### `listTableRecords`

List records in a table with optional filtering and sorting

**Parameters:**

| Name              | Type       | Required | Default   | Possible Values                                                                                                                       | Description                                                                                                                       |
| ----------------- | ---------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `options`         | `object`   | ✅       | —         | —                                                                                                                                     |                                                                                                                                   |
| ​ ↳ `table`       | `string`   | ✅       | —         | —                                                                                                                                     | The unique identifier of the table                                                                                                |
| ​ ↳ `filters[]`   | `object[]` | ❌       | —         | —                                                                                                                                     | Filter conditions for the query                                                                                                   |
| ​   ↳ `fieldKey`  | `string`   | ✅       | —         | —                                                                                                                                     | The field key to filter on (e.g. f1, f2)                                                                                          |
| ​   ↳ `operator`  | `string`   | ✅       | —         | `exact`, `different`, `contains`, `icontains`, `gte`, `gt`, `lt`, `lte`, `range`, `in`, `isnull`, `startswith`, `search`, `is_within` | The comparison operator                                                                                                           |
| ​   ↳ `value`     | `string`   | ❌       | —         | —                                                                                                                                     | The value to compare against                                                                                                      |
| ​ ↳ `sort`        | `object`   | ❌       | —         | —                                                                                                                                     | Sort records by a field                                                                                                           |
| ​   ↳ `fieldKey`  | `string`   | ✅       | —         | —                                                                                                                                     | The field key to sort by                                                                                                          |
| ​   ↳ `direction` | `string`   | ❌       | `"asc"`   | —                                                                                                                                     | Sort direction                                                                                                                    |
| ​ ↳ `pageSize`    | `number`   | ❌       | —         | —                                                                                                                                     | Number of records per page (max 1000)                                                                                             |
| ​ ↳ `maxItems`    | `number`   | ❌       | —         | —                                                                                                                                     | Maximum total items to return across all pages                                                                                    |
| ​ ↳ `cursor`      | `string`   | ❌       | —         | —                                                                                                                                     | Cursor to start from                                                                                                              |
| ​ ↳ `keyMode`     | `string`   | ❌       | `"names"` | —                                                                                                                                     | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |

**Returns:** `Promise<PaginatedResult<RecordItem>>`

| Name             | Type       | Required | Possible Values | Description                                                    |
| ---------------- | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`         | `object[]` | ✅       | —               |                                                                |
| ​ ↳ `id`         | `string`   | ✅       | —               |                                                                |
| ​ ↳ `data`       | `object`   | ✅       | —               |                                                                |
| ​ ↳ `created_at` | `string`   | ✅       | —               |                                                                |
| ​ ↳ `edited_at`  | `string`   | ✅       | —               |                                                                |
| `nextCursor`     | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: records, nextCursor } = await zapier.listTableRecords({
  table: "example-table",
});

// Or iterate over all pages
for await (const page of zapier.listTableRecords({
  table: "example-table",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const record of zapier
  .listTableRecords({
    table: "example-table",
  })
  .items()) {
  // Do something with each record
}
```

#### `listTables`

List tables available to the authenticated user

**Parameters:**

| Name                | Type      | Required | Default | Possible Values                  | Description                                                                                                    |
| ------------------- | --------- | -------- | ------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `options`           | `object`  | ✅       | —       | —                                |                                                                                                                |
| ​ ↳ `tables`        | `array`   | ❌       | —       | —                                | Filter by specific table IDs                                                                                   |
| ​ ↳ `kind`          | `string`  | ❌       | —       | `table`, `virtual_table`, `both` | Filter by table type                                                                                           |
| ​ ↳ `search`        | `string`  | ❌       | —       | —                                | Search term to filter tables by name                                                                           |
| ​ ↳ `owner`         | `string`  | ❌       | —       | —                                | Filter by table owner. Use "me" for the current user, or a numeric user ID. Requires includeShared to be true. |
| ​ ↳ `includeShared` | `boolean` | ❌       | —       | —                                | Include tables shared with you. Without this, only your own tables are returned.                               |
| ​ ↳ `pageSize`      | `number`  | ❌       | —       | —                                | Number of tables per page                                                                                      |
| ​ ↳ `maxItems`      | `number`  | ❌       | —       | —                                | Maximum total items to return across all pages                                                                 |
| ​ ↳ `cursor`        | `string`  | ❌       | —       | —                                | Cursor to start from                                                                                           |

**Returns:** `Promise<PaginatedResult<TableItem>>`

| Name                  | Type       | Required | Possible Values          | Description                                                    |
| --------------------- | ---------- | -------- | ------------------------ | -------------------------------------------------------------- |
| `data[]`              | `object[]` | ✅       | —                        |                                                                |
| ​ ↳ `id`              | `string`   | ✅       | —                        |                                                                |
| ​ ↳ `name`            | `string`   | ✅       | —                        |                                                                |
| ​ ↳ `description`     | `string`   | ❌       | —                        |                                                                |
| ​ ↳ `created_at`      | `string`   | ✅       | —                        |                                                                |
| ​ ↳ `edited_at`       | `string`   | ✅       | —                        |                                                                |
| ​ ↳ `kind`            | `string`   | ✅       | `table`, `virtual_table` |                                                                |
| ​ ↳ `account_id`      | `string`   | ✅       | —                        |                                                                |
| ​ ↳ `profile_id`      | `string`   | ✅       | —                        |                                                                |
| ​ ↳ `parent_table_id` | `string`   | ❌       | —                        |                                                                |
| `nextCursor`          | `string`   | ❌       | —                        | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: tables, nextCursor } = await zapier.listTables();

// Or iterate over all pages
for await (const page of zapier.listTables()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const table of zapier.listTables().items()) {
  // Do something with each table
}
```

#### `updateTableRecords`

Update one or more records in a table

**Parameters:**

| Name            | Type       | Required | Default   | Possible Values | Description                                                                                                                       |
| --------------- | ---------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `options`       | `object`   | ✅       | —         | —               |                                                                                                                                   |
| ​ ↳ `table`     | `string`   | ✅       | —         | —               | The unique identifier of the table                                                                                                |
| ​ ↳ `records[]` | `object[]` | ✅       | —         | —               | Array of records to update (max 100)                                                                                              |
| ​   ↳ `id`      | `string`   | ✅       | —         | —               | The record ID to update                                                                                                           |
| ​   ↳ `data`    | `object`   | ✅       | —         | —               | The field values to update, keyed by field key                                                                                    |
| ​ ↳ `keyMode`   | `string`   | ❌       | `"names"` | —               | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |

**Returns:** `Promise<RecordItem[]>`

| Name             | Type       | Required | Possible Values | Description |
| ---------------- | ---------- | -------- | --------------- | ----------- |
| `data[]`         | `object[]` | ✅       | —               |             |
| ​ ↳ `id`         | `string`   | ✅       | —               |             |
| ​ ↳ `data`       | `object`   | ✅       | —               |             |
| ​ ↳ `created_at` | `string`   | ✅       | —               |             |
| ​ ↳ `edited_at`  | `string`   | ✅       | —               |             |

**Example:**

```typescript
const result = await zapier.updateTableRecords({
  table: "example-table",
  records: [
    {
      id: "example-id",
      data: {},
    },
  ],
});
```

### Triggers (Experimental)

> ℹ️ **Experimental.** Import from `"@zapier/zapier-sdk/experimental"` to use these methods. Methods and behavior may change.

#### `ackTriggerInboxMessages` 🧪 _experimental_

Acknowledge messages from a lease. Acked messages are removed from the inbox; unacked ones return to the available pool when the lease expires.

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                                                                                |
| -------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox`    | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
| ​ ↳ `lease`    | `string` | ✅       | —       | —               | Lease ID returned from leaseTriggerInboxMessages                                                           |
| ​ ↳ `messages` | `array`  | ❌       | —       | —               | Specific message IDs to ack. Omit to ack every message in the lease.                                       |

**Returns:** `Promise<TriggerInboxAckItem>`

| Name                              | Type       | Required | Possible Values                               | Description              |
| --------------------------------- | ---------- | -------- | --------------------------------------------- | ------------------------ |
| `data`                            | `object`   | ✅       | —                                             |                          |
| ​ ↳ `acked_id`                    | `string`   | ✅       | —                                             |                          |
| ​ ↳ `results[]`                   | `object[]` | ✅       | —                                             |                          |
| ​   ↳ `id`                        | `string`   | ✅       | —                                             |                          |
| ​   ↳ `created_at`                | `string`   | ✅       | —                                             |                          |
| ​   ↳ `status`                    | `string`   | ✅       | `available`, `leased`, `acked`, `quarantined` | Message lifecycle status |
| ​   ↳ `message_attributes`        | `object`   | ✅       | —                                             |                          |
| ​     ↳ `lease_count`             | `number`   | ✅       | —                                             |                          |
| ​     ↳ `error_message`           | `string`   | ✅       | —                                             |                          |
| ​     ↳ `possible_duplicate_data` | `boolean`  | ✅       | —                                             |                          |

**Example:**

```typescript
const result = await zapier.ackTriggerInboxMessages({
  inbox: "example-inbox",
  lease: "example-lease",
});
```

#### `createTriggerInbox` 🧪 _experimental_

Create a new trigger inbox subscription. Always creates a new inbox; use ensureTriggerInbox for get-or-create on a stable name.

**Parameters:**

| Name                  | Type             | Required | Default | Possible Values | Description                                                                                                                      |
| --------------------- | ---------------- | -------- | ------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `options`             | `object`         | ✅       | —       | —               |                                                                                                                                  |
| ​ ↳ `name`            | `string`         | ❌       | —       | —               | Optional inbox name. Auto-generated when omitted. Throws a conflict error if the name is already in use by another subscription. |
| ​ ↳ `app`             | `string`         | ✅       | —       | —               | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')                     |
| ​ ↳ `action`          | `string`         | ✅       | —       | —               | Action key (e.g., 'send_message' or 'find_row')                                                                                  |
| ​ ↳ `connection`      | `string, number` | ❌       | —       | —               | Connection alias or connection ID. Optional for triggers that don't require auth.                                                |
| ​ ↳ `inputs`          | `object`         | ❌       | —       | —               | Input parameters for the trigger subscription                                                                                    |
| ​ ↳ `notificationUrl` | `string`         | ❌       | —       | —               | Webhook URL to POST to when new messages arrive                                                                                  |

**Returns:** `Promise<TriggerInboxItem>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const result = await zapier.createTriggerInbox({
  app: "example-app",
  action: "example-action",
});
```

#### `deleteTriggerInbox` 🧪 _experimental_

Mark a trigger inbox for deletion

**Parameters:**

| Name        | Type     | Required | Default | Possible Values | Description                                                                                                |
| ----------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`   | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox` | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |

**Returns:** `Promise<{ success: boolean }>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const result = await zapier.deleteTriggerInbox({
  inbox: "example-inbox",
});
```

#### `drainTriggerInbox` 🧪 _experimental_

Drain an existing trigger inbox: lease currently-available messages, process each via onMessage, return when the inbox is empty, maxMessages is reached, or the abort signal fires.

**Parameters:**

| Name                  | Type       | Required | Default | Possible Values | Description                                                                                                                                                                                                                 |
| --------------------- | ---------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`             | `object`   | ✅       | —       | —               |                                                                                                                                                                                                                             |
| ​ ↳ `inbox`           | `string`   | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint.                                                                                                                  |
| ​ ↳ `onMessage`       | `function` | ❌       | —       | —               | Per-message handler. Resolves to ack; rejects to release-or-leave per `releaseOnError`. Throw `ZapierReleaseTriggerMessageSignal` to release explicitly, or `ZapierAbortDrainSignal` to stop after the current batch.       |
| ​ ↳ `concurrency`     | `number`   | ❌       | —       | —               | Per-message handler workers running in parallel. Defaults to `leaseLimit`, or 1 if neither is set.                                                                                                                          |
| ​ ↳ `leaseLimit`      | `number`   | ❌       | —       | —               | Per-lease HTTP batch size. Defaults to `concurrency`, or 1 if neither is set.                                                                                                                                               |
| ​ ↳ `leaseSeconds`    | `number`   | ❌       | —       | —               | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes).                                                                                                                 |
| ​ ↳ `releaseOnError`  | `boolean`  | ❌       | —       | —               | If true, errors release the message when the drain finishes. If false (default), errors leave it leased until the lease timeout. `ZapierReleaseTriggerMessageSignal` always releases regardless.                            |
| ​ ↳ `continueOnError` | `boolean`  | ❌       | —       | —               | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via `onError` and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
| ​ ↳ `onError`         | `function` | ❌       | —       | —               | Per-message error observer for `continueOnError: true`. Called with the failure and the message; control-flow signals are filtered out. Throws from `onError` are swallowed.                                                |
| ​ ↳ `signal`          | `any`      | ❌       | —       | —               | Abort signal. Aborting cancels in-flight HTTP, releases unprocessed messages, and resolves cleanly. Errors during shutdown still reject.                                                                                    |
| ​ ↳ `maxMessages`     | `number`   | ❌       | —       | —               | Cap total messages drained. Defaults to draining the inbox until empty.                                                                                                                                                     |

**Returns:** `Promise<void>`

**Example:**

```typescript
const result = await zapier.drainTriggerInbox({
  inbox: "example-inbox",
  onMessage: async (message) => {
    /* process message */
  },
});
```

#### `ensureTriggerInbox` 🧪 _experimental_

Get-or-create a trigger inbox by name. Idempotent on (user, account, name): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the name exists with a different subscription.

**Parameters:**

| Name                  | Type             | Required | Default | Possible Values | Description                                                                                                                                                             |
| --------------------- | ---------------- | -------- | ------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`             | `object`         | ✅       | —       | —               |                                                                                                                                                                         |
| ​ ↳ `name`            | `string`         | ✅       | —       | —               | Inbox name; serves as the idempotency key. Required for ensureTriggerInbox — without one, the API mints a fresh inbox each call (use createTriggerInbox for that path). |
| ​ ↳ `app`             | `string`         | ✅       | —       | —               | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')                                                            |
| ​ ↳ `action`          | `string`         | ✅       | —       | —               | Action key (e.g., 'send_message' or 'find_row')                                                                                                                         |
| ​ ↳ `connection`      | `string, number` | ❌       | —       | —               | Connection alias or connection ID. Optional for triggers that don't require auth.                                                                                       |
| ​ ↳ `inputs`          | `object`         | ❌       | —       | —               | Input parameters for the trigger subscription                                                                                                                           |
| ​ ↳ `notificationUrl` | `string`         | ❌       | —       | —               | Webhook URL to POST to when new messages arrive                                                                                                                         |

**Returns:** `Promise<TriggerInboxItem>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const result = await zapier.ensureTriggerInbox({
  name: "example-name",
  app: "example-app",
  action: "example-action",
});
```

#### `getTriggerInbox` 🧪 _experimental_

Get details of a trigger inbox by ID

**Parameters:**

| Name        | Type     | Required | Default | Possible Values | Description                                                                                                |
| ----------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`   | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox` | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |

**Returns:** `Promise<TriggerInboxItem>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const { data: triggerInbox } = await zapier.getTriggerInbox({
  inbox: "example-inbox",
});
```

#### `getTriggerInputFieldsSchema` 🧪 _experimental_

Get the JSON Schema representation of input fields for a trigger. Returns a JSON Schema object describing the structure, types, and validation rules for the trigger's input parameters.

**Parameters:**

| Name             | Type             | Required | Default | Possible Values | Description                                                                                                  |
| ---------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| `options`        | `object`         | ✅       | —       | —               |                                                                                                              |
| ​ ↳ `app`        | `string`         | ✅       | —       | —               | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for                              |
| ​ ↳ `action`     | `string`         | ✅       | —       | —               | Trigger action key to get the input schema for                                                               |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —               | Connection alias or connection ID. Required if the trigger needs a connection to determine available fields. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —               | Current input values that may affect the schema (e.g., when fields depend on other field values)             |

**Returns:** `Promise<any>`

**Example:**

```typescript
const result = await zapier.getTriggerInputFieldsSchema({
  app: "example-app",
  action: "example-action",
});
```

#### `leaseTriggerInboxMessages` 🧪 _experimental_

Lease up to N messages from a trigger inbox. Returns messages plus a lease ID; ack within the lease window to remove from the inbox.

**Parameters:**

| Name               | Type     | Required | Default | Possible Values | Description                                                                                                        |
| ------------------ | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------ |
| `options`          | `object` | ✅       | —       | —               |                                                                                                                    |
| ​ ↳ `inbox`        | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint.         |
| ​ ↳ `leaseLimit`   | `number` | ❌       | —       | —               | Maximum messages to lease in a single batch (1-100)                                                                |
| ​ ↳ `leaseSeconds` | `number` | ❌       | —       | —               | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes).        |
| ​ ↳ `signal`       | `any`    | ❌       | —       | —               | Abort signal forwarded to the lease HTTP request. Aborting causes the in-flight request to reject with AbortError. |

**Returns:** `Promise<TriggerInboxLeaseItem>`

| Name                              | Type       | Required | Possible Values                                                                                                                                                 | Description                             |
| --------------------------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                            | `object`   | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `lease_id`                    | `string`   | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `leased_until`                | `string`   | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `results[]`                   | `object[]` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `id`                        | `string`   | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `created_at`                | `string`   | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `status`                    | `string`   | ✅       | `available`, `leased`, `acked`, `quarantined`                                                                                                                   | Message lifecycle status                |
| ​   ↳ `message_attributes`        | `object`   | ✅       | —                                                                                                                                                               |                                         |
| ​     ↳ `lease_count`             | `number`   | ✅       | —                                                                                                                                                               |                                         |
| ​     ↳ `error_message`           | `string`   | ✅       | —                                                                                                                                                               |                                         |
| ​     ↳ `possible_duplicate_data` | `boolean`  | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `payload`                   | `object`   | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `inbox_attributes`            | `object`   | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `status`                    | `string`   | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​   ↳ `paused_reason`             | `string`   | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |

**Example:**

```typescript
const result = await zapier.leaseTriggerInboxMessages({
  inbox: "example-inbox",
});
```

#### `listTriggerInboxMessages` 🧪 _experimental_

List messages in a trigger inbox (no payload, status-only)

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                                                                                |
| -------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox`    | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
| ​ ↳ `pageSize` | `number` | ❌       | —       | —               | Number of messages per page                                                                                |
| ​ ↳ `maxItems` | `number` | ❌       | —       | —               | Maximum total items to return across all pages                                                             |
| ​ ↳ `cursor`   | `string` | ❌       | —       | —               | Pagination cursor                                                                                          |

**Returns:** `Promise<PaginatedResult<TriggerMessageItem>>`

| Name                            | Type       | Required | Possible Values                               | Description                                                    |
| ------------------------------- | ---------- | -------- | --------------------------------------------- | -------------------------------------------------------------- |
| `data[]`                        | `object[]` | ✅       | —                                             |                                                                |
| ​ ↳ `id`                        | `string`   | ✅       | —                                             |                                                                |
| ​ ↳ `created_at`                | `string`   | ✅       | —                                             |                                                                |
| ​ ↳ `status`                    | `string`   | ✅       | `available`, `leased`, `acked`, `quarantined` | Message lifecycle status                                       |
| ​ ↳ `message_attributes`        | `object`   | ✅       | —                                             |                                                                |
| ​   ↳ `lease_count`             | `number`   | ✅       | —                                             |                                                                |
| ​   ↳ `error_message`           | `string`   | ✅       | —                                             |                                                                |
| ​   ↳ `possible_duplicate_data` | `boolean`  | ✅       | —                                             |                                                                |
| `nextCursor`                    | `string`   | ❌       | —                                             | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: triggerMessages, nextCursor } =
  await zapier.listTriggerInboxMessages({
    inbox: "example-inbox",
  });

// Or iterate over all pages
for await (const page of zapier.listTriggerInboxMessages({
  inbox: "example-inbox",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const triggerMessage of zapier
  .listTriggerInboxMessages({
    inbox: "example-inbox",
  })
  .items()) {
  // Do something with each triggerMessage
}
```

#### `listTriggerInboxes` 🧪 _experimental_

List all trigger inboxes for the authenticated user

**Parameters:**

| Name           | Type     | Required | Default | Possible Values                                                          | Description                                                                                                  |
| -------------- | -------- | -------- | ------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `options`      | `object` | ✅       | —       | —                                                                        |                                                                                                              |
| ​ ↳ `name`     | `string` | ❌       | —       | —                                                                        | Filter by inbox name (exact match). Names are unique per (user, account), so this returns at most one inbox. |
| ​ ↳ `status`   | `string` | ❌       | —       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure` | Filter by inbox status                                                                                       |
| ​ ↳ `pageSize` | `number` | ❌       | —       | —                                                                        | Number of inboxes per page                                                                                   |
| ​ ↳ `maxItems` | `number` | ❌       | —       | —                                                                        | Maximum total items to return across all pages                                                               |
| ​ ↳ `cursor`   | `string` | ❌       | —       | —                                                                        | Cursor (offset) to start from for pagination                                                                 |

**Returns:** `Promise<PaginatedResult<TriggerInboxItem>>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                                                    |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `data[]`               | `object[]`       | ✅       | —                                                                                                                                                               |                                                                |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                                                |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                                                |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                                                |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                                         |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable                        |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                                                |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                                                |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                                                |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                                                |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                                                |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                                                |
| `nextCursor`           | `string`         | ❌       | —                                                                                                                                                               | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: triggerInboxs, nextCursor } = await zapier.listTriggerInboxes();

// Or iterate over all pages
for await (const page of zapier.listTriggerInboxes()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const triggerInbox of zapier.listTriggerInboxes().items()) {
  // Do something with each triggerInbox
}
```

#### `listTriggerInputFieldChoices` 🧪 _experimental_

Get the available choices for a dynamic dropdown input field on a trigger

**Parameters:**

| Name             | Type             | Required | Default | Possible Values | Description                                                                                                         |
| ---------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `options`        | `object`         | ✅       | —       | —               |                                                                                                                     |
| ​ ↳ `app`        | `string`         | ✅       | —       | —               | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')        |
| ​ ↳ `action`     | `string`         | ✅       | —       | —               | Action key (e.g., 'send_message' or 'find_row')                                                                     |
| ​ ↳ `inputField` | `string`         | ✅       | —       | —               | Input field key to get choices for                                                                                  |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —               | Connection alias or connection ID. Required if the trigger needs a connection to populate dynamic dropdown options. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —               | Current input values that may affect available choices                                                              |
| ​ ↳ `page`       | `number`         | ❌       | —       | —               | Page number for paginated results                                                                                   |
| ​ ↳ `pageSize`   | `number`         | ❌       | —       | —               | Number of choices per page                                                                                          |
| ​ ↳ `maxItems`   | `number`         | ❌       | —       | —               | Maximum total items to return across all pages                                                                      |
| ​ ↳ `cursor`     | `string`         | ❌       | —       | —               | Cursor to start from                                                                                                |

**Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`

| Name         | Type       | Required | Possible Values | Description                                                    |
| ------------ | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`     | `object[]` | ✅       | —               |                                                                |
| ​ ↳ `key`    | `string`   | ❌       | —               |                                                                |
| ​ ↳ `label`  | `string`   | ❌       | —               |                                                                |
| ​ ↳ `sample` | `string`   | ❌       | —               |                                                                |
| ​ ↳ `value`  | `string`   | ❌       | —               |                                                                |
| `nextCursor` | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: inputFieldChoices, nextCursor } =
  await zapier.listTriggerInputFieldChoices({
    app: "example-app",
    action: "example-action",
    inputField: "example-input-field",
  });

// Or iterate over all pages
for await (const page of zapier.listTriggerInputFieldChoices({
  app: "example-app",
  action: "example-action",
  inputField: "example-input-field",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
  .listTriggerInputFieldChoices({
    app: "example-app",
    action: "example-action",
    inputField: "example-input-field",
  })
  .items()) {
  // Do something with each inputFieldChoice
}
```

#### `listTriggerInputFields` 🧪 _experimental_

Get the input fields required for a specific trigger

**Parameters:**

| Name             | Type             | Required | Default | Possible Values | Description                                                                                                  |
| ---------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| `options`        | `object`         | ✅       | —       | —               |                                                                                                              |
| ​ ↳ `app`        | `string`         | ✅       | —       | —               | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
| ​ ↳ `action`     | `string`         | ✅       | —       | —               | Action key (e.g., 'send_message' or 'find_row')                                                              |
| ​ ↳ `connection` | `string, number` | ❌       | —       | —               | Connection alias or connection ID. Required if the trigger needs a connection to determine available fields. |
| ​ ↳ `inputs`     | `object`         | ❌       | —       | —               | Current input values that may affect available fields                                                        |
| ​ ↳ `pageSize`   | `number`         | ❌       | —       | —               | Number of input fields per page                                                                              |
| ​ ↳ `maxItems`   | `number`         | ❌       | —       | —               | Maximum total items to return across all pages                                                               |
| ​ ↳ `cursor`     | `string`         | ❌       | —       | —               | Cursor to start from                                                                                         |

**Returns:** `Promise<PaginatedResult<RootFieldItem>>`

| Name         | Type       | Required | Possible Values | Description                                                    |
| ------------ | ---------- | -------- | --------------- | -------------------------------------------------------------- |
| `data[]`     | `object[]` | ✅       | —               | One of the variants below, distinguished by `type`             |
| `nextCursor` | `string`   | ❌       | —               | Cursor for the next page; omitted when there are no more pages |

**When `type` is `"input_field"`:**

| Name                       | Type      | Required | Possible Values | Description |
| -------------------------- | --------- | -------- | --------------- | ----------- |
| `type`                     | `string`  | ✅       | `input_field`   |             |
| `key`                      | `string`  | ✅       | —               |             |
| `default_value`            | `string`  | ✅       | —               |             |
| `depends_on`               | `array`   | ✅       | —               |             |
| `description`              | `string`  | ✅       | —               |             |
| `invalidates_input_fields` | `boolean` | ✅       | —               |             |
| `is_required`              | `boolean` | ✅       | —               |             |
| `placeholder`              | `string`  | ✅       | —               |             |
| `title`                    | `string`  | ✅       | —               |             |
| `value_type`               | `string`  | ✅       | —               |             |
| `format`                   | `string`  | ❌       | —               |             |
| `items`                    | `object`  | ❌       | —               |             |
| ​ ↳ `type`                 | `string`  | ✅       | —               |             |

**When `type` is `"info_field"`:**

| Name          | Type     | Required | Possible Values | Description |
| ------------- | -------- | -------- | --------------- | ----------- |
| `type`        | `string` | ✅       | `info_field`    |             |
| `key`         | `string` | ✅       | —               |             |
| `description` | `string` | ✅       | —               |             |
| `title`       | `string` | ❌       | —               |             |

**When `type` is `"fieldset"`:**

| Name     | Type     | Required | Possible Values | Description |
| -------- | -------- | -------- | --------------- | ----------- |
| `type`   | `string` | ✅       | `fieldset`      |             |
| `key`    | `string` | ✅       | —               |             |
| `title`  | `string` | ✅       | —               |             |
| `fields` | `array`  | ✅       | —               |             |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: rootFields, nextCursor } = await zapier.listTriggerInputFields({
  app: "example-app",
  action: "example-action",
});

// Or iterate over all pages
for await (const page of zapier.listTriggerInputFields({
  app: "example-app",
  action: "example-action",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const rootField of zapier
  .listTriggerInputFields({
    app: "example-app",
    action: "example-action",
  })
  .items()) {
  // Do something with each rootField
}
```

#### `listTriggers` 🧪 _experimental_

List all triggers for a specific app

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                                             |
| -------------- | -------- | -------- | ------- | --------------- | ----------------------------------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                                         |
| ​ ↳ `app`      | `string` | ✅       | —       | —               | App key of triggers to list (e.g., 'SlackCLIAPI' or slug like 'github') |
| ​ ↳ `pageSize` | `number` | ❌       | —       | —               | Number of triggers per page                                             |
| ​ ↳ `maxItems` | `number` | ❌       | —       | —               | Maximum total items to return across all pages                          |
| ​ ↳ `cursor`   | `string` | ❌       | —       | —               | Cursor to start from                                                    |

**Returns:** `Promise<PaginatedResult<ActionItem>>`

| Name               | Type       | Required | Possible Values                                                                                | Description                                                    |
| ------------------ | ---------- | -------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `data[]`           | `object[]` | ✅       | —                                                                                              |                                                                |
| ​ ↳ `id`           | `string`   | ❌       | —                                                                                              |                                                                |
| ​ ↳ `key`          | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `description`  | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `is_important` | `boolean`  | ❌       | —                                                                                              |                                                                |
| ​ ↳ `is_hidden`    | `boolean`  | ❌       | —                                                                                              |                                                                |
| ​ ↳ `app_key`      | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `app_version`  | `string`   | ❌       | —                                                                                              |                                                                |
| ​ ↳ `action_type`  | `string`   | ✅       | `filter`, `read`, `read_bulk`, `run`, `search`, `search_and_write`, `search_or_write`, `write` |                                                                |
| ​ ↳ `title`        | `string`   | ✅       | —                                                                                              |                                                                |
| ​ ↳ `type`         | `string`   | ✅       | `action`                                                                                       |                                                                |
| `nextCursor`       | `string`   | ❌       | —                                                                                              | Cursor for the next page; omitted when there are no more pages |

**Example:**

```typescript
// Get first page and a cursor for the second page
const { data: actions, nextCursor } = await zapier.listTriggers({
  app: "example-app",
});

// Or iterate over all pages
for await (const page of zapier.listTriggers({
  app: "example-app",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const action of zapier
  .listTriggers({
    app: "example-app",
  })
  .items()) {
  // Do something with each action
}
```

#### `pauseTriggerInbox` 🧪 _experimental_

Pause a trigger inbox; events stop being collected

**Parameters:**

| Name        | Type     | Required | Default | Possible Values | Description                                                                                                |
| ----------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`   | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox` | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |

**Returns:** `Promise<TriggerInboxItem>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const result = await zapier.pauseTriggerInbox({
  inbox: "example-inbox",
});
```

#### `releaseTriggerInboxMessages` 🧪 _experimental_

Release messages from a lease back to the inbox without acknowledging them. Released messages become immediately available for re-leasing. The lease attempt still counts against the per-message lease limit; releasing does not refund the attempt.

**Parameters:**

| Name           | Type     | Required | Default | Possible Values | Description                                                                                                |
| -------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`      | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox`    | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
| ​ ↳ `lease`    | `string` | ✅       | —       | —               | Lease ID returned from leaseTriggerInboxMessages                                                           |
| ​ ↳ `messages` | `array`  | ❌       | —       | —               | Specific message IDs to release. Omit to release every message in the lease.                               |

**Returns:** `Promise<TriggerInboxReleaseItem>`

| Name                              | Type       | Required | Possible Values                               | Description              |
| --------------------------------- | ---------- | -------- | --------------------------------------------- | ------------------------ |
| `data`                            | `object`   | ✅       | —                                             |                          |
| ​ ↳ `released_id`                 | `string`   | ✅       | —                                             |                          |
| ​ ↳ `results[]`                   | `object[]` | ✅       | —                                             |                          |
| ​   ↳ `id`                        | `string`   | ✅       | —                                             |                          |
| ​   ↳ `created_at`                | `string`   | ✅       | —                                             |                          |
| ​   ↳ `status`                    | `string`   | ✅       | `available`, `leased`, `acked`, `quarantined` | Message lifecycle status |
| ​   ↳ `message_attributes`        | `object`   | ✅       | —                                             |                          |
| ​     ↳ `lease_count`             | `number`   | ✅       | —                                             |                          |
| ​     ↳ `error_message`           | `string`   | ✅       | —                                             |                          |
| ​     ↳ `possible_duplicate_data` | `boolean`  | ✅       | —                                             |                          |

**Example:**

```typescript
const result = await zapier.releaseTriggerInboxMessages({
  inbox: "example-inbox",
  lease: "example-lease",
});
```

#### `resumeTriggerInbox` 🧪 _experimental_

Resume a paused trigger inbox; events resume being collected

**Parameters:**

| Name        | Type     | Required | Default | Possible Values | Description                                                                                                |
| ----------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`   | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox` | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |

**Returns:** `Promise<TriggerInboxItem>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const result = await zapier.resumeTriggerInbox({
  inbox: "example-inbox",
});
```

#### `updateTriggerInbox` 🧪 _experimental_

Update settings on an existing trigger inbox

**Parameters:**

| Name                  | Type     | Required | Default | Possible Values | Description                                                                                                |
| --------------------- | -------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------------------------------- |
| `options`             | `object` | ✅       | —       | —               |                                                                                                            |
| ​ ↳ `inbox`           | `string` | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
| ​ ↳ `notificationUrl` | `string` | ❌       | —       | —               | Webhook URL to POST to when new messages arrive. Pass null to clear.                                       |

**Returns:** `Promise<TriggerInboxItem>`

| Name                   | Type             | Required | Possible Values                                                                                                                                                 | Description                             |
| ---------------------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `data`                 | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `id`               | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `created_at`       | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `name`             | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `status`           | `string`         | ✅       | `initializing`, `active`, `paused`, `deleting`, `initialization_failure`                                                                                        | Inbox lifecycle status                  |
| ​ ↳ `paused_reason`    | `string`         | ✅       | `user`, `authentication`, `authentication_access_revoked`, `partner_revoked`, `subscribe_failed`, `migrate_failed`, `abandoned`, `unknown`, `upstream_failures` | Why the inbox was paused, if applicable |
| ​ ↳ `notification_url` | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​ ↳ `subscription`     | `object`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `connection_id`  | `string, number` | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `app_key`        | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `action_key`     | `string`         | ✅       | —                                                                                                                                                               |                                         |
| ​   ↳ `inputs`         | `object`         | ✅       | —                                                                                                                                                               |                                         |

**Example:**

```typescript
const result = await zapier.updateTriggerInbox({
  inbox: "example-inbox",
});
```

#### `watchTriggerInbox` 🧪 _experimental_

Continuously consume a trigger inbox: drain currently-available messages via onMessage, then poll with backoff for new arrivals, until aborted. Resolves cleanly on signal abort or ZapierAbortDrainSignal from a handler; rejects on fatal SDK errors or fail-fast handler errors.

**Parameters:**

| Name                          | Type       | Required | Default | Possible Values | Description                                                                                                                                                                                                                 |
| ----------------------------- | ---------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`                     | `object`   | ✅       | —       | —               |                                                                                                                                                                                                                             |
| ​ ↳ `inbox`                   | `string`   | ✅       | —       | —               | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint.                                                                                                                  |
| ​ ↳ `onMessage`               | `function` | ❌       | —       | —               | Per-message handler. Resolves to ack; rejects to release-or-leave per `releaseOnError`. Throw `ZapierReleaseTriggerMessageSignal` to release explicitly, or `ZapierAbortDrainSignal` to stop after the current batch.       |
| ​ ↳ `concurrency`             | `number`   | ❌       | —       | —               | Per-message handler workers running in parallel. Defaults to `leaseLimit`, or 1 if neither is set.                                                                                                                          |
| ​ ↳ `leaseLimit`              | `number`   | ❌       | —       | —               | Per-lease HTTP batch size. Defaults to `concurrency`, or 1 if neither is set.                                                                                                                                               |
| ​ ↳ `leaseSeconds`            | `number`   | ❌       | —       | —               | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes).                                                                                                                 |
| ​ ↳ `releaseOnError`          | `boolean`  | ❌       | —       | —               | If true, errors release the message when the drain finishes. If false (default), errors leave it leased until the lease timeout. `ZapierReleaseTriggerMessageSignal` always releases regardless.                            |
| ​ ↳ `continueOnError`         | `boolean`  | ❌       | —       | —               | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via `onError` and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
| ​ ↳ `onError`                 | `function` | ❌       | —       | —               | Per-message error observer for `continueOnError: true`. Called with the failure and the message; control-flow signals are filtered out. Throws from `onError` are swallowed.                                                |
| ​ ↳ `signal`                  | `any`      | ❌       | —       | —               | Abort signal. Aborting cancels in-flight HTTP, releases unprocessed messages, and resolves cleanly. Errors during shutdown still reject.                                                                                    |
| ​ ↳ `maxDrainIntervalSeconds` | `number`   | ❌       | —       | —               | Maximum seconds between empty-inbox poll attempts (default: 60). Caps the back-off cadence.                                                                                                                                 |

**Returns:** `Promise<void>`

**Example:**

```typescript
const result = await zapier.watchTriggerInbox({
  inbox: "example-inbox",
  onMessage: async (message) => {
    /* process message */
  },
});
```
