@zapier/zapier-sdk-cli
Table of Contents
- Stability
- Quick Start
- Installation
- Walkthrough
- Global Options
- Available Commands
- Accounts
- Actions
- Apps
- Client Credentials
- Connections
- HTTP Requests
- Human Inputs (Experimental)
- Next Gen Zaps (Beta)
cancel-durable-runcreate-workflowcreate-workflow-draftdelete-workflowdisable-workflowdiscard-workflow-draftenable-workflowget-durable-runget-trigger-runget-workflowget-workflow-draftget-workflow-runget-workflow-versionimport-workflowlist-durable-runslist-workflow-draftslist-workflow-runslist-workflow-versionslist-workflowspublish-workflow-draftpublish-workflow-versionrun-durablerun-workflowrun-workflow-drafttrigger-workflowupdate-workflowupdate-workflow-draftvalidate-workflow
- Next Gen Zaps (Experimental)
- Tables
- Triggers
ack-trigger-inbox-messagescreate-trigger-inboxdelete-trigger-inboxdrain-trigger-inboxensure-trigger-inboxget-trigger-inboxget-trigger-input-fields-schemalease-trigger-inbox-messageslist-trigger-inbox-messageslist-trigger-inboxeslist-trigger-input-field-choiceslist-trigger-input-fieldslist-triggerspause-trigger-inboxrelease-trigger-inbox-messagesresume-trigger-inboxupdate-trigger-inboxwatch-trigger-inbox
- Utilities
- Virtual File System (Experimental)
Stability
Every command belongs to one of three stability tiers. Stable commands are available by default; opt into wider tiers with --stability beta / --stability experimental, or ZAPIER_STABILITY=<level> in the environment.
| Tier | Contract |
|---|---|
| Stable | The surface we intend to keep. While the SDK is in Open Beta (0.x), a breaking change can still land in a minor release; we deprecate first where we can, and every one is called out in the changelog with a migration note. |
| Beta | Functionally complete and ready to build against, but the shape may still change as it settles. Changes land in minor releases with a changelog migration note, without a deprecation period. |
| Experimental | Still being designed; may change shape or disappear in any release, without notice. |
Non-stable commands are labeled in --help and print a ⚠️ BETA COMMAND / ⚠️ EXPERIMENTAL COMMAND notice when they run.
Quick Start
For new projects.
Bootstrap a new project with everything you need to start integrating thousands of apps through Zapier:
# 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-interactive
Installation
For existing projects.
Run the guided setup to add undeclared Zapier SDK dependencies, authenticate, and inspect your connected apps:
npx @zapier/zapier-sdk-cli setup
For an AI agent or another non-interactive caller, start stepwise setup:
npx @zapier/zapier-sdk-cli setup --agent
Ask the printed wizard question verbatim. After approval, run the exact
setup --step <name> --non-interactive command. Use --answer for selections or
text input. On success, follow the next step's guidance printed by the command;
no extra --agent call is needed.
The agent owns approval and progress; setup saves neither.
On completion, the current agent receives instructions to suggest ideas from
connected apps instead of being asked which agent to open.
Stay in the stated directory. Export shared SDK settings so later commands and generated scripts inherit them. Global CLI flags apply only to their invocation. Setup uses normal SDK credential and pending OAuth storage; a pending OAuth flow started by setup records that saved accounts must be kept. Local authorization finishes in the browser. Headless authorization asks the user to paste the final callback URL; pass it only to the printed command and do not save it. Never repeat a command whose outcome is unknown, especially a Slack send.
Printed commands pin the CLI version and use POSIX shell syntax. Agent mode uses
plain text, not --json, and never reads terminal input. Ordinary setup
requires a terminal and points other callers to --agent.
If you already have a project and want to add the CLI as a dependency:
npm install -D @zapier/zapier-sdk-cli
Walkthrough
# 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 curl "https://gmail.googleapis.com/gmail/v1/users/me/labels" --connection 123
Global Options
These options are available for all commands:
| Option | Short | Description |
|---|---|---|
--version | -V | Display version number |
--help | -h | Display help for command |
--stability <level> | Which stability tier of the SDK / CLI surface to use: stable, beta, experimental. Can also be set with the ZAPIER_STABILITY environment variable (default: stable). | |
--credentials <token> | Authentication token. | |
--credentials-client-id <id> | OAuth client ID for authentication. | |
--credentials-client-secret <secret> | OAuth client secret for authentication. | |
--credentials-base-url <url> | Override authentication base URL. | |
--debug | Enable debug logging. | |
--base-url <url> | Base URL for Zapier API endpoints. | |
--tracking-base-url <url> | Base URL for Zapier tracking endpoints. | |
--max-network-retries <count> | Max retries for rate-limited and server-error responses (default: 3). | |
--max-network-retry-delay-seconds <seconds> | Max delay in seconds to wait between network retries (default: 60). | |
--max-concurrent-requests <count> | Max concurrent in-flight HTTP requests (default: 200, max: 10000). | |
--approval-timeout-seconds <seconds> | Timeout in seconds for approval polling. Default: 600 (10 min). | |
--max-approval-retries | Maximum number of sequential approval rounds per request (one per gating policy) before giving up. Default: 2. | |
--approval-mode | Approval flow behavior for manual approvals. "poll" creates the approval, opens it in a browser, polls until resolved, and retries the original request. "throw" creates the manual approval and throws a ZapierApprovalError with the approval URL so the caller can surface it. Server-created auto-mode approvals always poll until they reach a terminal status and retry the original request on approval, even when this option is "throw". "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). | |
--open-auto-mode-approvals-in-browser | By default, auto-mode approvals do not open in a browser. Enable this option to open the approval URL and watch the approval process. Resolution order is: explicit option, then ZAPIER_OPEN_AUTO_MODE_APPROVALS_IN_BROWSER, then false. | |
--correlation-id <id> | Correlation ID for request tracing. When set, emitted as the zapier-correlation-id header on every outbound request. Falls back to the ZAPIER_CORRELATION_ID environment variable. | |
--causation-id <id> | Causation ID for request tracing. When set, emitted as the zapier-causation-id header on every outbound request. Falls back to the ZAPIER_CAUSATION_ID environment variable. | |
--can-include-shared-connections | Allow listing shared connections. | |
--can-include-shared-tables | Allow listing shared tables. | |
--can-delete-tables | Allow deleting tables. | |
--json | Output raw JSON instead of formatted results |
Available Commands
The CLI automatically generates commands from the SDK registry. All SDK functions are available as CLI commands using kebab-case naming.
Boolean flags are presence toggles and take no value: pass --flag to enable it, or omit the flag to use the default. Flags where disabling differs from omitting document a separate disable flag (e.g. --disabled). A value after a boolean flag (--flag false) is rejected as an extra argument.
Accounts
Your Zapier user account, the one the SDK is signed in as. Use these to check who that is.
get-profile
Get current user's profile information
Usage:
npx zapier-sdk get-profile
login
Log in to Zapier to access your account
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
--name | string | ❌ | — | — | Activate stored credentials with this name. If none exist, create new credentials with this name; interactive login asks for confirmation first. |
--timeout | string | ❌ | — | — | Login timeout in seconds (default: 300) |
--use-approvals | boolean | ❌ | — | — | Require approvals for actions performed with these credentials |
--non-interactive | boolean | ❌ | — | — | Skip interactive prompts. Uses defaults where possible; errors instead of prompting when input is required. Useful in CI, piped output, or environments where TTY detection is unreliable. |
--headless | boolean | ❌ | — | — | Use when logging in from a machine that has no browser. Prints a login link to open elsewhere, then accepts the pasted loopback callback URL. |
--callback-url | string | ❌ | — | — | Resume a pending non-interactive login with the final OAuth callback URL from your browser. |
Usage:
npx zapier-sdk login [--name] [--timeout] [--use-approvals] [--non-interactive] [--headless] [--callback-url]
logout
Log out of your Zapier account
Usage:
npx zapier-sdk logout
signup
Set up Zapier account access and SDK credentials
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
--timeout | string | ❌ | — | — | Signup timeout in seconds (default: 300) |
--use-approvals | boolean | ❌ | — | — | Require approvals for actions performed with these credentials |
--non-interactive | boolean | ❌ | — | — | Skip interactive prompts. Uses defaults where possible; errors instead of prompting when input is required. Useful in CI, piped output, or environments where TTY detection is unreliable. |
--headless | boolean | ❌ | — | — | Use when signing up from a machine that has no browser. Prints a signup link to open elsewhere, then accepts the pasted loopback callback URL. |
--callback-url | string | ❌ | — | — | Resume a pending non-interactive signup with the final OAuth callback URL from your browser. |
Usage:
npx zapier-sdk signup [--timeout] [--use-approvals] [--non-interactive] [--headless] [--callback-url]
Actions
An action is something an app can do, like sending an email or creating a contact. Use these to find an app's actions, see what inputs they need, and run them directly, outside a Zap.
create-action-run
Start an action run and return its ID without waiting for the result. Running an action is asynchronous: this hands back a run ID immediately, and getActionRun fetches the outcome. Reach for this pair when you want to start work and collect it later (fan out many runs, hand the ID to another process, survive a restart). runAction is the one-call form that starts a run and waits for its result.
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., '[email protected]') |
<action-type> | 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). Required if the action needs a connection to authenticate and interact with the service. Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
--inputs | object | ❌ | — | — | Input parameters for the action |
--page | string | ❌ | — | — | Page to fetch for bulk read actions. Pass the next_page a previous run returned to fetch the following page. |
--callback-url | string | ❌ | — | — | URL Zapier posts the finished run to, so you do not have to poll for it. Must use HTTPS and resolve to a public host, so a local receiver needs a tunnel. The body matches what getActionRun returns. Verify the Zapier-Callback-Signature header, and expect the same run to arrive more than once. |
--idempotency-key | string | ❌ | — | — | Key that makes retrying a run safe. Another run with the same key within 72 hours returns the original run instead of starting a new one, even if its inputs differ, so use a fresh key per distinct run. A paged run is sent with a key derived from this key and the page, so one key covers every page and retrying a page replays that page's run. |
Usage:
npx zapier-sdk create-action-run <app> <action-type> <action> [--connection] [--inputs] [--page] [--callback-url] [--idempotency-key]
get-action
Get detailed information about a specific action
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., '[email protected]') |
<action-type> | 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') |
Usage:
npx zapier-sdk get-action <app> <action-type> <action>
get-action-input-fields-schema
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.
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
<action-type> | 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) |
Usage:
npx zapier-sdk get-action-input-fields-schema <app> <action-type> <action> [--connection] [--inputs]
get-action-run
Fetch the current state of an action run started by createActionRun. This is a point-in-time read that returns immediately: a run Zapier has not finished executing comes back with status waiting, so call again to check for a result. runAction starts a run and waits for its result in one call. Results are stored for seven days after the run was created.
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<run> | string | ✅ | — | — | Action run ID returned by createActionRun |
Usage:
npx zapier-sdk get-action-run <run>
list-action-input-field-choices
Get the available choices for a dynamic dropdown input field
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., '[email protected]') |
<action-type> | 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') |
<input-field> | 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 |
--page-size | number | ❌ | — | — | Number of choices per page |
--max-items | number | ❌ | — | — | Maximum total items to return across all pages |
--cursor | string | ❌ | — | — | Cursor to start from |
Usage:
npx zapier-sdk list-action-input-field-choices <app> <action-type> <action> <input-field> [--connection] [--inputs] [--page] [--page-size] [--max-items] [--cursor]
list-action-input-fields
Get the input fields required for a specific action
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., '[email protected]') |
<action-type> | 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 |
--page-size | number | ❌ | — | — | Number of input fields per page |
--max-items | number | ❌ | — | — | Maximum total items to return across all pages |
--cursor | string | ❌ | — | — | Cursor to start from |
Usage:
npx zapier-sdk list-action-input-fields <app> <action-type> <action> [--connection] [--inputs] [--page-size] [--max-items] [--cursor]
list-actions
List all actions for a specific app
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github') |
--action-type | string | ❌ | — | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Filter actions by type |
--page-size | number | ❌ | — | — | Number of actions per page |
--max-items | number | ❌ | — | — | Maximum total items to return across all pages |
--cursor | string | ❌ | — | — | Cursor to start from |
Usage:
npx zapier-sdk list-actions <app> [--action-type] [--page-size] [--max-items] [--cursor]
run-action
Execute an action with the given inputs and wait for its results. Each result page includes the action run ID in meta.id.
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., '[email protected]') |
<action-type> | 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 |
--timeout-seconds | number | ❌ | — | — | Maximum time to wait for action completion in seconds (default: 180) |
--idempotency-key | string | ❌ | — | — | Key that makes retrying a run safe. Another run with the same key within 72 hours returns the original run instead of starting a new one, even if its inputs differ, so use a fresh key per distinct run. A paged run is sent with a key derived from this key and the page, so one key covers every page and retrying a page replays that page's run. |
--page-size | number | ❌ | — | — | Number of results per page |
--max-items | number | ❌ | — | — | Maximum total items to return across all pages |
--cursor | string | ❌ | — | — | Cursor to start from |
Usage:
npx zapier-sdk run-action <app> <action-type> <action> [--connection] [--inputs] [--timeout-seconds] [--idempotency-key] [--page-size] [--max-items] [--cursor]
Apps
An app is a web service that connects with Zapier, like Gmail or Slack. Use these to find apps and the keys other methods use to refer to them.
get-app
Get detailed information about a specific app
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
<app> | string | ✅ | — | — | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., '[email protected]') |
Usage:
npx zapier-sdk get-app <app>
list-apps
List all available apps with optional filtering
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
--search | string | ❌ | — | — | Search term to filter apps by name |
--page-size | number | ❌ | — | — | Number of apps per page. The upstream API may cap this and reject values above its limit. |
--apps | array | ❌ | — | — | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
--max-items | number | ❌ | — | — | Maximum total items to return across all pages |
--cursor | string | ❌ | — | — | Cursor to start from |
Usage:
npx zapier-sdk list-apps [--search] [--page-size] [--apps] [--max-items] [--cursor]
Client Credentials
SDK client credentials are a client ID and client secret that authenticate your code to the Zapier SDK, separate from the connections that authenticate apps. Use these to create, list, and revoke them.
create-client-credentials
Create new client credentials for the authenticated user
Options:
| Option | Type | Required | Default | Possible Values | Description |
|---|---|---|---|---|---|
| `< |