Installation
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript
Initialization
Option 1: CLI Authentication Runningnpx zapier-sdk signup or npx zapier-sdk login authenticates through the CLI. As long as you have the CLI package installed as a development dependency, the SDK will automatically use that authentication.
import { createZapierSdk } from "@zapier/zapier-sdk";
const zapier = createZapierSdk();
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",
},
});
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 |
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 |
const { data: profile } = await zapier.getProfile();
Actions
createActionRun
Start an action run and return its ID without waiting for the result. Running an action is asynchronous: this hands back a run ID immediately, and getActionRun fetches the outcome. Reach for this pair when you want to start work and collect it later (fan out many runs, hand the ID to another process, survive a restart). runAction is the one-call form that starts a run and waits for its result.
Parameters:
| 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). Required if the action needs a connection to authenticate and interact with the service. Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
↳ inputs | object | No | Input parameters for the action |
↳ page | string | No | Page to fetch for bulk read actions. Pass the next_page a previous run returned to fetch the following page. |
↳ callbackUrl | string | No | URL Zapier posts the finished run to, so you do not have to poll for it. Must use HTTPS and resolve to a public host, so a local receiver needs a tunnel. The body matches what getActionRun returns. Verify the Zapier-Callback-Signature header, and expect the same run to arrive more than once. |
Promise<StartedActionRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Action run ID. Pass it as the run for getActionRun to fetch the run’s result. |
↳ implementation_id | string | Yes | Versioned implementation ID the run was started against (e.g. ‘SlackCLIAPI@1.21.1’). The versionless app key is the part before the @. |
const { data: startedActionRun } = await zapier.createActionRun({
app: "example-app",
actionType: "read",
action: "example-action",
});
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 |
const { data: action } = await zapier.getAction({
app: "example-app",
actionType: "read",
action: "example-action",
});
getActionInputFieldsSchema
Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action’s input parameters.
Parameters:
| Name | Type | Required | 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:
const { data: inputSchema } = await zapier.getActionInputFieldsSchema({
app: "example-app",
actionType: "read",
action: "example-action",
});
getActionRun
Fetch the current state of an action run started by createActionRun. This is a point-in-time read that returns immediately: a run Zapier has not finished executing comes back with status waiting, so call again to check for a result. runAction starts a run and waits for its result in one call. Results are stored for seven days after the run was created.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ run | string | Yes | Action run ID returned by createActionRun |
Promise<ActionRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Action run ID |
↳ status | string | Yes | Where the run is in its lifecycle. waiting means Zapier is still executing it; error means the app returned a failure (details in errors). unknown means the response carried no status, so the outcome could not be determined — treat it as inconclusive rather than as success. |
↳ results | array | Yes | Records the action produced. Can be empty even on a successful run. |
↳ next_page | string | No | For bulk read actions, the following page. Pass it back as the page for createActionRun to fetch that page. |
↳ errors[] | object[] | Yes | Errors the app returned while running the action |
↳ code | string | No | Machine-readable error category |
↳ title | string | No | Short error label |
↳ detail | string | No | Human-readable error detail |
const { data: actionRun } = await zapier.getActionRun({
run: "example-run",
});
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 |
// 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",
})
.pages()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
.listActionInputFieldChoices({
app: "example-app",
actionType: "read",
action: "example-action",
inputField: "example-input-field",
})
.items()) {
// Do something with each inputFieldChoice
}
listActionInputFields
Get the input fields required for a specific action
Parameters:
| Name | Type | Required | 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 |
// 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",
})
.pages()) {
// 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 |
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 |
// 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",
})
.pages()) {
// 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 |
↳ timeoutSeconds | number | No | Maximum time to wait for action completion in seconds (default: 180) |
↳ 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:
// 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",
})
.pages()) {
// 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. |
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. |
↳ timeoutSeconds | number | No | Maximum time to wait for action completion in seconds (default: 180) |
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().pages()) {
// 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’) |
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 |
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. The upstream API may cap this and reject values above its limit. |
↳ 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 |
// 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().pages()) {
// 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 |
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) |
const { data: clientCredentials } = 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 |
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 |
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 |
// 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().pages()) {
// 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
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. |
↳ timeoutSeconds | number | No | How long to wait for the user to complete the connection flow before giving up. Default 5 minutes (300). |
↳ pollIntervalMilliseconds | 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. |
const { data: connection } = await zapier.createConnection({
app: "example-app",
});
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. |
↳ status | string | No | Filter connections by expiry: ‘active’ (default) returns only non-expired connections, ‘expired’ only expired ones, and ‘all’ returns both. |
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 |
↳ slug | string | No | Human-readable app slug for this connection’s integration (e.g. ‘google-sheets’). Null when no slug is registered for the app. |
↳ 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 |
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. |
↳ status | string | No | Filter connections by expiry: ‘active’ (default) returns only non-expired connections, ‘expired’ only expired ones, and ‘all’ returns both. |
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 |
↳ slug | string | No | Human-readable app slug for this connection’s integration (e.g. ‘google-sheets’). Null when no slug is registered for the app. |
↳ 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 |
const { data: connection } = await zapier.findUniqueConnection();
getConnection
Get details for a specific connection
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ connection | string, number | Yes | 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 |
↳ slug | string | No | Human-readable app slug for this connection’s integration (e.g. ‘google-sheets’). Null when no slug is registered for the app. |
↳ 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 |
const { data: connection } = await zapier.getConnection({
connection: "example-connection",
});
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):
const {
data: { url, app, startedAt },
} = await zapier.getConnectionStartUrl({ app: "slack" });
// hand `url` off — print it, DM it, email it, render a button, whatever
const { data: conn } = await zapier.waitForNewConnection({ app, startedAt });
| 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. |
const { data: connectionStartUrl } = await zapier.getConnectionStartUrl({
app: "example-app",
});
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. |
↳ status | string | No | Filter connections by expiry: ‘active’ (default) returns only non-expired connections, ‘expired’ only expired ones, and ‘all’ returns both. |
↳ pageSize | number | No | Number of connections per page. The upstream API may cap this and reject values above its limit. |
↳ 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 |
↳ slug | string | No | Human-readable app slug for this connection’s integration (e.g. ‘google-sheets’). Null when no slug is registered for the app. |
↳ 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 |
// 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().pages()) {
// 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
}
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):
const {
data: { url, app, startedAt },
} = await zapier.getConnectionStartUrl({ app: "slack" });
// show `url` to the user via the channel they're reading from
const { data: conn } = await zapier.waitForNewConnection({ app, startedAt });
| 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. |
↳ timeoutSeconds | number | No | How long to wait before giving up. Default 5 minutes (300). |
↳ pollIntervalMilliseconds | 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. |
const { data: connection } = await zapier.waitForNewConnection({
app: "example-app",
startedAt: 100,
});
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) |
↳ maxTimeSeconds | 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:
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 |
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 |
const { data: table } = 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 |
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 |
const { data: fields } = 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). |
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 |
const { data: records } = 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 |
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). |
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 |
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 |
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 |
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). |
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 |
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. |
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 |
// 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",
})
.pages()) {
// 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 | 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 |
// 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",
})
.pages()) {
// 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 |
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 |
// 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().pages()) {
// 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). |
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 |
const { data: records } = await zapier.updateTableRecords({
table: "example-table",
records: [
{
id: "example-id",
data: {},
},
],
});
Triggers
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 key. Non-UUID values are resolved by key 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 |
const { data: triggerInboxAck } = 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 key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ key | string | No | Optional inbox key. Auto-generated when omitted. Throws a conflict error if the key 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 | |
↳ key | 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 |
const { data: triggerInbox } = 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 key. Non-UUID values are resolved by key via the inbox list endpoint. |
Promise<{ success: boolean }>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ key | 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 |
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 key. Non-UUID values are resolved by key 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:
await zapier.drainTriggerInbox({
inbox: "example-inbox",
onMessage: async (message) => {
/* process message */
},
});
ensureTriggerInbox
Get-or-create a trigger inbox by key. Idempotent on (user, account, key): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the key exists with a different subscription.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ key | string | Yes | Inbox key; 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 | |
↳ key | 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 |
const { data: triggerInbox } = await zapier.ensureTriggerInbox({
key: "example-key",
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 key. Non-UUID values are resolved by key via the inbox list endpoint. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ key | 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 |
const { data: triggerInbox } = await zapier.getTriggerInbox({
inbox: "example-inbox",
});
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:
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 key. Non-UUID values are resolved by key 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 |
const { data: triggerInboxLease } = 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 key. Non-UUID values are resolved by key 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 |
// 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",
})
.pages()) {
// 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 | |
↳ key | string | No | Filter by inbox key (exact match). Keys 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 | |
↳ key | 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 |
// 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().pages()) {
// 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
}
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 |
// 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",
})
.pages()) {
// 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
}
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 |
// 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",
})
.pages()) {
// 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 |
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 |
// 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",
})
.pages()) {
// 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 key. Non-UUID values are resolved by key via the inbox list endpoint. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ key | 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 |
const { data: triggerInbox } = 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 key. Non-UUID values are resolved by key 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 |
const { data: triggerInboxRelease } = 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 key. Non-UUID values are resolved by key via the inbox list endpoint. |
Promise<TriggerInboxItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ created_at | string | Yes | |
↳ key | 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 |
const { data: triggerInbox } = 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 key. Non-UUID values are resolved by key 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 | |
↳ key | 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 |
const { data: triggerInbox } = await zapier.updateTriggerInbox({
inbox: "example-inbox",
});
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 key. Non-UUID values are resolved by key 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:
await zapier.watchTriggerInbox({
inbox: "example-inbox",
onMessage: async (message) => {
/* process message */
},
});
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. |
const { data: durableRun } = 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 |
↳ 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 URL that fires this workflow when POSTed to. Embeds a trigger token in the path — treat as sensitive. Requests must also be authenticated as the account. |
↳ 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) |
const { data: workflow } = await zapier.createWorkflow({
name: "example-name",
});
createWorkflowDraft
Fork a new draft from the workflow’s current live version (or a blank stub before the first publish)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ slug | string | No | Optional slug for URL routing. When omitted, the server generates one. |
Promise<WorkflowDraftItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this draft |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this draft (or null) |
↳ draft_revision | number | Yes | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ created_by_user_id | string | Yes | ID of the user who created (forked) this draft |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ discarded_at | string | Yes | When the draft was discarded (ISO-8601), or null while open |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
↳ updated_at | string | Yes | When the draft row was last updated (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration held on this draft, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this draft (or null). |
↳ app_versions | object | Yes | App-version pins bound on this draft (or null). |
const { data: workflowDraft } = await zapier.createWorkflowDraft({
workflow: "example-workflow",
});
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 |
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 |
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. |
const { data: workflow } = await zapier.disableWorkflow({
workflow: "example-workflow",
});
discardWorkflowDraft
Discard an open workflow draft (soft delete). The draft’s unpublished edits stop resolving; the published version is untouched.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ draft | string | Yes | Workflow draft ID |
Promise<WorkflowDraftItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this draft |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this draft (or null) |
↳ draft_revision | number | Yes | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ created_by_user_id | string | Yes | ID of the user who created (forked) this draft |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ discarded_at | string | Yes | When the draft was discarded (ISO-8601), or null while open |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
↳ updated_at | string | Yes | When the draft row was last updated (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration held on this draft, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this draft (or null). |
↳ app_versions | object | Yes | App-version pins bound on this draft (or null). |
const result = await zapier.discardWorkflowDraft({
workflow: "example-workflow",
draft: "example-draft",
});
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) |
const { data: workflow } = 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 |
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) |
const { data: durableRun } = await zapier.getDurableRun({
run: "example-run",
});
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 code-substrate-runner 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) |
const { data: workflowRun } = await zapier.getTriggerRun({
trigger: "example-trigger",
});
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 URL that fires this workflow when POSTed to. Embeds a trigger token in the path — treat as sensitive. Requests must also be authenticated as the account. |
↳ 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’. |
↳ details | object | No | Trigger-type-specific metadata; shape varies by trigger type (e.g. webhook_url on catch-hook triggers). Null or absent when none applies. |
↳ created_at | string | Yes | When the workflow was created (ISO-8601) |
↳ updated_at | string | Yes | When the workflow was last modified (ISO-8601) |
const { data: workflow } = await zapier.getWorkflow({
workflow: "example-workflow",
});
getWorkflowDraft
Get full details of a workflow draft including source files
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ draft | string | Yes | Workflow draft ID |
Promise<WorkflowDraftItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this draft |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this draft (or null) |
↳ draft_revision | number | Yes | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ created_by_user_id | string | Yes | ID of the user who created (forked) this draft |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ discarded_at | string | Yes | When the draft was discarded (ISO-8601), or null while open |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
↳ updated_at | string | Yes | When the draft row was last updated (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration held on this draft, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this draft (or null). |
↳ app_versions | object | Yes | App-version pins bound on this draft (or null). |
const { data: workflowDraft } = await zapier.getWorkflowDraft({
workflow: "example-workflow",
draft: "example-draft",
});
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 code-substrate-runner 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) |
const { data: workflowRun } = await zapier.getWorkflowRun({
run: "example-run",
});
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). |
const { data: workflowVersion } = await zapier.getWorkflowVersion({
workflow: "example-workflow",
version: "example-version",
});
importWorkflow
Convert an existing Zap into a durable workflow. Transforms the Zap’s latest published version (falling back to its draft only when the Zap has never been published) and puts the resulting source in an open draft. The workflow is created disabled with no published version, so publish the draft to make it live. The original Zap is untouched and keeps running.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ zap | string | Yes | ID of the Zap to import. Must be owned by the requesting user. Recorded on the created workflow as source_zap_id. |
↳ name | string | No | Name for the created workflow. Defaults to a kebab-cased form of the Zap’s title, or “imported-workflow” when the Zap has no title. |
↳ private | boolean | No | Restrict the created workflow to the creating user. Defaults to false, which makes it account-visible. |
Promise<ImportWorkflowResponse>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ workflow | object | Yes | The created workflow. Disabled, with no published version, and source_zap_id set to the imported Zap. |
↳ id | string | Yes | Workflow ID (UUID) |
↳ name | string | Yes | Workflow name |
↳ description | string | No | Optional workflow description (null if unset) |
↳ trigger_url | string | Yes | Public URL that fires this workflow when POSTed to. Embeds a trigger token in the path — treat as sensitive. Requests must also be authenticated as the account. |
↳ enabled | boolean | Yes | Whether the workflow accepts triggers. An import always lands disabled. |
↳ disabled_reason | string | No | Why the workflow is off, when system-disabled. |
↳ is_private | boolean | Yes | Whether the workflow is private to the creating user. False means account-visible. |
↳ source_zap_id | string | No | The Zap this workflow was imported from. |
↳ created_by_user_id | string | Yes | |
↳ updated_by_user_id | string | No | |
↳ current_version_id | string | No | Null on a fresh import, which has no published version yet. |
↳ triggers[] | object[] | Yes | Empty on a fresh import, which has no published version yet. |
↳ 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’. |
↳ details | object | No | Trigger-type-specific metadata; shape varies by trigger type (e.g. webhook_url on catch-hook triggers). Null or absent when none applies. |
↳ created_at | string | Yes | |
↳ updated_at | string | No | |
↳ draft | object | Yes | The open draft holding the transformed source. |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this draft |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this draft (or null) |
↳ draft_revision | number | Yes | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ created_by_user_id | string | Yes | ID of the user who created (forked) this draft |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ discarded_at | string | Yes | When the draft was discarded (ISO-8601), or null while open |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
↳ updated_at | string | Yes | When the draft row was last updated (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration held on this draft, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this draft (or null). |
↳ app_versions | object | Yes | App-version pins bound on this draft (or null). |
↳ issues[] | object[] | Yes | Blocking and non-blocking translation issues from the transform, passed through unchanged. Blocking issues do not prevent draft creation; they must be resolved before the draft will publish. |
↳ line | number | Yes | 1-based line in the generated source the issue relates to, or 0 when not line-specific. |
↳ column | number | Yes | 1-based column, or 0 when not column-specific. |
↳ node_kind | string | Yes | Category of the issue, used to group and message them, e.g. “invalid-connection-id”, “DelayStep”, “app-version-conflict”. |
↳ step_name | string | No | ZDL step id or name the issue originated from, when known. |
↳ message | string | Yes | Human-readable description of the issue. |
↳ blocking | boolean | Yes | Whether the issue must be resolved before the draft can be published. Computed server-side, so callers do not re-derive it. A blocking issue does not prevent the draft being created. |
const { data: workflow } = await zapier.importWorkflow({
zap: "example-zap",
});
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 |
// 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().pages()) {
// 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
}
listWorkflowDrafts
List drafts for a workflow, most recently edited first (open drafts by default)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ status | string | No | Filter by draft status (server default: open) |
↳ slug | string | No | Filter by exact slug match; returns at most one draft |
↳ pageSize | number | No | Number of drafts per page (max 100) |
↳ cursor | string | No | Pagination cursor |
↳ maxItems | number | No | Maximum total drafts to return across all pages |
Promise<PaginatedResult<WorkflowDraftItem>>
| Name | Type | Required | Description |
|---|---|---|---|
data[] | object[] | Yes | |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
nextCursor | string | No | Cursor for the next page; omitted when there are no more pages |
// Get first page and a cursor for the second page
const { data: workflowDrafts, nextCursor } = await zapier.listWorkflowDrafts({
workflow: "example-workflow",
});
// Or iterate over all pages
for await (const page of zapier
.listWorkflowDrafts({
workflow: "example-workflow",
})
.pages()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const workflowDraft of zapier
.listWorkflowDrafts({
workflow: "example-workflow",
})
.items()) {
// Do something with each workflowDraft
}
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 code-substrate-runner 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 |
// Get first page and a cursor for the second page
const { data: workflowRuns, nextCursor } = await zapier.listWorkflowRuns({
workflow: "example-workflow",
});
// Or iterate over all pages
for await (const page of zapier
.listWorkflowRuns({
workflow: "example-workflow",
})
.pages()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const workflowRun of zapier
.listWorkflowRuns({
workflow: "example-workflow",
})
.items()) {
// Do something with each workflowRun
}
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 |
// Get first page and a cursor for the second page
const { data: workflowVersions, nextCursor } =
await zapier.listWorkflowVersions({
workflow: "example-workflow",
});
// Or iterate over all pages
for await (const page of zapier
.listWorkflowVersions({
workflow: "example-workflow",
})
.pages()) {
// Do something with each page
}
// Or iterate over individual items across all pages
for await (const workflowVersion of zapier
.listWorkflowVersions({
workflow: "example-workflow",
})
.items()) {
// Do something with each workflowVersion
}
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 URL that fires this workflow when POSTed to. Embeds a trigger token in the path — treat as sensitive. Requests must also be authenticated as the account. |
↳ 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’. |
↳ details | object | No | Trigger-type-specific metadata; shape varies by trigger type (e.g. webhook_url on catch-hook triggers). Null or absent when none applies. |
↳ 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 |
// 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().pages()) {
// 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
}
publishWorkflowDraft
Publish an open draft as a new immutable workflow version. Advances the workflow’s live pointer and discards the draft — publish consumes it, so an open draft always means unpublished work. Continue editing by creating a new draft, which forks from the just-published version.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ draft | string | Yes | Workflow draft ID |
↳ enabled | boolean | No | Set the workflow’s enabled state as part of the publish. If omitted, the current enabled state is preserved. |
↳ draftRevision | number | No | Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the publish with a conflict if the draft has changed since. Omit to skip the check. |
↳ manual | boolean | No | Declare this publish on-demand and triggerless, overriding the draft’s stored intent for this publish only. Pass manual: true only when the draft has no trigger configured; the API rejects a draft with a trigger published as manual: true as a contradiction (400). |
Promise<PublishWorkflowDraftResponse>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ draft | object | Yes | The consumed draft: status is ‘discarded’ and discarded_at is set. base_version_id still records the version the draft was forked from. |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this draft |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this draft (or null) |
↳ draft_revision | number | Yes | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ created_by_user_id | string | Yes | ID of the user who created (forked) this draft |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ discarded_at | string | Yes | When the draft was discarded (ISO-8601), or null while open |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
↳ updated_at | string | Yes | When the draft row was last updated (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration held on this draft, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this draft (or null). |
↳ app_versions | object | Yes | App-version pins bound on this draft (or null). |
↳ version | object | Yes | The newly published immutable workflow version, now live. |
↳ 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). |
const { data: workflowVersion } = await zapier.publishWorkflowDraft({
workflow: "example-workflow",
draft: "example-draft",
});
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 if omitted; pass false to publish without enabling. |
↳ ignoreOpenDrafts | boolean | No | Publish even though the workflow has open draft(s). Without this, the API rejects a direct publish with a 409 while any draft is open, since publishing the draft later would ship its stale content over this version. |
↳ 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; for an on-demand, triggerless workflow, omit this and pass manual: true instead. |
↳ 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 |
↳ manual | boolean | No | Declare this an on-demand, triggerless workflow version. Pass manual: true only when omitting trigger; passing both is a contradiction the API rejects with a 400. |
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). |
const { data: workflowVersion } = await zapier.publishWorkflowVersion({
workflow: "example-workflow",
sourceFiles: {},
});
runDurable
Run a workflow source file as a run-once durable run on code-substrate-runner (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. Accepts any JSON value, or its JSON-string encoding. |
↳ 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) |
const { data: durableRun } = await zapier.runDurable({
sourceFiles: {},
});
triggerWorkflow
Look up a workflow’s trigger URL and fire it manually, as the authenticated account.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ input | unknown | No | JSON payload delivered as the trigger body. Accepts any JSON value, or its JSON-string encoding. Sent as application/json; omit to fire with an empty body. |
Promise<WorkflowRunItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Trigger ID (UUID) |
↳ workflow_id | string | Yes | The workflow that was triggered (UUID) |
↳ created_at | string | Yes | When the trigger was received (ISO-8601) |
const { data: workflowRun } = await zapier.triggerWorkflow({
workflow: "example-workflow",
});
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 URL that fires this workflow when POSTed to. Embeds a trigger token in the path — treat as sensitive. Requests must also be authenticated as the account. |
↳ 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) |
const { data: workflow } = await zapier.updateWorkflow({
workflow: "example-workflow",
});
updateWorkflowDraft
Update (autosave) an open workflow draft
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ workflow | string | Yes | Durable workflow ID |
↳ draft | string | Yes | Workflow draft ID |
↳ sourceFiles | object | Yes | Source files keyed by filename → contents |
↳ zapierDurableVersion | string | No | Exact semver of @zapier/zapier-durable to use (e.g. “1.2.3”). Leaves the stored pin unchanged if omitted. |
↳ dependencies | object | No | Optional npm package dependencies |
↳ draftRevision | number | No | Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the save with a conflict if the draft has changed since. Omit to skip the check. |
↳ trigger | object | No | Trigger configuration. Omit to leave the stored trigger unchanged, pass null to clear it, or pass an object to replace it; for an on-demand, triggerless workflow, clear this and pass manual: true instead. |
↳ 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. |
↳ manual | boolean | No | Declare this draft on-demand and triggerless. Pass manual: true only when omitting trigger (or clearing it with trigger: null); passing both is a contradiction the API rejects with a 400. Setting a trigger later clears a previously stored manual: true. |
Promise<WorkflowDraftItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | Workflow draft ID (UUID) |
↳ workflow_id | string | Yes | Parent workflow ID (UUID) |
↳ slug | string | Yes | Human-friendly identifier for URL routing; unique among open drafts per workflow |
↳ base_version_id | string | Yes | The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet |
↳ source_files | object | Yes | Source files keyed by filename → contents |
↳ zapier_durable_version | string | Yes | Pinned semver of @zapier/zapier-durable used by this draft |
↳ dependencies | object | Yes | Additional npm dependencies pinned for this draft (or null) |
↳ draft_revision | number | Yes | Monotonic revision counter for optimistic concurrency. Echo it back on draft updates to detect concurrent edits. |
↳ status | string | Yes | Lifecycle status of a workflow draft. |
↳ created_by_user_id | string | Yes | ID of the user who created (forked) this draft |
↳ last_edited_by_user_id | string | Yes | ID of the user who last saved this draft (or null) |
↳ last_edited_at | string | Yes | When the draft was last edited (ISO-8601, or null) |
↳ discarded_at | string | Yes | When the draft was discarded (ISO-8601), or null while open |
↳ created_at | string | Yes | When the draft was created (ISO-8601) |
↳ updated_at | string | Yes | When the draft row was last updated (ISO-8601) |
↳ trigger | object | Yes | Trigger configuration held on this draft, or null for webhook-only workflows. |
↳ connections | object | Yes | Connection aliases bound on this draft (or null). |
↳ app_versions | object | Yes | App-version pins bound on this draft (or null). |
const { data: workflowDraft } = await zapier.updateWorkflowDraft({
workflow: "example-workflow",
draft: "example-draft",
sourceFiles: {},
});
validateWorkflow
Validate durable workflow source without publishing it. Returns source diagnostics; issue kinds are extensible and may be unfamiliar to the client.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ sourceFiles | object | Yes | Exact TypeScript sources keyed by absolute logical path. |
↳ entrypointFile | string | No | Absolute logical path of the entry file in sourceFiles. Defaults to /workflow.ts. |
Promise<WorkflowValidationItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ issues[] | object[] | Yes | Source diagnostics, or an empty array when validation passes. |
↳ kind | string | Yes | Extensible diagnostic category; clients must accept unfamiliar values. |
↳ message | string | Yes | Safe human-readable explanation. |
↳ severity | string | Yes | Diagnostic severity. |
↳ suggestion | string | No | Actionable fix hint. |
↳ source | object | No | Affected source location. |
↳ file_id | string | Yes | Source file containing the diagnostic. |
↳ start_line | number | Yes | Inclusive 1-based start line. |
↳ start_column | number | Yes | Inclusive 1-based start column. |
↳ end_line | number | Yes | Inclusive 1-based end line. |
↳ end_column | number | Yes | Inclusive 1-based end column. |
↳ source_excerpt | string | No | Source text the diagnostic was raised against, truncated to 240 characters. |
↳ syntax_kind | string | No | TypeScript AST node kind the diagnostic was raised against (e.g. CallExpression). |
const { data: workflowValidation } = await zapier.validateWorkflow({
sourceFiles: {
"/workflow.ts":
'import { defineDurable } from "@zapier/zapier-durable"; export default defineDurable("hello-world", async (ctx, input) => { return ctx.step("greet", async () => "Hello, world!"); });',
},
});
Human Inputs (Experimental)
ℹ️ Experimental. Import from "@zapier/zapier-sdk/experimental" to use these methods. Methods and behavior may change.
createForm
Create a Zapier Form from a title and optional fields. Forms publish by default and return a shareable hosted_url; set draft to save without publishing.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ title | string | Yes | The title shown in the Forms UI and on the form. |
↳ description | string | No | An optional description of the form. |
↳ fields[] | object[] | No | Initial fields to add to the form. |
↳ label | string | Yes | Human-readable label shown above the input. |
↳ type | string | Yes | The type of field. |
↳ required | boolean | No | Whether the field must be answered before the form can submit. |
↳ disabled | boolean | No | When true, the field is rendered read-only — shown but not editable. A rendering hint only; it is not enforced during submission validation. |
↳ variant | string | No | For yes_no fields: checkbox renders a single toggle, radio renders explicit yes/no buttons. Defaults to checkbox. |
↳ multiUrl | boolean | No | For url fields: when true the field accepts a list of URLs, otherwise a single URL. Defaults to false. |
↳ includeTime | boolean | No | For date and date_range fields: when true the picker also captures a time. Defaults to false. |
↳ currencyFormat | string | No | For currency fields: ISO 4217 currency code (e.g. usd, eur). Controls the symbol shown in the form UI. |
↳ decimals | literal | No | For currency fields: allowed decimal places. 0 for whole numbers, 2 for up to two decimal places. Defaults to 2. |
↳ defaultCountry | string | No | For phone_number fields: ISO 3166-1 alpha-2 code for the default selected country (e.g. US). Defaults to US. |
↳ phoneNumberFormat | string | No | For phone_number fields: national omits the country-code prefix, international includes it. Defaults to national. |
↳ acceptedCountries | array | No | For phone_number fields: restrict input to specific ISO 3166-1 alpha-2 country codes. Omit to allow all countries. |
↳ options[] | object[] | No | For dropdown fields: the selectable options. At least one is required. |
↳ value | string | Yes | The value submitted when this option is selected. |
↳ label | string | Yes | Human-readable label shown to the user. |
↳ multiSelect | boolean | No | For dropdown fields: when true the user may select multiple options. Defaults to false. |
↳ dataSource | object | No | For integration_backed fields: where to fetch the field’s options from at render time. |
↳ app | string | Yes | Zapier app to pull options from. See listApps for the catalog. |
↳ actionType | string | Yes | Whether the data source returns a single record (read) or a collection (read_bulk). |
↳ resource | string | Yes | Resource name within the app — typically a trigger or search key from the app’s definition. |
↳ valueKey | string | No | Property on each returned record to use as the submitted option value. Defaults to id. |
↳ labelKey | string | No | Property on each returned record to use as the displayed option label. Defaults to a sensible name field. |
↳ draft | boolean | No | When true, save without publishing. Omit to publish immediately, making hosted_url live. |
↳ confirmationTitle | string | No | Heading shown to the respondent after they submit. Omit to use the form renderer’s default. |
↳ confirmationMessage | string | No | Message shown to the respondent after they submit, below the confirmation title. Omit to use the form renderer’s default. |
↳ callbackUrl | string | No | Absolute http/https URL notified with the submission JSON each time the form is answered. |
↳ consumerAuth | string | No | Who may open the published form. none (the default) leaves it public to anyone with the link; zapier requires the visitor to be signed in to Zapier on the form’s owning account. |
↳ document | object | No | Escape hatch: a complete form document tree, sent as-is. When supplied it replaces the document built from fields, and title, description, confirmationTitle, and confirmationMessage are ignored. Use only for structures the flat field list cannot express, such as approval decisions or multi-column row layout. |
↳ id | string | Yes | |
↳ type | string | Yes | |
↳ attrs | object | Yes | |
↳ schema_version | number | Yes | |
↳ title | string | Yes | |
↳ children | array | No |
Promise<FormItem>
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | |
↳ id | string | Yes | |
↳ title | string | Yes | |
↳ description | string | No | |
↳ hosted_url | string | Yes | |
↳ submission_count | number | Yes | |
↳ account_id | number | Yes | |
↳ owner_id | string | Yes | |
↳ created_at | string | Yes | |
↳ updated_at | string | Yes | |
↳ document | unknown | Yes | |
↳ last_published_at | string | Yes | |
↳ consumer_auth | unknown | Yes | |
↳ callback_url | unknown | Yes |
const { data: form } = await zapier.createForm({
title: "example-title",
});