Documentation Index
Fetch the complete documentation index at: https://docs.zapier.com/llms.txt
Use this file to discover all available pages before exploring further.
This page documents all available methods in the Zapier SDK.
Installation
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript
Initialization
Option 1: Browser-based auth
Running npx 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.
import { createZapierSdk } from "@zapier/zapier-sdk";
const zapier = createZapierSdk();
Option 2: Client credentials
Provide a client ID and client secret. You can get these by running npx zapier-sdk create-client-credentials. This allows you to run the SDK in a server/serverless environment.
import { createZapierSdk } from "@zapier/zapier-sdk";
const zapier = createZapierSdk({
credentials: {
clientId: "your_client_id",
clientSecret: "your_client_secret",
},
});
Option 3: Direct token
Provide a valid Zapier token. This is for partner OAuth or internal Zapier use.
import { createZapierSdk } from "@zapier/zapier-sdk";
const zapier = createZapierSdk({
credentials: "your_zapier_token_here",
});
Accounts
getProfile
Get current user’s profile information
Parameters:
| Name | Type | Required | Description |
|---|
options | object | No | |
Returns: 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 | |
Example:
const { data: profile } = await zapier.getProfile();
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’) |
Returns: 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 | |
Example:
const { data: action } = await zapier.getAction({
app: "example-app",
actionType: "read",
action: "example-action",
});
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) |
Returns: Promise<InputSchemaItem>
Example:
const { data: inputSchema } = await zapier.getActionInputFieldsSchema({
app: "example-app",
actionType: "read",
action: "example-action",
});
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: inputFieldChoices, nextCursor } =
await zapier.listActionInputFieldChoices({
app: "example-app",
actionType: "read",
action: "example-action",
inputField: "example-input-field",
});
// Or iterate over all pages
for await (const page of zapier.listActionInputFieldChoices({
app: "example-app",
actionType: "read",
action: "example-action",
inputField: "example-input-field",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
.listActionInputFieldChoices({
app: "example-app",
actionType: "read",
action: "example-action",
inputField: "example-input-field",
})
.items()) {
// Do something with each inputFieldChoice
}
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 |
Returns: 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 |
When 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 | |
When type is "info_field":
| Name | Type | Required | Description |
|---|
type | string | Yes | |
key | string | Yes | |
description | string | Yes | |
title | string | No | |
When type is "fieldset":
| Name | Type | Required | Description |
|---|
type | string | Yes | |
key | string | Yes | |
title | string | Yes | |
fields | array | Yes | |
Example:
// Get first page and a cursor for the second page
const { data: rootFields, nextCursor } = await zapier.listActionInputFields({
app: "example-app",
actionType: "read",
action: "example-action",
});
// Or iterate over all pages
for await (const page of zapier.listActionInputFields({
app: "example-app",
actionType: "read",
action: "example-action",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const rootField of zapier
.listActionInputFields({
app: "example-app",
actionType: "read",
action: "example-action",
})
.items()) {
// Do something with each rootField
}
listActions
List all actions for a specific app
Parameters:
| Name | Type | Required | 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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: actions, nextCursor } = await zapier.listActions({
app: "example-app",
});
// Or iterate over all pages
for await (const page of zapier.listActions({
app: "example-app",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const action of zapier
.listActions({
app: "example-app",
})
.items()) {
// Do something with each action
}
runAction
Execute an action with the given inputs
Parameters:
| Name | Type | Required | 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 |
Returns: Promise<PaginatedResult<ActionResultItem>>
Example:
// Get first page and a cursor for the second page
const { data: actionResults, nextCursor } = await zapier.runAction({
app: "example-app",
actionType: "read",
action: "example-action",
});
// Or iterate over all pages
for await (const page of zapier.runAction({
app: "example-app",
actionType: "read",
action: "example-action",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const actionResult of zapier
.runAction({
app: "example-app",
actionType: "read",
action: "example-action",
})
.items()) {
// Do something with each actionResult
}
Apps
apps.{appKey}
Bind a connection alias or numeric connectionId to an app
Parameters:
| Name | Type | Required | 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. |
Returns: Promise<AppProxy>
Example:
const result = await zapier.apps.appKey();
apps.{appKey}.{actionType}.{actionKey}
Execute an action with the given inputs for the bound app, as an alternative to runAction
Parameters:
| Name | Type | Required | 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) |
Returns: Promise<PaginatedResult<ActionResultItem>>
Example:
// Get first page and a cursor for the second page
const { data: actionResults, nextCursor } =
await zapier.apps.appKey.actionType.actionKey();
// Or iterate over all pages
for await (const page of zapier.apps.appKey.actionType.actionKey()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const actionResult of zapier.apps.appKey.actionType
.actionKey()
.items()) {
// Do something with each actionResult
}
getApp
Get detailed information about a specific app
Parameters:
| Name | Type | Required | 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’) |
Returns: 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 |
Example:
const { data: app } = await zapier.getApp({
app: "example-app",
});
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: apps, nextCursor } = await zapier.listApps();
// Or iterate over all pages
for await (const page of zapier.listApps()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const app of zapier.listApps().items()) {
// Do something with each app
}
Client Credentials
createClientCredentials
Create new client credentials for the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|
options | object | Yes | |
↳ name | string | Yes | Human-readable name for the client credentials |
↳ allowedScopes | array | No | Scopes to allow for these credentials |
Returns: 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) |
Example:
const result = await zapier.createClientCredentials({
name: "example-name",
});
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 |
Returns: Promise<{ success: boolean }>
Example:
const result = await zapier.deleteClientCredentials({
clientId: "example-client-id",
});
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: clientCredentials, nextCursor } =
await zapier.listClientCredentials();
// Or iterate over all pages
for await (const page of zapier.listClientCredentials()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const clientCredentials of zapier.listClientCredentials().items()) {
// Do something with each clientCredentials
}
Connections
findFirstConnection
Find the first connection matching the criteria
Parameters:
| Name | Type | Required | 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) |
Returns: 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 |
Example:
const { data: connection } = await zapier.findFirstConnection();
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) |
Returns: 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 |
Example:
const { data: connection } = await zapier.findUniqueConnection();
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. |
Returns: 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 |
Example:
const { data: connection } = await zapier.getConnection();
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: connections, nextCursor } = await zapier.listConnections();
// Or iterate over all pages
for await (const page of zapier.listConnections()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const connection of zapier.listConnections().items()) {
// Do something with each connection
}
HTTP Requests
fetch
Make authenticated HTTP requests to any API through Zapier. Pass a connectionId to automatically inject the user’s stored credentials (OAuth tokens, API keys, etc.) into the outgoing request. Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.
Parameters:
| Name | Type | Required | 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. |
Returns: Promise<Response>
Example:
const result = await zapier.fetch("https://example.com", {});
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 |
Returns: 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 | |
Example:
const result = await zapier.createTable({
name: "example-name",
});
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 |
Returns: 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 | |
Example:
const result = await zapier.createTableFields({
table: "example-table",
fields: [
{
type: "string",
name: "example-name",
},
],
});
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). |
Returns: 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 | |
Example:
const result = await zapier.createTableRecords({
table: "example-table",
records: [
{
data: {},
},
],
});
deleteTable
Delete a table by its ID
Parameters:
| Name | Type | Required | Description |
|---|
options | object | Yes | |
↳ table | string | Yes | The unique identifier of the table |
Returns: Promise<{ success: boolean }>
Example:
const result = await zapier.deleteTable({
table: "example-table",
});
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). |
Returns: Promise<{ success: boolean }>
Example:
const result = await zapier.deleteTableFields({
table: "example-table",
fields: ["example-field"],
});
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 |
Returns: Promise<{ success: boolean }>
Example:
const result = await zapier.deleteTableRecords({
table: "example-table",
records: ["example-record"],
});
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 |
Returns: 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 | |
Example:
const { data: table } = await zapier.getTable({
table: "example-table",
});
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). |
Returns: 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 | |
Example:
const { data: record } = await zapier.getTableRecord({
table: "example-table",
record: "example-record",
});
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. |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: fields, nextCursor } = await zapier.listTableFields({
table: "example-table",
});
// Or iterate over all pages
for await (const page of zapier.listTableFields({
table: "example-table",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const field of zapier
.listTableFields({
table: "example-table",
})
.items()) {
// Do something with each field
}
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 | string | 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. |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: records, nextCursor } = await zapier.listTableRecords({
table: "example-table",
});
// Or iterate over all pages
for await (const page of zapier.listTableRecords({
table: "example-table",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const record of zapier
.listTableRecords({
table: "example-table",
})
.items()) {
// Do something with each record
}
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: tables, nextCursor } = await zapier.listTables();
// Or iterate over all pages
for await (const page of zapier.listTables()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const table of zapier.listTables().items()) {
// Do something with each table
}
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). |
Returns: 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 | |
Example:
const result = await zapier.updateTableRecords({
table: "example-table",
records: [
{
id: "example-id",
data: {},
},
],
});
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 |
Returns: Promise<DurableRunItem>
Example:
const result = await zapier.cancelDurableRun({
run: "example-run",
});
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 |
Returns: 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. |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
Example:
const result = await zapier.createWorkflow({
name: "example-name",
});
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 |
Returns: Promise<{ success: boolean }>
Example:
const result = await zapier.deleteWorkflow({
workflow: "example-workflow",
});
disableWorkflow
Disable a durable workflow so it stops accepting triggers
Parameters:
| Name | Type | Required | Description |
|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
Returns: 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. |
Example:
const result = await zapier.disableWorkflow({
workflow: "example-workflow",
});
enableWorkflow
Enable a durable workflow so it accepts triggers
Parameters:
| Name | Type | Required | Description |
|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
Returns: 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) |
Example:
const result = await zapier.enableWorkflow({
workflow: "example-workflow",
});
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 |
Returns: 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 | string | Yes | Input data passed to the run |
↳ output | string | 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) |
Example:
const { data: durableRun } = await zapier.getDurableRun({
run: "example-run",
});
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 |
Returns: 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 |
↳ 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) |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
↳ updated_at | string | Yes | When the workflow was last modified (ISO-8601) |
Example:
const { data: workflow } = await zapier.getWorkflow({
workflow: "example-workflow",
});
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 |
Returns: 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 | string | Yes | Input data passed to the run |
↳ output | string | 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 |
Example:
// Get first page and a cursor for the second page
const { data: durableRuns, nextCursor } = await zapier.listDurableRuns();
// Or iterate over all pages
for await (const page of zapier.listDurableRuns()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const durableRun of zapier.listDurableRuns().items()) {
// Do something with each durableRun
}
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 (server-side pagination forthcoming; ignored until then) |
↳ maxItems | number | No | Maximum total workflows to return across all pages |
↳ cursor | string | No | Cursor to start from for pagination (server-side pagination forthcoming; ignored until then) |
Returns: 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 |
↳ current_version_id | string | Yes | ID of the workflow version that runs handle. Null until a version is published. |
↳ 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 |
Example:
// Get first page and a cursor for the second page
const { data: workflows, nextCursor } = await zapier.listWorkflows();
// Or iterate over all pages
for await (const page of zapier.listWorkflows()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const workflow of zapier.listWorkflows().items()) {
// Do something with each workflow
}
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 | |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ input | string | No | Input data passed to the run |
↳ dependencies | object | No | Optional npm package dependencies |
↳ zapier_durable_version | 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 alias names to Zapier connection IDs. |
↳ app_versions | 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) |
Returns: 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) |
Example:
const result = await zapier.runDurable({
source_files: {},
});
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) |
Returns: 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 |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
↳ updated_at | string | Yes | When this update was applied (ISO-8601) |
Example:
const result = await zapier.updateWorkflow({
workflow: "example-workflow",
});
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. |
Returns: 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 | |
Example:
const result = await zapier.ackTriggerInboxMessages({
inbox: "example-inbox",
lease: "example-lease",
});
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 |
Returns: 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 | |
Example:
const result = await zapier.createTriggerInbox({
app: "example-app",
action: "example-action",
});
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. |
Returns: 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 | |
Example:
const result = await zapier.deleteTriggerInbox({
inbox: "example-inbox",
});
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. |
Returns: Promise<void>
Example:
const result = await zapier.drainTriggerInbox({
inbox: "example-inbox",
onMessage: async (message) => {
/* process message */
},
});
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 |
Returns: 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 | |
Example:
const result = await zapier.ensureTriggerInbox({
name: "example-name",
app: "example-app",
action: "example-action",
});
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. |
Returns: 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 | |
Example:
const { data: triggerInbox } = await zapier.getTriggerInbox({
inbox: "example-inbox",
});
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) |
Returns: Promise<any>
Example:
const result = await zapier.getTriggerInputFieldsSchema({
app: "example-app",
action: "example-action",
});
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. |
Returns: 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 |
Example:
const result = await zapier.leaseTriggerInboxMessages({
inbox: "example-inbox",
});
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: triggerMessages, nextCursor } =
await zapier.listTriggerInboxMessages({
inbox: "example-inbox",
});
// Or iterate over all pages
for await (const page of zapier.listTriggerInboxMessages({
inbox: "example-inbox",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const triggerMessage of zapier
.listTriggerInboxMessages({
inbox: "example-inbox",
})
.items()) {
// Do something with each triggerMessage
}
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: triggerInboxs, nextCursor } = await zapier.listTriggerInboxes();
// Or iterate over all pages
for await (const page of zapier.listTriggerInboxes()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const triggerInbox of zapier.listTriggerInboxes().items()) {
// Do something with each triggerInbox
}
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: inputFieldChoices, nextCursor } =
await zapier.listTriggerInputFieldChoices({
app: "example-app",
action: "example-action",
inputField: "example-input-field",
});
// Or iterate over all pages
for await (const page of zapier.listTriggerInputFieldChoices({
app: "example-app",
action: "example-action",
inputField: "example-input-field",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
.listTriggerInputFieldChoices({
app: "example-app",
action: "example-action",
inputField: "example-input-field",
})
.items()) {
// Do something with each inputFieldChoice
}
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 |
Returns: 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 |
When 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 | |
When type is "info_field":
| Name | Type | Required | Description |
|---|
type | string | Yes | |
key | string | Yes | |
description | string | Yes | |
title | string | No | |
When type is "fieldset":
| Name | Type | Required | Description |
|---|
type | string | Yes | |
key | string | Yes | |
title | string | Yes | |
fields | array | Yes | |
Example:
// Get first page and a cursor for the second page
const { data: rootFields, nextCursor } = await zapier.listTriggerInputFields({
app: "example-app",
action: "example-action",
});
// Or iterate over all pages
for await (const page of zapier.listTriggerInputFields({
app: "example-app",
action: "example-action",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const rootField of zapier
.listTriggerInputFields({
app: "example-app",
action: "example-action",
})
.items()) {
// Do something with each rootField
}
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 |
Returns: 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 |
Example:
// Get first page and a cursor for the second page
const { data: actions, nextCursor } = await zapier.listTriggers({
app: "example-app",
});
// Or iterate over all pages
for await (const page of zapier.listTriggers({
app: "example-app",
})) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const action of zapier
.listTriggers({
app: "example-app",
})
.items()) {
// Do something with each action
}
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. |
Returns: 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 | |
Example:
const result = await zapier.pauseTriggerInbox({
inbox: "example-inbox",
});
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. |
Returns: 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 | |
Example:
const result = await zapier.releaseTriggerInboxMessages({
inbox: "example-inbox",
lease: "example-lease",
});
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. |
Returns: 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 | |
Example:
const result = await zapier.resumeTriggerInbox({
inbox: "example-inbox",
});
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. |
Returns: 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 | |
Example:
const result = await zapier.updateTriggerInbox({
inbox: "example-inbox",
});
watchTriggerInbox
Continuously consume a trigger inbox: drain currently-available messages via onMessage, then poll with backoff for new arrivals, until aborted. Resolves cleanly on signal abort or ZapierAbortDrainSignal from a handler; rejects on fatal SDK errors or fail-fast handler errors.
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 empty-inbox poll attempts (default: 60). Caps the back-off cadence. |
Returns: Promise<void>
Example:
const result = await zapier.watchTriggerInbox({
inbox: "example-inbox",
onMessage: async (message) => {
/* process message */
},
});