Installation
Initialization
Option 1: CLI Authentication Runningnpx zapier-sdk signup or npx zapier-sdk login authenticates through the CLI. As long as you have the CLI package installed as a development dependency, the SDK will automatically use that authentication.
npx zapier-sdk create-client-credentials. This allows you to run the SDK in a server/serverless environment.
Accounts
Your Zapier user account, the one the SDK is signed in as. Use these to check who that is.getProfile
Get current user’s profile information
Parameters:
Returns:
Promise<ProfileItem>
Example:
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.createActionRun
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.
Parameters:
Returns:
Promise<StartedActionRunItem>
Example:
getAction
Get detailed information about a specific action
Parameters:
Returns:
Promise<ActionItem>
Example:
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:
Returns:
Promise<InputSchemaItem>
Example:
getActionRun
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.
Parameters:
Returns:
Promise<ActionRunItem>
Example:
listActionInputFieldChoices
Get the available choices for a dynamic dropdown input field
Parameters:
Returns:
Promise<PaginatedResult<InputFieldChoiceItem>>
Example:
listActionInputFields
Get the input fields required for a specific action
Parameters:
Returns:
Promise<PaginatedResult<RootFieldItem>>
When
type is "input_field":
When
type is "info_field":
When
type is "fieldset":
Example:
listActions
List all actions for a specific app
Parameters:
Returns:
Promise<PaginatedResult<ActionItem>>
Example:
runAction
Execute an action with the given inputs and wait for its results. Each result page includes the action run ID in meta.id.
Parameters:
Returns:
Promise<PaginatedResult<ActionResultItem>>
Example:
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.apps.{appKey}
Bind a connection alias or numeric connectionId to an app
Parameters:
Returns:
Promise<AppProxy>
Example:
apps.{appKey}.{actionType}.{actionKey}
Execute an action with the given inputs for the bound app, as an alternative to runAction
Parameters:
Returns:
Promise<PaginatedResult<ActionResultItem>>
Example:
getApp
Get detailed information about a specific app
Parameters:
Returns:
Promise<AppItem>
Example:
listApps
List all available apps with optional filtering
Parameters:
Returns:
Promise<PaginatedResult<AppItem>>
Example:
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.createClientCredentials
Create new client credentials for the authenticated user
Parameters:
Returns:
Promise<ClientCredentialsItem>
Example:
deleteClientCredentials
Delete client credentials by client ID
Parameters:
Returns:
Promise<{ success: boolean }>
Example:
listClientCredentials
List client credentials for the authenticated user
Parameters:
Returns:
Promise<PaginatedResult<ClientCredentialsItem>>
Example:
Connections
A connection is an authenticated link between Zapier and your account in an app, like your company’s Slack workspace, made with OAuth or an API key. Use these to find existing connections or create new ones for actions, triggers, and API requests to use.createConnection
Create a new app connection, end-to-end. Mints the start URL via get-connection-start-url, prints it to stderr, opportunistically opens it in a browser when it looks safe to do so (skipping CI / SSH / headless-Linux by default — pass --browser always to force, --browser never to suppress), then polls via wait-for-new-connection until the user completes OAuth and the new connection appears. Returns the connection.
This is the right command for most callers. Reach for the lower-level building blocks when you want either of: (a) hand off the URL and not block on completion — call get-connection-start-url alone, no wait-for-new-connection needed, or (b) do something custom between minting the URL and waiting — call get-connection-start-url, do your work (email or DM the URL, render a QR code, etc.), then wait-for-new-connection.
Parameters:
Returns:
Promise<ConnectionItem>
Example:
findFirstConnection
Find the first connection matching the criteria
Parameters:
Returns:
Promise<ConnectionItem>
Example:
findUniqueConnection
Find a unique connection matching the criteria
Parameters:
Returns:
Promise<ConnectionItem>
Example:
getConnection
Get details for a specific connection
Parameters:
Returns:
Promise<ConnectionItem>
Example:
getConnectionStartUrl
Mint a short-lived URL that begins an SDK-initiated connection flow. The URL is signed by zapier.com and bound to the current user/account — opening it in a different browser session will fail the binding check. Returns the URL as data so the caller decides what to do with it.
Use this directly (rather than the higher-level create-connection) when you want either of: (a) hand off the URL and not block waiting for completion — call this alone, skip wait-for-new-connection entirely, or (b) do something custom between minting the URL and waiting for the connection — call this, then email or DM the URL, render it as a QR code for mobile sign-in, etc., then call wait-for-new-connection. For the common case where you’d just print and poll back-to-back, create-connection is one call.
Pair with wait-for-new-connection to detect completion: pass the startedAt returned here straight through (it’s the server’s mint time, so polling isn’t affected by client clock skew). Example (JS):
Returns:
Promise<ConnectionStartUrlItem>
Example:
listConnections
List available connections with optional filtering
Parameters:
Returns:
Promise<PaginatedResult<ConnectionItem>>
Example:
waitForNewConnection
Wait for a new connection to appear for the given app. Polls the connections list newest-first until the most recent matching row’s date is at or after the started-at timestamp, then returns it. Pair with get-connection-start-url — that mints the URL the user opens, this waits for the resulting connection to land. Errors with a timeout after the configured timeout (default 5 min). Example (JS):
Returns:
Promise<ConnectionItem>
Example:
HTTP Requests
Make authenticated requests to an app’s API through Zapier’s API proxy, using a connection’s credentials so your code never handles tokens or keys. Useful when an app’s actions don’t cover what you need.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:
Returns:
Promise<Response>
Example:
Next Gen Zaps (Beta)
Next Gen Zaps are a new version of Zaps that run on code, which makes them easier for agents and AI tools to understand. Use these to build, test, publish, and run Next Gen Zaps, and to check on their runs.
ℹ️ 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. Import from "@zapier/zapier-sdk/beta" to use these methods.
cancelDurableRun 🧪 beta
Cancel a run-once durable run in initialized or started status. Returns 409 if the run is already terminal.
Parameters:
Returns:
Promise<DurableRunItem>
Example:
createWorkflow 🧪 beta
Create a durable workflow container. Starts disabled with no version; publish a version to add code.
Parameters:
Returns:
Promise<WorkflowItem>
Example:
createWorkflowDraft 🧪 beta
Fork a new draft from the workflow’s current live version (or a blank stub before the first publish)
Parameters:
Returns:
Promise<WorkflowDraftItem>
Example:
deleteWorkflow 🧪 beta
Delete a durable workflow. Throws ZapierNotFoundError if the workflow doesn’t exist; callers wanting idempotency should catch that themselves.
Parameters:
Returns:
Promise<{ data: { id: string } }>
Example:
disableWorkflow 🧪 beta
Disable a durable workflow so it stops accepting triggers
Parameters:
Returns:
Promise<WorkflowItem>
Example:
discardWorkflowDraft 🧪 beta
Discard an open workflow draft (soft delete). The draft’s unpublished edits stop resolving; the published version is untouched.
Parameters:
Returns:
Promise<WorkflowDraftItem>
Example:
enableWorkflow 🧪 beta
Enable a durable workflow so it accepts triggers
Parameters:
Returns:
Promise<WorkflowItem>
Example:
getDurableRun 🧪 beta
Get the full state of a run-once durable run, including its operations journal
Parameters:
Returns:
Promise<DurableRunItem>
Example:
getTriggerRun 🧪 beta
Get the workflow run associated with a deployed workflow’s trigger. Useful immediately after firing a trigger, when you have the trigger ID but not yet the run ID. With waitSeconds, the read also waits for the run to be created and to end or be held.
Parameters:
Returns:
Promise<WorkflowRunItem>
Example:
getWorkflow 🧪 beta
Get a durable workflow with its current version details and trigger claim status
Parameters:
Returns:
Promise<WorkflowItem>
Example:
getWorkflowDraft 🧪 beta
Get full details of a workflow draft including source files
Parameters:
Returns:
Promise<WorkflowDraftItem>
Example:
getWorkflowRun 🧪 beta
Get the current state of a workflow run — a live run of a published workflow version, or a draft run launched via runWorkflowDraft (the kind field says which)
Parameters:
Returns:
Promise<WorkflowRunItem>
When
kind is "live":
When
kind is "draft":
Example:
getWorkflowVersion 🧪 beta
Get full details of a workflow version including source files
Parameters:
Returns:
Promise<WorkflowVersionItem>
Example:
importWorkflow 🧪 beta
Convert an existing Zap into a durable workflow. Transforms the Zap’s latest published version (falling back to its draft only when the Zap has never been published) and puts the resulting source in an open draft. The workflow is created disabled with no published version, so publish the draft to make it live. The original Zap is untouched and keeps running.
Parameters:
Returns:
Promise<ImportWorkflowResponse>
Example:
listDurableRuns 🧪 beta
List run-once durable runs for the authenticated account, newest first
Parameters:
Returns:
Promise<PaginatedResult<DurableRunItem>>
Example:
listWorkflowDrafts 🧪 beta
List drafts for a workflow, most recently edited first (open drafts by default)
Parameters:
Returns:
Promise<PaginatedResult<WorkflowDraftItem>>
Example:
listWorkflowRuns 🧪 beta
List workflow runs for a specific workflow, newest first. Live runs (of published versions) and draft runs share the one list; pass kind to narrow it to one.
Parameters:
Returns:
Promise<PaginatedResult<WorkflowRunItem>>
When
kind is "live":
When
kind is "draft":
Example:
listWorkflowVersions 🧪 beta
List published versions for a workflow, newest first
Parameters:
Returns:
Promise<PaginatedResult<WorkflowVersionItem>>
Example:
listWorkflows 🧪 beta
List all active durable workflows for the authenticated account
Parameters:
Returns:
Promise<PaginatedResult<WorkflowItem>>
Example:
publishWorkflowDraft 🧪 beta
Publish an open draft as a new immutable workflow version. Advances the workflow’s live pointer and discards the draft — publish consumes it, so an open draft always means unpublished work. Continue editing by creating a new draft, which forks from the just-published version.
Parameters:
Returns:
Promise<PublishWorkflowDraftResponse>
Example:
publishWorkflowVersion 🧪 beta
Publish a new version of a durable workflow. Enables the workflow by default.
Parameters:
Returns:
Promise<WorkflowVersionItem>
Example:
releaseDurableRun 🧪 beta
Release a held run so it continues. Deal with the hold’s cause first (the run’s status_reason says what it is, and status_detail adds the detail, such as the id of the authentication to reconnect): a run released while the cause still applies is held again.
Parameters:
Returns:
Promise<{ data: { id: string; outcome: string } }>
Example:
runDurable 🧪 beta
Run a workflow’s complete source-files map as a run-once durable run on code-substrate-runner (no deployed workflow required). Send every file the workflow needs, not only its entry point. Returns the run ID immediately; poll via getDurableRun for terminal status.
Parameters:
Returns:
Promise<DurableRunItem>
Example:
runWorkflow 🧪 beta
Run a published workflow and wait for its result: fires the workflow’s trigger as the authenticated account, then returns the run once it is finished, failed, cancelled or held, with output set when it finished and status_detail saying what to do when it’s held. Waits up to 60 seconds unless waitSeconds says otherwise. A run still going after waitSeconds is returned with its current status; wait on it again with getWorkflowRun and waitSeconds.
Parameters:
Returns:
Promise<WorkflowRunItem>
Example:
runWorkflowDraft 🧪 beta
Launch a draft test run: execute the draft’s current source without publishing it. The draft’s payload is snapshotted onto the run at creation, so later edits (or discarding the draft) never change what the run executed. Draft runs are free (not task-charged) and rate limited per user. Without waitSeconds the run comes back at once, initialized; follow it with getWorkflowRun, or list it via listWorkflowRuns with kind: "draft". With waitSeconds, the run is returned once it ends or is held (or as it stands when the wait runs out), with output set when it finished.
Parameters:
Returns:
Promise<RunWorkflowDraftResponse>
Example:
triggerWorkflow 🧪 beta
Look up a workflow’s trigger URL and fire it manually, as the authenticated account.
Parameters:
Returns:
Promise<WorkflowRunItem>
Example:
updateWorkflow 🧪 beta
Update a durable workflow’s name and/or description
Parameters:
Returns:
Promise<WorkflowItem>
Example:
updateWorkflowDraft 🧪 beta
Update (autosave) an open workflow draft
Parameters:
Returns:
Promise<WorkflowDraftItem>
Example:
validateWorkflow 🧪 beta
Validate durable workflow source without publishing it. Returns source diagnostics; issue kinds are extensible and may be unfamiliar to the client.
Parameters:
Returns:
Promise<WorkflowValidationItem>
Example:
Tables
Tables is Zapier’s database tool for storing and managing data. Use these to manage tables, their fields, and their records.createTable
Create a new table
Parameters:
Returns:
Promise<TableItem>
Example:
createTableFields
Create one or more fields in a table
Parameters:
Returns:
Promise<FieldItem[]>
Example:
createTableRecords
Create one or more records in a table
Parameters:
Returns:
Promise<RecordItem[]>
Example:
deleteTable
Delete a table by its ID
Parameters:
Returns:
Promise<{ success: boolean }>
Example:
deleteTableFields
Delete one or more fields from a table
Parameters:
Returns:
Promise<{ success: boolean }>
Example:
deleteTableRecords
Delete one or more records from a table
Parameters:
Returns:
Promise<{ success: boolean }>
Example:
getTable
Get detailed information about a specific table
Parameters:
Returns:
Promise<TableItem>
Example:
getTableRecord
Get a single record from a table by ID
Parameters:
Returns:
Promise<RecordItem>
Example:
listTableFields
List fields for a table
Parameters:
Returns:
Promise<PaginatedResult<FieldItem>>
Example:
listTableRecords
List records in a table with optional filtering and sorting
Parameters:
Returns:
Promise<PaginatedResult<RecordItem>>
Example:
listTables
List tables available to the authenticated user
Parameters:
Returns:
Promise<PaginatedResult<TableItem>>
Example:
updateTableRecords
Update one or more records in a table
Parameters:
Returns:
Promise<RecordItem[]>
Example:
Triggers
A trigger is an event in an app that starts your automation, like a new email received. Use these to find an app’s triggers and receive their events directly in your code, outside a Zap.ackTriggerInboxMessages
Acknowledge messages from a lease. Acked messages are removed from the inbox; unacked ones return to the available pool when the lease expires.
Parameters:
Returns:
Promise<TriggerInboxAckItem>
Example:
createTriggerInbox
Create a new trigger inbox subscription. Always creates a new inbox; use ensureTriggerInbox for get-or-create on a stable key.
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
deleteTriggerInbox
Mark a trigger inbox for deletion
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
drainTriggerInbox
Drain an existing trigger inbox: lease currently-available messages, process each via onMessage, return when the inbox is empty, maxMessages is reached, or the abort signal fires.
Parameters:
Returns:
Promise<void>
Example:
ensureTriggerInbox
Get-or-create a trigger inbox by key. Idempotent on (user, account, key): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the key exists with a different subscription.
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
getTriggerInbox
Get details of a trigger inbox by ID
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
getTriggerInputFieldsSchema
Get the JSON Schema representation of input fields for a trigger. Returns a JSON Schema object describing the structure, types, and validation rules for the trigger’s input parameters.
Parameters:
Returns:
Promise<any>
Example:
leaseTriggerInboxMessages
Lease up to N messages from a trigger inbox. Returns messages plus a lease ID; ack within the lease window to remove from the inbox.
Parameters:
Returns:
Promise<TriggerInboxLeaseItem>
Example:
listTriggerInboxMessages
List messages in a trigger inbox (no payload, status-only)
Parameters:
Returns:
Promise<PaginatedResult<TriggerMessageItem>>
Example:
listTriggerInboxes
List all trigger inboxes for the authenticated user
Parameters:
Returns:
Promise<PaginatedResult<TriggerInboxItem>>
Example:
listTriggerInputFieldChoices
Get the available choices for a dynamic dropdown input field on a trigger
Parameters:
Returns:
Promise<PaginatedResult<InputFieldChoiceItem>>
Example:
listTriggerInputFields
Get the input fields required for a specific trigger
Parameters:
Returns:
Promise<PaginatedResult<RootFieldItem>>
When
type is "input_field":
When
type is "info_field":
When
type is "fieldset":
Example:
listTriggers
List all triggers for a specific app
Parameters:
Returns:
Promise<PaginatedResult<ActionItem>>
Example:
pauseTriggerInbox
Pause a trigger inbox; events stop being collected
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
releaseTriggerInboxMessages
Release messages from a lease back to the inbox without acknowledging them. Released messages become immediately available for re-leasing. The lease attempt still counts against the per-message lease limit; releasing does not refund the attempt.
Parameters:
Returns:
Promise<TriggerInboxReleaseItem>
Example:
resumeTriggerInbox
Resume a paused trigger inbox; events resume being collected
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
updateTriggerInbox
Update settings on an existing trigger inbox
Parameters:
Returns:
Promise<TriggerInboxItem>
Example:
watchTriggerInbox
Continuously consume a trigger inbox: drain currently-available messages via onMessage, then subscribe to SSE notifications for new arrivals until aborted. A periodic safety drain runs every maxDrainIntervalSeconds (default: 300) to guarantee forward progress if SSE events are missed. Resolves cleanly on signal abort or ZapierAbortDrainSignal from a handler. Transient drain failures (5xx, 429, network blips) retry indefinitely with bounded backoff until they succeed or the watch is aborted; it rejects on a fail-fast handler error, an initialization_failure, or a permanent HTTP error. Real-time wake-up health is reported on stderr: a warning when wake-ups pause and the watch falls back to the safety drain, plus (with debug) transient reconnect notices. Persistent drain failures likewise warn once on stderr while bounded-backoff retries continue.
Parameters:
Returns:
Promise<void>
Example:
Human Inputs (Experimental)
Collect information from people with Zapier Forms. Use these to create a form and share its link to gather responses.
ℹ️ Experimental. Still being designed; may change shape or disappear in any release, without notice. Import from "@zapier/zapier-sdk/experimental" to use these methods.
createForm
Create a Zapier Form from a title and optional fields. Forms publish by default and return a shareable hosted_url; set draft to save without publishing.
Parameters:
Returns:
Promise<FormItem>
Example:
Next Gen Zaps (Experimental)
Next Gen Zaps are a new version of Zaps that run on code, which makes them easier for agents and AI tools to understand. Use these to build, test, publish, and run Next Gen Zaps, and to check on their runs.
ℹ️ Experimental. Still being designed; may change shape or disappear in any release, without notice. Import from "@zapier/zapier-sdk/experimental" to use these methods.
disableAgenticManagement
Stop Agentic Management from working on one workflow. Its settings are kept, not deleted: the modes and auto-approve choice stay on file, so calling enableAgenticManagement later resumes with those settings instead of the defaults.
Parameters:
Returns:
Promise<AgenticManagementDisableResultItem>
Example:
enableAgenticManagement
Put one workflow under Agentic Management. A workflow disabled earlier comes back with the modes and auto-approve choice it had, unless you pass new ones here.
Parameters:
Returns:
Promise<AgenticManagementEnableResultItem>
Example:
getAgenticManagementConfig
Read the Agentic Management config for one workflow.
Parameters:
Returns:
Promise<AgenticManagementConfigItem>
Example:
getAgenticManagementIntent
Read the intent recorded for one workflow version: the plain-language description of what that version of the workflow is meant to do.
Parameters:
Returns:
Promise<AgenticManagementIntentItem>
Example:
updateAgenticManagementConfig
Change the modes a workflow runs, whether fixes are applied without approval, or both. A modes list replaces the whole current set rather than adding to it.
Parameters:
Returns:
Promise<AgenticManagementConfigItem>
Example:
updateAgenticManagementIntent
Record what one workflow version is meant to do. Writing again for the same version replaces the text already stored, so there is no separate create and update.
Parameters:
Returns:
Promise<AgenticManagementIntentItem>
Example:
Virtual File System (Experimental)
The Virtual File System is file storage hosted by Zapier. Use these to read, write, and organize files and folders.
ℹ️ Experimental. Still being designed; may change shape or disappear in any release, without notice. Import from "@zapier/zapier-sdk/experimental" to use these methods.
appendVfsFile
Append content to a file in the Zapier Virtual File System (VFS). Creates the file if it doesn’t exist; missing parent directories are created automatically. Safer than reading the file and rewriting it — appends server-side without a read/write round-trip. Paths are absolute (e.g. /Mine/log.md).
Parameters:
Returns:
Promise<VfsWriteResultItem>
Example:
copyVfsFile
Copy a file to a new path in the Zapier Virtual File System (VFS). Both from and to are absolute file paths (e.g. /Mine/notes.md), not directories.
Parameters:
Returns:
Promise<VfsWriteResultItem>
Example:
createVfsDirectory
Create a directory in the Zapier Virtual File System (VFS). Paths are absolute (e.g. /Mine/notes). Idempotent — safe to call on an existing directory.
Parameters:
Returns:
Promise<VfsMkdirResultItem>
Example:
deleteVfsPath
Delete a file or directory in the Zapier Virtual File System (VFS). Works on either; paths are absolute (e.g. /Mine/notes.md). Deletes are recoverable — contact Zapier support to restore an entry.
Parameters:
Returns:
Promise<VfsDeleteResultItem>
Example:
listVfsDirectory
List one page of a directory’s contents in the Zapier Virtual File System (VFS). Paths are absolute (e.g. /Mine). Pass the previous page’s nextCursor back in cursor to fetch the next page.
Parameters:
Returns:
Promise<PaginatedResult<VfsDirectoryEntryItem>>
Example:
moveVfsPath
Move (rename) a file or directory in the Zapier Virtual File System (VFS). Both from and to are absolute paths (e.g. /Mine/notes.md). Fails if an entry already exists at to — delete or rename it first.
Parameters:
Returns:
Promise<VfsMoveResultItem>
Example:
readVfsFile
Read a file from the Zapier Virtual File System (VFS), the file store behind your context repository. Paths are absolute, e.g. /Mine/notes.md. Returns the content as a UTF-8 string with its size, version, and last-modified time.
Parameters:
Returns:
Promise<VfsFileItem>
Example:
statVfsPath
Inspect metadata for any path (file, directory, shortcut, or stream) in the Zapier Virtual File System (VFS). Paths are absolute (e.g. /Mine/notes.md). Check the type field before reading fields that only exist for certain types.
Parameters:
Returns:
Promise<VfsStatItem>
Example:
writeVfsFile
Write (create or overwrite) a file in the Zapier Virtual File System (VFS). Paths are absolute (e.g. /Mine/notes.md); missing parent directories are created automatically.
Parameters:
Returns:
Promise<VfsWriteResultItem>
Example: