@zapier/zapier-sdk
v0.68.1
Published
Complete Zapier SDK - combines all Zapier SDK packages
Downloads
80,901
Maintainers
Readme
@zapier/zapier-sdk
Table of Contents
- Documentation
- Quick Start
- Installation
- Walkthrough
- Factory
- Available Functions
- Accounts
- Actions
- Apps
- Client Credentials
- Code Workflows (Experimental)
- Connections
- HTTP Requests
- Tables
- Triggers (Experimental)
ackTriggerInboxMessagescreateTriggerInboxdeleteTriggerInboxdrainTriggerInboxensureTriggerInboxgetTriggerInboxgetTriggerInputFieldsSchemaleaseTriggerInboxMessageslistTriggerInboxMessageslistTriggerInboxeslistTriggerInputFieldChoiceslistTriggerInputFieldslistTriggerspauseTriggerInboxreleaseTriggerInboxMessagesresumeTriggerInboxupdateTriggerInboxwatchTriggerInbox
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:
# 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 --non-interactiveInstallation
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 typescriptWalkthrough
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 123The 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 ./typesNow 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({ 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:
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.
// 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:
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., '[email protected]') |
| ↳ 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:
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:
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., '[email protected]') |
| ↳ 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:
// 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., '[email protected]') |
| ↳ 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:
// 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:
// 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., '[email protected]') |
| ↳ 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:
// 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:
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:
// 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., '[email protected]') |
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
