Installation
Initialization
Option 1: Browser-based auth Runningnpx 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.
npx zapier-sdk create-client-credentials. This allows you to run the SDK in a server/serverless environment.
Accounts
getProfile
Get current user’s profile information
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | No |
Promise<ProfileItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ first_name | string | Yes | |
↳ last_name | string | Yes | |
↳ full_name | string | Yes | |
↳ email | string | Yes | |
↳ email_confirmed | boolean | Yes | |
↳ timezone | string | Yes |
Actions
getAction
Get detailed information about a specific action
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
Promise<ActionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | No | |
↳ key | string | Yes | |
↳ description | string | Yes | |
↳ is_important | boolean | No | |
↳ is_hidden | boolean | No | |
↳ app_key | string | Yes | |
↳ app_version | string | No | |
↳ action_type | string | Yes | |
↳ title | string | Yes | |
↳ type | string | Yes |
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 | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) to get the input schema for |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ action | string | Yes | Action key to get the input schema for |
↳ connection | string, number | No | 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 | No | Current input values that may affect the schema (e.g., when fields depend on other field values) |
Promise<InputSchemaItem>
Example:
listActionInputFieldChoices
Get the available choices for a dynamic dropdown input field
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ inputField | string | Yes | Input field key to get choices for |
↳ connection | string, number | No | 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 | No | Current input values that may affect available choices |
↳ page | number | No | Page number for paginated results |
↳ pageSize | number | No | Number of choices per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<InputFieldChoiceItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ key | string | No | |
↳ label | string | No | |
↳ sample | string | No | |
↳ value | string | No | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listActionInputFields
Get the input fields required for a specific action
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ connection | string, number | No | 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 | No | Current input values that may affect available fields |
↳ pageSize | number | No | Number of input fields per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<RootFieldItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | One of the variants below, distinguished by type |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
type is "input_field":
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
key | string | Yes | |
default_value | string | Yes | |
depends_on | array | Yes | |
description | string | Yes | |
invalidates_input_fields | boolean | Yes | |
is_required | boolean | Yes | |
placeholder | string | Yes | |
title | string | Yes | |
value_type | string | Yes | |
format | string | No | |
items | object | No | |
↳ type | string | Yes |
type is "info_field":
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
key | string | Yes | |
description | string | Yes | |
title | string | No |
type is "fieldset":
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
key | string | Yes | |
title | string | Yes | |
fields | array | Yes |
listActions
List all actions for a specific app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App key of actions to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ actionType | string | No | Filter actions by type |
↳ pageSize | number | No | Number of actions per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ActionItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | No | |
↳ key | string | Yes | |
↳ description | string | Yes | |
↳ is_important | boolean | No | |
↳ is_hidden | boolean | No | |
↳ app_key | string | Yes | |
↳ app_version | string | No | |
↳ action_type | string | Yes | |
↳ title | string | Yes | |
↳ type | string | Yes | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
runAction
Execute an action with the given inputs
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ connection | string, number | No | 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 | No | Input parameters for the action |
↳ timeoutMs | number | No | Maximum time to wait for action completion in milliseconds (default: 180000) |
↳ pageSize | number | No | Number of results per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ActionResultItem>>
Example:
Apps
apps.{appKey}
Bind a connection alias or numeric connectionId to an app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ connection | string, number | No | 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. |
Promise<AppProxy>
Example:
apps.{appKey}.{actionType}.{actionKey}
Execute an action with the given inputs for the bound app, as an alternative to runAction
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inputs | object | No | |
↳ connection | string, number | No | 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 | No | Maximum time to wait for action completion in milliseconds (default: 180000) |
Promise<PaginatedResult<ActionResultItem>>
Example:
getApp
Get detailed information about a specific app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
Promise<AppItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ slug | string | Yes | URL-friendly slug identifier |
↳ age_in_days | number | No | Number of days since the implementation was created |
↳ auth_type | string | No | Authentication type (e.g., oauth2, api_key) |
↳ banner | string | No | Banner message or status indicator |
↳ categories[] | object[] | No | Categories the implementation belongs to |
↳ id | number | Yes | Unique identifier for the category |
↳ name | string | Yes | Display name of the category |
↳ slug | string | Yes | URL-friendly slug for the category |
↳ images | object | No | Icon images at various sizes |
↳ url_16x16 | string | No | 16x16 pixel icon URL |
↳ url_32x32 | string | No | 32x32 pixel icon URL |
↳ url_64x64 | string | No | 64x64 pixel icon URL |
↳ url_128x128 | string | No | 128x128 pixel icon URL |
↳ popularity | number | No | Popularity score for ranking apps |
↳ has_filters | boolean | No | Whether the app has filter actions |
↳ has_reads | boolean | No | Whether the app has read actions |
↳ has_searches | boolean | No | Whether the app has search actions |
↳ has_searches_or_writes | boolean | No | Whether the app has search or write actions |
↳ has_upfront_fields | boolean | No | Whether the app has upfront input fields |
↳ has_writes | boolean | No | Whether the app has write actions |
↳ is_beta | boolean | No | Whether the app is in beta |
↳ is_built_in | boolean | No | Whether the app is a built-in Zapier app |
↳ is_deprecated | boolean | No | Whether the app is deprecated |
↳ is_featured | boolean | No | Whether the app is featured |
↳ is_hidden | boolean | No | Whether the app is hidden from listings |
↳ is_invite | boolean | No | Whether the app is invite-only |
↳ is_premium | boolean | No | Whether the app requires a premium plan |
↳ is_public | boolean | No | Whether the app is publicly available |
↳ is_upcoming | boolean | No | Whether the app is upcoming/not yet released |
↳ version | string | No | App version |
↳ visibility | string | No | Visibility status (e.g., public, private) |
↳ actions | object | No | Count of available actions by type |
↳ read | number | No | Number of read actions |
↳ read_bulk | number | No | Number of bulk read actions |
↳ write | number | No | Number of write actions |
↳ search | number | No | Number of search actions |
↳ search_or_write | number | No | Number of search-or-write actions |
↳ search_and_write | number | No | Number of search-and-write actions |
↳ filter | number | No | Number of filter actions |
↳ description | string | No | Description of the app |
↳ primary_color | string | No | Primary brand color (hex) |
↳ secondary_color | string | No | Secondary brand color (hex) |
↳ classification | string | No | App classification category |
↳ api_docs_url | string | No | URL to API documentation |
↳ image | string | No | Default image URL for the app |
↳ title | string | Yes | Display name of the app |
↳ key | string | Yes | App key (versionless implementation name) |
↳ implementation_id | string | Yes | Full implementation ID including version |
listApps
List all available apps with optional filtering
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ search | string | No | Search term to filter apps by name |
↳ pageSize | number | No | Number of apps per page |
↳ apps | array | No | Filter apps by app keys (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<AppItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ slug | string | Yes | URL-friendly slug identifier |
↳ age_in_days | number | No | Number of days since the implementation was created |
↳ auth_type | string | No | Authentication type (e.g., oauth2, api_key) |
↳ banner | string | No | Banner message or status indicator |
↳ categories[] | object[] | No | Categories the implementation belongs to |
↳ id | number | Yes | Unique identifier for the category |
↳ name | string | Yes | Display name of the category |
↳ slug | string | Yes | URL-friendly slug for the category |
↳ images | object | No | Icon images at various sizes |
↳ url_16x16 | string | No | 16x16 pixel icon URL |
↳ url_32x32 | string | No | 32x32 pixel icon URL |
↳ url_64x64 | string | No | 64x64 pixel icon URL |
↳ url_128x128 | string | No | 128x128 pixel icon URL |
↳ popularity | number | No | Popularity score for ranking apps |
↳ has_filters | boolean | No | Whether the app has filter actions |
↳ has_reads | boolean | No | Whether the app has read actions |
↳ has_searches | boolean | No | Whether the app has search actions |
↳ has_searches_or_writes | boolean | No | Whether the app has search or write actions |
↳ has_upfront_fields | boolean | No | Whether the app has upfront input fields |
↳ has_writes | boolean | No | Whether the app has write actions |
↳ is_beta | boolean | No | Whether the app is in beta |
↳ is_built_in | boolean | No | Whether the app is a built-in Zapier app |
↳ is_deprecated | boolean | No | Whether the app is deprecated |
↳ is_featured | boolean | No | Whether the app is featured |
↳ is_hidden | boolean | No | Whether the app is hidden from listings |
↳ is_invite | boolean | No | Whether the app is invite-only |
↳ is_premium | boolean | No | Whether the app requires a premium plan |
↳ is_public | boolean | No | Whether the app is publicly available |
↳ is_upcoming | boolean | No | Whether the app is upcoming/not yet released |
↳ version | string | No | App version |
↳ visibility | string | No | Visibility status (e.g., public, private) |
↳ actions | object | No | Count of available actions by type |
↳ read | number | No | Number of read actions |
↳ read_bulk | number | No | Number of bulk read actions |
↳ write | number | No | Number of write actions |
↳ search | number | No | Number of search actions |
↳ search_or_write | number | No | Number of search-or-write actions |
↳ search_and_write | number | No | Number of search-and-write actions |
↳ filter | number | No | Number of filter actions |
↳ description | string | No | Description of the app |
↳ primary_color | string | No | Primary brand color (hex) |
↳ secondary_color | string | No | Secondary brand color (hex) |
↳ classification | string | No | App classification category |
↳ api_docs_url | string | No | URL to API documentation |
↳ image | string | No | Default image URL for the app |
↳ title | string | Yes | Display name of the app |
↳ key | string | Yes | App key (versionless implementation name) |
↳ implementation_id | string | Yes | Full implementation ID including version |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
Client Credentials
createClientCredentials
Create new client credentials for the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | Yes | Human-readable name for the client credentials |
↳ allowedScopes | array | No | Scopes to allow for these credentials |
Promise<ClientCredentialsItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ client_id | string | Yes | The public identifier (Client ID) of the OAuth application |
↳ name | string | Yes | Human-readable name of the OAuth application |
↳ client_secret | string | Yes | The client secret (only shown once on creation) |
deleteClientCredentials
Delete client credentials by client ID
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ clientId | string | Yes | The client ID of the client credentials to delete |
Promise<{ success: boolean }>
Example:
listClientCredentials
List client credentials for the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ pageSize | number | No | Number of credentials per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ClientCredentialsItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ client_id | string | Yes | The public identifier (Client ID) of the OAuth application |
↳ name | string | Yes | Human-readable name of the OAuth application |
↳ allowed_scopes | array | Yes | List of OAuth scopes that this application is allowed to request |
↳ created_at | string | No | When the application was created (ISO 8601) |
↳ updated_at | string | No | When the application was last updated (ISO 8601) |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
Connections
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ browser | string | No | When to auto-open the URL in a browser. auto (default) opens in local sessions and skips opening in CI / SSH / headless-Linux. always forces the open attempt. never skips it. The URL is always printed to stderr regardless — a failed or skipped open degrades gracefully to copy-paste. |
↳ timeoutMs | number | No | How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300_000). |
↳ pollIntervalMs | number | No | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK’s polling primitive (backoff with sane defaults). |
Promise<ConnectionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | The new connection’s ID. Public UUID when available, falling back to the numeric ID. |
↳ app | string | Yes | Versionless app key the connection was created for (e.g., ‘SlackCLIAPI’). |
↳ title | string | No | Human-readable connection title set by the auth flow, when available. |
findFirstConnection
Find the first connection matching the criteria
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ search | string | No | Search term to filter connections by title |
↳ title | string | No | Filter connections by exact title match (searches first, then filters locally) |
↳ owner | string | No | Filter by owner, ‘me’ for your own connections or a specific user ID |
↳ app | string | No | App key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ account | string | No | Account to filter by |
↳ includeShared | boolean | No | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
↳ expired | boolean | No | Show only expired connections (default: only non-expired connections are returned) |
Promise<ConnectionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Unique identifier for the connection |
↳ date | string | Yes | Date created |
↳ lastchanged | string | No | Date last changed |
↳ account_id | string | Yes | Account ID associated with this connection |
↳ destination_selected_api | string | No | Destination API key (if applicable) |
↳ is_invite_only | boolean | Yes | Whether the connection is invite-only |
↳ is_private | boolean | Yes | Whether the connection is private |
↳ shared_with_all | boolean | Yes | Whether the connection is shared with all users |
↳ is_stale | string | No | Stale status string |
↳ is_shared | string | No | Shared status string |
↳ marked_stale_at | string | No | Date when marked stale |
↳ label | string | No | User label for the connection |
↳ identifier | string | No | Identifier |
↳ title | string | No | Title of the connection |
↳ url | string | No | URL to the connection resource |
↳ groups | array | No | Array of groups associated with the connection |
↳ members | string | No | Members associated with the connection |
↳ permissions | object | No | Permissions for the connection |
↳ public_id | string | No | Public UUID for the connection |
↳ account_public_id | string | No | Public UUID for the associated account |
↳ customuser_public_id | string | No | Public UUID for the associated custom user |
↳ implementation_id | string | No | Implementation ID (was selected_api) |
↳ profile_id | string | No | Profile ID (was customuser_id) |
↳ is_expired | string | No | Whether the connection is expired (mapped from is_stale) |
↳ expired_at | string | No | Date when connection expired (mapped from marked_stale_at) |
↳ app_key | string | No | App Key extracted from implementation_id |
↳ app_version | string | No | App Version extracted from implementation_id |
findUniqueConnection
Find a unique connection matching the criteria
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ search | string | No | Search term to filter connections by title |
↳ title | string | No | Filter connections by exact title match (searches first, then filters locally) |
↳ owner | string | No | Filter by owner, ‘me’ for your own connections or a specific user ID |
↳ app | string | No | App key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ account | string | No | Account to filter by |
↳ includeShared | boolean | No | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
↳ expired | boolean | No | Show only expired connections (default: only non-expired connections are returned) |
Promise<ConnectionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Unique identifier for the connection |
↳ date | string | Yes | Date created |
↳ lastchanged | string | No | Date last changed |
↳ account_id | string | Yes | Account ID associated with this connection |
↳ destination_selected_api | string | No | Destination API key (if applicable) |
↳ is_invite_only | boolean | Yes | Whether the connection is invite-only |
↳ is_private | boolean | Yes | Whether the connection is private |
↳ shared_with_all | boolean | Yes | Whether the connection is shared with all users |
↳ is_stale | string | No | Stale status string |
↳ is_shared | string | No | Shared status string |
↳ marked_stale_at | string | No | Date when marked stale |
↳ label | string | No | User label for the connection |
↳ identifier | string | No | Identifier |
↳ title | string | No | Title of the connection |
↳ url | string | No | URL to the connection resource |
↳ groups | array | No | Array of groups associated with the connection |
↳ members | string | No | Members associated with the connection |
↳ permissions | object | No | Permissions for the connection |
↳ public_id | string | No | Public UUID for the connection |
↳ account_public_id | string | No | Public UUID for the associated account |
↳ customuser_public_id | string | No | Public UUID for the associated custom user |
↳ implementation_id | string | No | Implementation ID (was selected_api) |
↳ profile_id | string | No | Profile ID (was customuser_id) |
↳ is_expired | string | No | Whether the connection is expired (mapped from is_stale) |
↳ expired_at | string | No | Date when connection expired (mapped from marked_stale_at) |
↳ app_key | string | No | App Key extracted from implementation_id |
↳ app_version | string | No | App Version extracted from implementation_id |
getConnection
Execute getConnection
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ connection | string, number | No | 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. |
Promise<ConnectionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Unique identifier for the connection |
↳ date | string | Yes | Date created |
↳ lastchanged | string | No | Date last changed |
↳ account_id | string | Yes | Account ID associated with this connection |
↳ destination_selected_api | string | No | Destination API key (if applicable) |
↳ is_invite_only | boolean | Yes | Whether the connection is invite-only |
↳ is_private | boolean | Yes | Whether the connection is private |
↳ shared_with_all | boolean | Yes | Whether the connection is shared with all users |
↳ is_stale | string | No | Stale status string |
↳ is_shared | string | No | Shared status string |
↳ marked_stale_at | string | No | Date when marked stale |
↳ label | string | No | User label for the connection |
↳ identifier | string | No | Identifier |
↳ title | string | No | Title of the connection |
↳ url | string | No | URL to the connection resource |
↳ groups | array | No | Array of groups associated with the connection |
↳ members | string | No | Members associated with the connection |
↳ permissions | object | No | Permissions for the connection |
↳ public_id | string | No | Public UUID for the connection |
↳ account_public_id | string | No | Public UUID for the associated account |
↳ customuser_public_id | string | No | Public UUID for the associated custom user |
↳ implementation_id | string | No | Implementation ID (was selected_api) |
↳ profile_id | string | No | Profile ID (was customuser_id) |
↳ is_expired | string | No | Whether the connection is expired (mapped from is_stale) |
↳ expired_at | string | No | Date when connection expired (mapped from marked_stale_at) |
↳ app_key | string | No | App Key extracted from implementation_id |
↳ app_version | string | No | App Version extracted from implementation_id |
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):
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
Promise<ConnectionStartUrlItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ url | string | Yes | URL the user should open in their browser to complete the auth flow. Single-use, time-limited. |
↳ expiresAt | number | Yes | Unix timestamp (seconds) after which the URL’s signature is rejected by zapier.com. |
↳ startedAt | number | Yes | Unix timestamp (seconds) when the server minted the URL. Use it as the startedAt for wait-for-new-connection so polling is anchored to server time rather than a possibly-skewed client clock. |
↳ app | string | Yes | Versionless app key the URL was minted for (e.g., ‘SlackCLIAPI’). Useful for downstream filtering. |
listConnections
List available connections with optional filtering
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ search | string | No | Search term to filter connections by title |
↳ title | string | No | Filter connections by exact title match (searches first, then filters locally) |
↳ owner | string | No | Filter by owner, ‘me’ for your own connections or a specific user ID |
↳ app | string | No | App key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ connections | array | No | List of connection IDs to filter by |
↳ account | string | No | Account to filter by |
↳ includeShared | boolean | No | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
↳ expired | boolean | No | Show only expired connections (default: only non-expired connections are returned) |
↳ pageSize | number | No | Number of connections per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ConnectionItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | Unique identifier for the connection |
↳ date | string | Yes | Date created |
↳ lastchanged | string | No | Date last changed |
↳ account_id | string | Yes | Account ID associated with this connection |
↳ destination_selected_api | string | No | Destination API key (if applicable) |
↳ is_invite_only | boolean | Yes | Whether the connection is invite-only |
↳ is_private | boolean | Yes | Whether the connection is private |
↳ shared_with_all | boolean | Yes | Whether the connection is shared with all users |
↳ is_stale | string | No | Stale status string |
↳ is_shared | string | No | Shared status string |
↳ marked_stale_at | string | No | Date when marked stale |
↳ label | string | No | User label for the connection |
↳ identifier | string | No | Identifier |
↳ title | string | No | Title of the connection |
↳ url | string | No | URL to the connection resource |
↳ groups | array | No | Array of groups associated with the connection |
↳ members | string | No | Members associated with the connection |
↳ permissions | object | No | Permissions for the connection |
↳ public_id | string | No | Public UUID for the connection |
↳ account_public_id | string | No | Public UUID for the associated account |
↳ customuser_public_id | string | No | Public UUID for the associated custom user |
↳ implementation_id | string | No | Implementation ID (was selected_api) |
↳ profile_id | string | No | Profile ID (was customuser_id) |
↳ is_expired | string | No | Whether the connection is expired (mapped from is_stale) |
↳ expired_at | string | No | Date when connection expired (mapped from marked_stale_at) |
↳ app_key | string | No | App Key extracted from implementation_id |
↳ app_version | string | No | App Version extracted from implementation_id |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
waitForNewConnection
Wait for a new connection to appear for the given app. Polls /api/v0/connections with server-side ordering=-date 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):
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ startedAt | number | Yes | Unix timestamp (seconds). Only connections whose date is at or after this value count as ‘new’. Prefer the startedAt returned by get-connection-start-url — it’s server-stamped, so the comparison isn’t thrown off by client clock skew. If you mint the timestamp yourself, capture it before showing the start URL so a fast OAuth completion isn’t missed. |
↳ timeoutMs | number | No | How long to wait before giving up. Default 5 minutes (300_000). |
↳ pollIntervalMs | number | No | Delay before the first poll request, in ms. Default 3 seconds (3_000). Subsequent polling cadence is managed by the SDK’s polling primitive (backoff with sane defaults). |
Promise<ConnectionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | The new connection’s ID. Public UUID when available, falling back to the numeric ID. |
↳ app | string | Yes | Versionless app key the connection was created for (e.g., ‘SlackCLIAPI’). |
↳ title | string | No | Human-readable connection title set by the auth flow, when available. |
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 | Description |
|---|---|---|---|
url | string, custom | Yes | The full URL of the API endpoint to call (proxied through Zapier’s Relay service) |
init | object | No | Request options including method, headers, body, and authentication |
↳ method | string | No | HTTP method for the request (defaults to GET) |
↳ headers | object | No | HTTP headers to include in the request |
↳ body | string, custom, record | No | Request body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly |
↳ connection | string, number | No | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
↳ callbackUrl | string | No | URL to send async response to (makes request async) |
↳ maxTime | number | No | Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling. |
Promise<Response>
Example:
Tables
createTable
Create a new table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | Yes | The name for the new table |
↳ description | string | No | An optional description of the table |
Promise<TableItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ name | string | Yes | |
↳ description | string | No | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ kind | string | Yes | |
↳ account_id | string | Yes | |
↳ profile_id | string | Yes | |
↳ parent_table_id | string | No |
createTableFields
Create one or more fields in a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ fields[] | object[] | Yes | Array of field definitions to create |
↳ type | string | Yes | The data type of the field |
↳ name | string | Yes | The display name of the field |
↳ options | object | No | Data configuration options for the field |
↳ config | object | No | Display configuration for the field |
Promise<FieldItem[]>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ type | string | Yes | |
↳ name | string | Yes | |
↳ created_at | string | No | |
↳ edited_at | string | No | |
↳ options | object | No | |
↳ config | object | No | |
↳ deleted_at | string | No |
createTableRecords
Create one or more records in a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ records[] | object[] | Yes | Array of records to create (max 100) |
↳ data | object | Yes | The field values for the record, keyed by field ID |
↳ keyMode | string | No | How to interpret field keys in record data. “names” (default) uses human-readable field names, “ids” uses raw field IDs (f1, f2). |
Promise<RecordItem[]>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ data | object | Yes | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ deleted_at | string | No |
deleteTable
Delete a table by its ID
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
Promise<{ success: boolean }>
Example:
deleteTableFields
Delete one or more fields from a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ fields | array | Yes | Fields to operate on. Accepts field names (e.g., “Email”) or IDs (e.g., “f6”, “6”, or 6). |
Promise<{ success: boolean }>
Example:
deleteTableRecords
Delete one or more records from a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ records | array | Yes | Record IDs to operate on |
Promise<{ success: boolean }>
Example:
getTable
Get detailed information about a specific table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
Promise<TableItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ name | string | Yes | |
↳ description | string | No | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ kind | string | Yes | |
↳ account_id | string | Yes | |
↳ profile_id | string | Yes | |
↳ parent_table_id | string | No |
getTableRecord
Get a single record from a table by ID
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ record | string | Yes | The unique identifier of the record |
↳ keyMode | string | No | How to interpret field keys in record data. “names” (default) uses human-readable field names, “ids” uses raw field IDs (f1, f2). |
Promise<RecordItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ data | object | Yes | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ deleted_at | string | No |
listTableFields
List fields for a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ fields | array | No | Fields to operate on. Accepts field names (e.g., “Email”) or IDs (e.g., “f6”, “6”, or 6). |
↳ trash | string | No | Control soft-deleted item visibility. “exclude” (default) returns active items only, “include” returns both active and soft-deleted, “only” returns soft-deleted items only. |
Promise<PaginatedResult<FieldItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ type | string | Yes | |
↳ name | string | Yes | |
↳ created_at | string | No | |
↳ edited_at | string | No | |
↳ options | object | No | |
↳ config | object | No | |
↳ deleted_at | string | No | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listTableRecords
List records in a table with optional filtering and sorting
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ filters[] | object[] | No | Filter conditions for the query |
↳ fieldKey | string | Yes | The field key to filter on (e.g. f1, f2) |
↳ operator | string | Yes | The comparison operator |
↳ value | unknown | No | The value to compare against |
↳ sort | object | No | Sort records by a field |
↳ fieldKey | string | Yes | The field key to sort by |
↳ direction | string | No | Sort direction |
↳ pageSize | number | No | Number of records per page (max 1000) |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
↳ keyMode | string | No | How to interpret field keys in record data. “names” (default) uses human-readable field names, “ids” uses raw field IDs (f1, f2). |
↳ trash | string | No | Control soft-deleted item visibility. “exclude” (default) returns active items only, “include” returns both active and soft-deleted, “only” returns soft-deleted items only. |
Promise<PaginatedResult<RecordItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ data | object | Yes | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ deleted_at | string | No | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listTables
List tables available to the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tables | array | No | Filter by specific table IDs |
↳ kind | string | No | Filter by table type |
↳ search | string | No | Search term to filter tables by name |
↳ owner | string | No | Filter by table owner. Use “me” for the current user, or a numeric user ID. Requires includeShared to be true. |
↳ includeShared | boolean | No | Include tables shared with you. Without this, only your own tables are returned. |
↳ pageSize | number | No | Number of tables per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<TableItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ name | string | Yes | |
↳ description | string | No | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ kind | string | Yes | |
↳ account_id | string | Yes | |
↳ profile_id | string | Yes | |
↳ parent_table_id | string | No | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
updateTableRecords
Update one or more records in a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
↳ records[] | object[] | Yes | Array of records to update (max 100) |
↳ id | string | Yes | The record ID to update |
↳ data | object | Yes | The field values to update, keyed by field key |
↳ keyMode | string | No | How to interpret field keys in record data. “names” (default) uses human-readable field names, “ids” uses raw field IDs (f1, f2). |
Promise<RecordItem[]>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ data | object | Yes | |
↳ created_at | string | Yes | |
↳ edited_at | string | Yes | |
↳ deleted_at | string | No |
Code Workflows (Experimental)
ℹ️ Experimental. Import from "@zapier/zapier-sdk/experimental" to use these methods. Methods and behavior may change.
cancelDurableRun
Cancel a run-once durable run in initialized or started status. Returns 409 if the run is already terminal.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ run | string | Yes | Durable run ID |
Promise<DurableRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Run ID that was targeted |
↳ status | string | Yes | Always cancelled on a successful call. Synthesized client-side — the backend returns 204; callers needing the run’s full state should follow up with getDurableRun. |
createWorkflow
Create a durable workflow container. Starts disabled with no version; publish a version to add code.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | Yes | Workflow name |
↳ description | string | No | Optional description for the workflow |
↳ private | boolean | No | If true, only the creating user can see or manage this workflow. Defaults to false (account-visible). |
Promise<WorkflowItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow ID (UUID) |
↳ name | string | Yes | Workflow name |
↳ description | string | Yes | Workflow description (null if unset) |
↳ trigger_url | string | Yes | Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive. |
↳ enabled | boolean | Yes | Whether the workflow currently accepts triggers. Always false on a new workflow until enabled. |
↳ is_private | boolean | Yes | Whether the workflow is private to the creating user. False means account-visible. |
↳ created_by_user_id | string | Yes | User ID of the workflow creator (null in legacy data) |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
deleteWorkflow
Delete a durable workflow. Throws ZapierNotFoundError if the workflow doesn’t exist; callers wanting idempotency should catch that themselves.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
Promise<{ success: boolean }>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow ID that was targeted for deletion |
disableWorkflow
Disable a durable workflow so it stops accepting triggers
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
Promise<WorkflowItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow ID (UUID) |
↳ enabled | boolean | Yes | Workflow’s enabled state after the operation. Typically false; mirrors the row’s true state in case a concurrent enable raced with this call. |
enableWorkflow
Enable a durable workflow so it accepts triggers
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
Promise<WorkflowItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow ID (UUID) |
↳ enabled | boolean | Yes | Workflow’s enabled state after the operation (always true) |
getDurableRun
Get the full state of a run-once durable run, including its operations journal
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ run | string | Yes | Durable run ID |
Promise<DurableRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Run ID (UUID) |
↳ status | string | Yes | Run lifecycle status. finished / failed / cancelled are terminal. |
↳ input | unknown | Yes | Input data passed to the run |
↳ output | unknown | Yes | Return value, present when status is finished |
↳ error | object | Yes | Structured error details when the run failed (null otherwise) |
↳ execution | object | Yes | Linked execution, including the operations journal. Null while the run is still in initialized state. |
↳ is_private | boolean | Yes | When true, the run is visible only to the creating user; otherwise visible across the account. |
↳ created_at | string | Yes | When the run was created (ISO-8601) |
↳ updated_at | string | Yes | When the run was last updated (ISO-8601) |
getTriggerRun
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.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ trigger | string | Yes | Workflow trigger ID |
Promise<WorkflowRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow run ID (UUID) |
↳ durable_run_id | string | Yes | Linked sdkdurableapi run ID. Null until the durable run is created. |
↳ workflow_version_id | string | Yes | Workflow version the run is bound to |
↳ status | string | Yes | Workflow run lifecycle status. finished / failed / cancelled are terminal. |
↳ input | unknown | Yes | Input passed to the run |
↳ output | unknown | Yes | Return value, present when status is finished |
↳ error | unknown | Yes | Error payload when status is failed (null otherwise) |
↳ created_at | string | Yes | When the run was created (ISO-8601) |
↳ updated_at | string | Yes | When the run was last updated (ISO-8601) |
getWorkflow
Get a durable workflow with its current version details and trigger claim status
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
Promise<WorkflowItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow ID (UUID) |
↳ name | string | Yes | Workflow name |
↳ description | string | Yes | Optional workflow description (null if unset) |
↳ trigger_url | string | Yes | Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive. |
↳ enabled | boolean | Yes | Whether the workflow currently accepts triggers |
↳ disabled_reason | string | No | Why the workflow is off, when system-disabled. Null when not system-disabled. Independent of per-trigger claim status: an enabled workflow can still have a failed trigger. |
↳ is_private | boolean | Yes | Whether the workflow is private to the creating user. False means account-visible. |
↳ created_by_user_id | string | Yes | User ID of the workflow creator (null in legacy data) |
↳ current_version | object | No | The currently published version, if any. Absent for workflows with no version published yet. |
↳ id | string | Yes | Workflow version ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this version’s runs |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this version (or null) |
↳ created_by_user_id | string | Yes | ID of the user who published this version |
↳ created_at | string | Yes | When the version was published (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration persisted on this version, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this version (or null). |
↳ app_versions | object | Yes | App-version pins bound on this version (or null). |
↳ triggers[] | object[] | Yes | Trigger configurations from the current version, with live claim status. Empty array when the workflow has no triggers. |
↳ selected_api | string | Yes | Zapier app/API identifier (e.g. ‘GoogleSheetsAPI’) |
↳ action | string | Yes | Trigger action key (e.g. ‘new_row’) |
↳ authentication_id | string | No | Connection ID for the trigger source. Null for no-auth triggers. |
↳ params | object | No | Trigger parameters as a JSON object |
↳ status | string | Yes | Live trigger claim status — whether the trigger is currently subscribed to its source. |
↳ error | string | No | Failure reason for the latest claim. Present (non-null) only when status is ‘failed’. |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
↳ updated_at | string | Yes | When the workflow was last modified (ISO-8601) |
getWorkflowRun
Get the current state of a workflow run (a triggered execution of a deployed workflow)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | No | Parent workflow ID — used only to scope the CLI run-id picker; ignored by the API call. |
↳ run | string | Yes | Workflow run ID |
Promise<WorkflowRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow run ID (UUID) |
↳ trigger_id | string | Yes | ID of the trigger that fired this run, if any |
↳ durable_run_id | string | Yes | Linked sdkdurableapi run ID. Null until the durable run is created. |
↳ workflow_version_id | string | Yes | Workflow version the run is bound to |
↳ status | string | Yes | Workflow run lifecycle status. finished / failed / cancelled are terminal. |
↳ input | unknown | Yes | Input passed to the run |
↳ output | unknown | Yes | Return value, present when status is finished |
↳ error | unknown | Yes | Error payload when status is failed (null otherwise) |
↳ created_at | string | Yes | When the run was created (ISO-8601) |
↳ updated_at | string | Yes | When the run was last updated (ISO-8601) |
getWorkflowVersion
Get full details of a workflow version including source files
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ version | string | Yes | Workflow version ID |
Promise<WorkflowVersionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow version ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this version’s runs |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this version (or null) |
↳ created_by_user_id | string | Yes | ID of the user who published this version |
↳ created_at | string | Yes | When the version was published (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration persisted on this version, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this version (or null). |
↳ app_versions | object | Yes | App-version pins bound on this version (or null). |
listDurableRuns
List run-once durable runs for the authenticated account, newest first
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ pageSize | number | No | Number of runs per page (max 100) |
↳ cursor | string | No | Pagination cursor |
↳ maxItems | number | No | Maximum total items to return across all pages |
Promise<PaginatedResult<DurableRunItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | Run ID (UUID) |
↳ status | string | Yes | Run lifecycle status. finished / failed / cancelled are terminal. |
↳ input | unknown | Yes | Input data passed to the run |
↳ output | unknown | Yes | Return value, present when status is finished |
↳ error | object | Yes | Structured error details when the run failed (null otherwise) |
↳ execution_id | string | Yes | Linked execution ID. Null until the run leaves the initialized state. |
↳ is_private | boolean | Yes | When true, the run is visible only to the creating user; otherwise visible across the account. |
↳ created_at | string | Yes | When the run was created (ISO-8601) |
↳ updated_at | string | Yes | When the run was last updated (ISO-8601) |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listWorkflowRuns
List workflow runs (triggered executions) for a specific deployed workflow, newest first
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ pageSize | number | No | Number of runs per page (max 100) |
↳ cursor | string | No | Pagination cursor |
↳ maxItems | number | No | Maximum total runs to return across all pages |
Promise<PaginatedResult<WorkflowRunItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | Workflow run ID (UUID) |
↳ trigger_id | string | Yes | ID of the trigger that fired this run, if any. Null for runs created without a trigger. |
↳ durable_run_id | string | Yes | Linked sdkdurableapi run ID. Null until the durable run is created. |
↳ workflow_version_id | string | Yes | Workflow version the run is bound to. Null in rare edge cases. |
↳ status | string | Yes | Workflow run lifecycle status. finished / failed / cancelled are terminal. |
↳ input | unknown | Yes | Input passed to the run |
↳ error | unknown | Yes | Error payload when status is failed (null otherwise) |
↳ created_at | string | Yes | When the run was created (ISO-8601) |
↳ updated_at | string | Yes | When the run was last updated (ISO-8601) |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listWorkflowVersions
List published versions for a workflow, newest first
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ pageSize | number | No | Number of versions per page (max 100) |
↳ cursor | string | No | Pagination cursor |
↳ maxItems | number | No | Maximum total versions to return across all pages |
Promise<PaginatedResult<WorkflowVersionItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | Workflow version ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this version’s runs |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this version (or null) |
↳ created_by_user_id | string | Yes | ID of the user who published this version |
↳ created_at | string | Yes | When the version was published (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration persisted on this version, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this version (or null). |
↳ app_versions | object | Yes | App-version pins bound on this version (or null). |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listWorkflows
List all active durable workflows for the authenticated account
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ pageSize | number | No | Number of workflows per page (max 100) |
↳ maxItems | number | No | Maximum total workflows to return across all pages |
↳ cursor | string | No | Cursor to start from for pagination |
Promise<PaginatedResult<WorkflowItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | Workflow ID (UUID) |
↳ name | string | Yes | Workflow name |
↳ description | string | Yes | Optional workflow description (null if unset) |
↳ trigger_url | string | Yes | Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive. |
↳ enabled | boolean | Yes | Whether the workflow currently accepts triggers |
↳ disabled_reason | string | No | Why the workflow is off, when system-disabled. Null when not system-disabled. |
↳ is_private | boolean | Yes | Whether the workflow is private to the creating user. False means account-visible. |
↳ created_by_user_id | string | Yes | User ID of the workflow creator (null in legacy data) |
↳ current_version_id | string | Yes | ID of the workflow version that runs handle. Null until a version is published. |
↳ triggers[] | object[] | Yes | Trigger configurations from the current version, with live claim status. Empty array when the workflow has no triggers. |
↳ selected_api | string | Yes | Zapier app/API identifier (e.g. ‘GoogleSheetsAPI’) |
↳ action | string | Yes | Trigger action key (e.g. ‘new_row’) |
↳ authentication_id | string | No | Connection ID for the trigger source. Null for no-auth triggers. |
↳ params | object | No | Trigger parameters as a JSON object |
↳ status | string | Yes | Live trigger claim status — whether the trigger is currently subscribed to its source. |
↳ error | string | No | Failure reason for the latest claim. Present (non-null) only when status is ‘failed’. |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
↳ updated_at | string | Yes | When the workflow was last modified (ISO-8601) |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
publishWorkflowVersion
Publish a new version of a durable workflow. Enables the workflow by default.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ sourceFiles | object | Yes | Source files keyed by filename → contents |
↳ dependencies | object | No | Optional npm package dependencies |
↳ zapierDurableVersion | string | No | Exact semver of @zapier/zapier-durable to use (e.g. “1.2.3”). Defaults to server-configured version if omitted. |
↳ enabled | boolean | No | Enable the workflow after publishing. Defaults to true; pass false to publish without enabling. |
↳ connections | object | No | Map of connection aliases to Zapier connections used by the workflow. Pass null to clear an existing binding. |
↳ appVersions | object | No | Map of app keys to pinned app implementation/version used by the workflow. Pass null to clear an existing binding. |
↳ trigger | object | No | Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows. |
↳ selectedApi | string | No | Zapier app/API identifier (e.g. ‘GoogleSheetsAPI’). Required when a trigger is configured. |
↳ action | string | Yes | Trigger action key (e.g. ‘new_row’) |
↳ authenticationId | string | No | Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier). |
↳ params | object | No | Trigger parameters as a JSON object |
Promise<WorkflowVersionItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow version ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this version’s runs |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this version (or null) |
↳ created_by_user_id | string | Yes | ID of the user who published this version |
↳ created_at | string | Yes | When the version was published (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration persisted on this version, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this version (or null). |
↳ app_versions | object | Yes | App-version pins bound on this version (or null). |
runDurable
Run a workflow source file as a run-once durable run on sdkdurableapi (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ sourceFiles | object | Yes | Source files keyed by filename → contents |
↳ input | unknown | No | Input data passed to the run |
↳ dependencies | object | No | Optional npm package dependencies |
↳ zapierDurableVersion | string | No | Exact semver of @zapier/zapier-durable to use (e.g. “1.2.3”). Defaults to server-configured version if omitted. |
↳ connections | object | No | Named connection aliases. Maps each alias to an object holding its Zapier connection ID, e.g. { "slack": { "connectionId": "123" } }. |
↳ appVersions | object | No | Pinned app versions. Maps app keys (slugs) to implementation names and versions. |
↳ private | boolean | No | Only the creating user can see the run (default false) |
↳ notifications[] | object[] | No | Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to. |
↳ type | string | No | Notification transport. Webhook is the only supported type. |
↳ url | string | Yes | URL to POST event notifications to. Payload is {run_id, event}. |
↳ max_retries | number | No | Max delivery attempts with exponential backoff. Defaults to 3 server-side. |
↳ events | array | Yes | One or more lifecycle events to subscribe this URL to. |
Promise<DurableRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Run ID (UUID) — server-generated, time-sortable |
↳ status | string | Yes | Always initialized on creation. Poll via getDurableRun to observe the run advancing to started / finished / failed / cancelled. |
↳ is_private | boolean | Yes | When true, the run is visible only to the creating user; otherwise visible across the account. |
↳ created_at | string | Yes | When the run was created (ISO-8601) |
triggerWorkflow
Look up a workflow’s trigger URL and fire it manually. The trigger endpoint is tokenized (the URL contains a secret) and takes no auth header, so the SDK uses a raw fetch rather than the api plugin.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ input | unknown | No | JSON payload delivered as the trigger body. Sent as application/json; omit to fire with an empty body. |
Promise<WorkflowRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ workflow | string | Yes | The workflow ID that was triggered |
↳ status | number | Yes | HTTP status returned by the trigger endpoint |
↳ body | unknown | Yes | Response body from the trigger endpoint. Parsed as JSON when the response body parses, otherwise returned as the raw response text. |
updateWorkflow
Update a durable workflow’s name and/or description
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ name | string | No | New name for the workflow |
↳ description | string | No | New description for the workflow (pass null to clear) |
Promise<WorkflowItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow ID (UUID) |
↳ name | string | Yes | Workflow name (post-update) |
↳ description | string | Yes | Workflow description, post-update (null if unset) |
↳ trigger_url | string | Yes | Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive. |
↳ enabled | boolean | Yes | Whether the workflow currently accepts triggers |
↳ is_private | boolean | Yes | Whether the workflow is private to the creating user. False means account-visible. |
↳ created_by_user_id | string | Yes | User ID of the workflow creator (null in legacy data) |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
↳ updated_at | string | Yes | When this update was applied (ISO-8601) |
Triggers (Experimental)
ℹ️ Experimental. Import from "@zapier/zapier-sdk/experimental" to use these methods. Methods and behavior may change.
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ lease | string | Yes | Lease ID returned from leaseTriggerInboxMessages |
↳ messages | array | No | Specific message IDs to ack. Omit to ack every message in the lease. |
Promise<TriggerInboxAckItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ acked_id | string | Yes | |
↳ results[] | object[] | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ status | string | Yes | Message lifecycle status |
↳ message_attributes | object | Yes | |
↳ lease_count | number | Yes | |
↳ error_message | string | Yes | |
↳ possible_duplicate_data | boolean | Yes |
createTriggerInbox
Create a new trigger inbox subscription. Always creates a new inbox; use ensureTriggerInbox for get-or-create on a stable name.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | No | Optional inbox name. Auto-generated when omitted. Throws a conflict error if the name is already in use by another subscription. |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ connection | string, number | No | Connection alias or connection ID. Optional for triggers that don’t require auth. |
↳ inputs | object | No | Input parameters for the trigger subscription |
↳ notificationUrl | string | No | Webhook URL to POST to when new messages arrive |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
deleteTriggerInbox
Mark a trigger inbox for deletion
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
Promise<{ success: boolean }>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ onMessage | function | No | Per-message handler. Resolves to ack; rejects to release-or-leave per releaseOnError. Throw ZapierReleaseTriggerMessageSignal to release explicitly, or ZapierAbortDrainSignal to stop after the current batch. |
↳ concurrency | number | No | Per-message handler workers running in parallel. Defaults to leaseLimit, or 1 if neither is set. |
↳ leaseLimit | number | No | Per-lease HTTP batch size. Defaults to concurrency, or 1 if neither is set. |
↳ leaseSeconds | number | No | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
↳ releaseOnError | boolean | No | If true, errors release the message when the drain finishes. If false (default), errors leave it leased until the lease timeout. ZapierReleaseTriggerMessageSignal always releases regardless. |
↳ continueOnError | boolean | No | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via onError and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
↳ onError | function | No | Per-message error observer for continueOnError: true. Called with the failure and the message; control-flow signals are filtered out. Throws from onError are swallowed. |
↳ signal | any | No | Abort signal. Aborting cancels in-flight HTTP, releases unprocessed messages, and resolves cleanly. Errors during shutdown still reject. |
↳ maxMessages | number | No | Cap total messages drained. Defaults to draining the inbox until empty. |
Promise<void>
Example:
ensureTriggerInbox
Get-or-create a trigger inbox by name. Idempotent on (user, account, name): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the name exists with a different subscription.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | Yes | Inbox name; serves as the idempotency key. Required for ensureTriggerInbox — without one, the API mints a fresh inbox each call (use createTriggerInbox for that path). |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ connection | string, number | No | Connection alias or connection ID. Optional for triggers that don’t require auth. |
↳ inputs | object | No | Input parameters for the trigger subscription |
↳ notificationUrl | string | No | Webhook URL to POST to when new messages arrive |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
getTriggerInbox
Get details of a trigger inbox by ID
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) to get the input schema for |
↳ action | string | Yes | Trigger action key to get the input schema for |
↳ connection | string, number | No | Connection alias or connection ID. Required if the trigger needs a connection to determine available fields. |
↳ inputs | object | No | Current input values that may affect the schema (e.g., when fields depend on other field values) |
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ leaseLimit | number | No | Maximum messages to lease in a single batch (1-100) |
↳ leaseSeconds | number | No | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
↳ signal | any | No | Abort signal forwarded to the lease HTTP request. Aborting causes the in-flight request to reject with AbortError. |
Promise<TriggerInboxLeaseItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ lease_id | string | Yes | |
↳ leased_until | string | Yes | |
↳ results[] | object[] | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ status | string | Yes | Message lifecycle status |
↳ message_attributes | object | Yes | |
↳ lease_count | number | Yes | |
↳ error_message | string | Yes | |
↳ possible_duplicate_data | boolean | Yes | |
↳ payload | object | Yes | |
↳ inbox_attributes | object | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
listTriggerInboxMessages
List messages in a trigger inbox (no payload, status-only)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ pageSize | number | No | Number of messages per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Pagination cursor |
Promise<PaginatedResult<TriggerMessageItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ status | string | Yes | Message lifecycle status |
↳ message_attributes | object | Yes | |
↳ lease_count | number | Yes | |
↳ error_message | string | Yes | |
↳ possible_duplicate_data | boolean | Yes | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listTriggerInboxes
List all trigger inboxes for the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | No | Filter by inbox name (exact match). Names are unique per (user, account), so this returns at most one inbox. |
↳ status | string | No | Filter by inbox status |
↳ pageSize | number | No | Number of inboxes per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor (offset) to start from for pagination |
Promise<PaginatedResult<TriggerInboxItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listTriggerInputFieldChoices
Get the available choices for a dynamic dropdown input field on a trigger
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ inputField | string | Yes | Input field key to get choices for |
↳ connection | string, number | No | Connection alias or connection ID. Required if the trigger needs a connection to populate dynamic dropdown options. |
↳ inputs | object | No | Current input values that may affect available choices |
↳ page | number | No | Page number for paginated results |
↳ pageSize | number | No | Number of choices per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<InputFieldChoiceItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ key | string | No | |
↳ label | string | No | |
↳ sample | string | No | |
↳ value | string | No | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
listTriggerInputFields
Get the input fields required for a specific trigger
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App slug (e.g., ‘github’), implementation name (e.g., ‘SlackCLIAPI’), or versioned ID (e.g., ‘github@1.2.3’) |
↳ action | string | Yes | Action key (e.g., ‘send_message’ or ‘find_row’) |
↳ connection | string, number | No | Connection alias or connection ID. Required if the trigger needs a connection to determine available fields. |
↳ inputs | object | No | Current input values that may affect available fields |
↳ pageSize | number | No | Number of input fields per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<RootFieldItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | One of the variants below, distinguished by type |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
type is "input_field":
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
key | string | Yes | |
default_value | string | Yes | |
depends_on | array | Yes | |
description | string | Yes | |
invalidates_input_fields | boolean | Yes | |
is_required | boolean | Yes | |
placeholder | string | Yes | |
title | string | Yes | |
value_type | string | Yes | |
format | string | No | |
items | object | No | |
↳ type | string | Yes |
type is "info_field":
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
key | string | Yes | |
description | string | Yes | |
title | string | No |
type is "fieldset":
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
key | string | Yes | |
title | string | Yes | |
fields | array | Yes |
listTriggers
List all triggers for a specific app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ app | string | Yes | App key of triggers to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ pageSize | number | No | Number of triggers per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ActionItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | No | |
↳ key | string | Yes | |
↳ description | string | Yes | |
↳ is_important | boolean | No | |
↳ is_hidden | boolean | No | |
↳ app_key | string | Yes | |
↳ app_version | string | No | |
↳ action_type | string | Yes | |
↳ title | string | Yes | |
↳ type | string | Yes | |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
pauseTriggerInbox
Pause a trigger inbox; events stop being collected
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ lease | string | Yes | Lease ID returned from leaseTriggerInboxMessages |
↳ messages | array | No | Specific message IDs to release. Omit to release every message in the lease. |
Promise<TriggerInboxReleaseItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ released_id | string | Yes | |
↳ results[] | object[] | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ status | string | Yes | Message lifecycle status |
↳ message_attributes | object | Yes | |
↳ lease_count | number | Yes | |
↳ error_message | string | Yes | |
↳ possible_duplicate_data | boolean | Yes |
resumeTriggerInbox
Resume a paused trigger inbox; events resume being collected
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
updateTriggerInbox
Update settings on an existing trigger inbox
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ notificationUrl | string | No | Webhook URL to POST to when new messages arrive. Pass null to clear. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ name | string | Yes | |
↳ status | string | Yes | Inbox lifecycle status |
↳ paused_reason | string | Yes | Why the inbox was paused, if applicable |
↳ notification_url | string | Yes | |
↳ subscription | object | Yes | |
↳ connection_id | string, number | Yes | |
↳ app_key | string | Yes | |
↳ action_key | string | Yes | |
↳ inputs | object | Yes |
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:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inbox | string | Yes | Trigger inbox identifier — UUID or name. Non-UUID values are resolved by name via the inbox list endpoint. |
↳ onMessage | function | No | Per-message handler. Resolves to ack; rejects to release-or-leave per releaseOnError. Throw ZapierReleaseTriggerMessageSignal to release explicitly, or ZapierAbortDrainSignal to stop after the current batch. |
↳ concurrency | number | No | Per-message handler workers running in parallel. Defaults to leaseLimit, or 1 if neither is set. |
↳ leaseLimit | number | No | Per-lease HTTP batch size. Defaults to concurrency, or 1 if neither is set. |
↳ leaseSeconds | number | No | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
↳ releaseOnError | boolean | No | If true, errors release the message when the drain finishes. If false (default), errors leave it leased until the lease timeout. ZapierReleaseTriggerMessageSignal always releases regardless. |
↳ continueOnError | boolean | No | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via onError and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
↳ onError | function | No | Per-message error observer for continueOnError: true. Called with the failure and the message; control-flow signals are filtered out. Throws from onError are swallowed. |
↳ signal | any | No | Abort signal. Aborting cancels in-flight HTTP, releases unprocessed messages, and resolves cleanly. Errors during shutdown still reject. |
↳ maxDrainIntervalSeconds | number | No | Maximum seconds between safety drain attempts (default: 300). The watcher subscribes to SSE notifications for near-real-time wake-ups; this interval is the backstop that guarantees forward progress if SSE events are missed or the connection drops undetected. |
Promise<void>
Example: