npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zapier/zapier-sdk

v0.39.1

Published

Complete Zapier SDK - combines all Zapier SDK packages

Readme

@zapier/zapier-sdk

Table of Contents

Closed Beta

At the time of publishing this package, the Zapier SDK requires an invite for most features. If you want to try it out, let us know at the following page!

https://sdk-beta.zapier.app/signup

Documentation

The official documentation will soon be available at:

https://docs.zapier.com/sdk

While the dust settles, that documentation may be incomplete, and this README may have additional documentation.

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:

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

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.

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

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

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({ appKey: "slack" });

console.log({
  app,
});

// ######## Connection Usage ########
const { data: myConnections } = await zapier.listConnections({
  appKey: "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({ appKey: "slack" });

console.log({
  actions,
});

const singleAction = await zapier.getAction({
  appKey: "slack",
  actionType: actions[0].action_type,
  actionKey: 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({
  appKey: "slack",
  actionType: "read",
  actionKey: "channels",
  connectionId: 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({
  connectionId: 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,
  },
  connectionId: 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", {
  connectionId: 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). | | 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 a connectionId, 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:

const zapier = createZapierSdk({
  manifest: {
    apps: { slack: { implementationName: "SlackCLIAPI", version: "1.21.1" } },
    connections: {
      slack_work: { connectionId: 12345 },
      google_sheets: { connectionId: 67890 },
    },
  },
});

Each connection entry maps a name to a connectionId. App version resolution is handled separately via the apps section of .zapierrc.

Using named connections

Reference connections by alias using the connection parameter. String values are resolved from the connections map; numeric values are used directly as a connectionId.

// 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({
  appKey: "slack",
  actionType: "read",
  actionKey: "channels",
  connection: "slack_work",
});

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

// Direct connectionId also works
await zapier.apps.slack.read.channels({ connection: 12345 });

connection and connectionId are mutually exclusive in the same call. You can still use connectionId directly if you prefer.

Available Functions

Accounts

getProfile

Get current user's profile information

Parameters:

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

Returns: Promise<ProfileItem>

Example:

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 | ✅ | — | — | | | ↳ appKey | string | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ actionType | string | ✅ | — | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type | | ↳ actionKey | string | ✅ | — | — | Action key to execute |

Returns: Promise<ActionItem>

Example:

const { data: action } = await zapier.getAction({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

getInputFieldsSchema

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 | ✅ | — | — | | | ↳ appKey | 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 | | ↳ actionKey | string | ✅ | — | — | Action key to get the input schema for | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use when fetching the schema. Required if the action 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<InputSchemaItem>

Example:

const { data: inputSchema } = await zapier.getInputFieldsSchema({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

listActions

List all actions for a specific app

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | | options | object | ✅ | — | — | | | ↳ appKey | 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>>

Example:

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

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

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

listInputFieldChoices

Get the available choices for a dynamic dropdown input field

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ----------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | options | object | ✅ | — | — | | | ↳ appKey | string | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ actionType | string | ✅ | — | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type | | ↳ actionKey | string | ✅ | — | — | Action key to execute | | ↳ inputFieldKey | string | ✅ | — | — | Input field key to get choices for. | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use when listing available field choices. Required if the action 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>>

Example:

// Get first page and a cursor for the second page
const { data: inputFieldChoices, nextCursor } =
  await zapier.listInputFieldChoices({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
    inputFieldKey: "example-key",
  });

// Or iterate over all pages
for await (const page of zapier.listInputFieldChoices({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
  inputFieldKey: "example-key",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
  .listInputFieldChoices({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
    inputFieldKey: "example-key",
  })
  .items()) {
  // Do something with each inputFieldChoice
}

listInputFields

Get the input fields required for a specific action

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | options | object | ✅ | — | — | | | ↳ appKey | string | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ actionType | string | ✅ | — | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type | | ↳ actionKey | string | ✅ | — | — | Action key to execute | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use when listing input fields. Required if the action 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<RootFieldItemItem>>

Example:

// Get first page and a cursor for the second page
const { data: rootFieldItems, nextCursor } = await zapier.listInputFields({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

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

// Or iterate over individual items across all pages
for await (const rootFieldItem of zapier
  .listInputFields({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
  })
  .items()) {
  // Do something with each rootFieldItem
}

runAction

Execute an action with the given inputs

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | options | object | ✅ | — | — | | | ↳ appKey | string | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ actionType | string | ✅ | — | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type | | ↳ actionKey | string | ✅ | — | — | Action key to execute | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service. | | ↳ connection | string, number | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used 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:

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

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

// Or iterate over individual items across all pages
for await (const actionResult of zapier
  .runAction({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
  })
  .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 | ✅ | — | — | | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use for this action | | ↳ connection | string, number | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. |

Returns: Promise<AppProxy>

Example:

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 | ❌ | — | — | | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use for this action | | ↳ connection | string, number | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. | | ↳ timeoutMs | number | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |

Returns: Promise<PaginatedResult<ActionResultItem>>

Example:

// 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 | ✅ | — | — | | | ↳ appKey | string | ✅ | — | — | App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github') |

Returns: Promise<AppItem>

Example:

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

listApps

List all available apps with optional filtering

Parameters:

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

Returns: Promise<PaginatedResult<AppItem>>

Example:

// 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<any>

Example:

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

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<any>

Example:

const result = await zapier.deleteClientCredentials({
  clientId: "example-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>>

Example:

// 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 | | ↳ appKey | string | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ accountId | string | ❌ | — | — | Account ID 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. | | ↳ isExpired | boolean | ❌ | — | — | Filter by expired status |

Returns: Promise<ConnectionItem>

Example:

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 | | ↳ appKey | string | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ accountId | string | ❌ | — | — | Account ID 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. | | ↳ isExpired | boolean | ❌ | — | — | Filter by expired status |

Returns: Promise<ConnectionItem>

Example:

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

getConnection

Execute getConnection

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ---------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------ | | options | object | ✅ | — | — | | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use for this action |

Returns: Promise<ConnectionItem>

Example:

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 | | ↳ appKey | string | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') | | ↳ connectionIds | array | ❌ | — | — | List of connection IDs to filter by | | ↳ accountId | string | ❌ | — | — | Account ID 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. | | ↳ isExpired | boolean | ❌ | — | — | Filter by expired status | | ↳ 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>>

Example:

// 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 | | ↳ connectionId | string, number | ❌ | — | — | Connection ID to use for this action | | ↳ connection | string, number | ❌ | — | — | Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. | | ↳ callbackUrl | string | ❌ | — | — | URL to send async response to (makes request async) |

Returns: Promise<Response>

Example:

const result = await zapier.fetch("example-value", { key: "value" });

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<any>

Example:

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

createTableFields

Create one or more fields in a table

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ----------- | -------- | -------- | ------- | --------------- | ------------------------------------ | | options | object | ✅ | — | — | | | ↳ tableId | string | ✅ | — | — | The unique identifier of the table | | ↳ fields | array | ✅ | — | — | Array of field definitions to create |

Returns: Promise<any>

Example:

const result = await zapier.createTableFields({
  tableId: "example-id",
  fields: ["example-item"],
});

createTableRecords

Create one or more records in a table

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ----------- | -------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- | | options | object | ✅ | — | — | | | ↳ tableId | string | ✅ | — | — | The unique identifier of the table | | ↳ records | array | ✅ | — | — | Array of records to create (max 100) | | ↳ 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<any>

Example:

const result = await zapier.createTableRecords({
  tableId: "example-id",
  records: ["example-item"],
});

deleteTable

Delete a table by its ID

Parameters:

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

Returns: Promise<any>

Example:

const result = await zapier.deleteTable({
  tableId: "example-id",
});

deleteTableFields

Delete one or more fields from a table

Parameters:

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

Returns: Promise<any>

Example:

const result = await zapier.deleteTableFields({
  tableId: "example-id",
  fieldKeys: ["example-item"],
});

deleteTableRecords

Delete one or more records from a table

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ------------- | -------- | -------- | ------- | --------------- | --------------------------------------- | | options | object | ✅ | — | — | | | ↳ tableId | string | ✅ | — | — | The unique identifier of the table | | ↳ recordIds | array | ✅ | — | — | Array of record IDs to delete (max 100) |

Returns: Promise<any>

Example:

const result = await zapier.deleteTableRecords({
  tableId: "example-id",
  recordIds: ["example-item"],
});

getTable

Get detailed information about a specific table

Parameters:

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

Returns: Promise<TableItem>

Example:

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

getTableRecord

Get a single record from a table by ID

Parameters:

| Name | Type | Required | Default | Possible Values | Description | | ------------ | -------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- | | options | object | ✅ | — | — | | | ↳ tableId | string | ✅ | — | — | The unique identifier of the table | | ↳ recordId | 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>

Example:

const { data: record } = await zapier.getTableRecord({
  tableId: "example-id",
  recordId: "example-id",
});

listTableFields

List fields for a table

Parameters:

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