Installation
Initialization
Option 1: Browser-based auth Runningnpx zapier-sdk login authenticates through your browser and stores a token on your local machine. As long as you have the CLI package installed as a development dependency, the SDK will automatically use it.
npx zapier-sdk create-client-credentials. This allows you to run the SDK in a server/serverless environment.
Accounts
getProfile
Get current user’s profile information
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | No |
Promise<ProfileItem>
Example:
Actions
getAction
Get detailed information about a specific action
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKey | string | Yes | App key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ actionKey | string | Yes | Action key to execute |
Promise<ActionItem>
Example:
getInputFieldsSchema
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 | |
↳ appKey | 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 |
↳ actionKey | string | Yes | Action key to get the input schema for |
↳ connectionId | string, number | No | Connection ID to use when fetching the schema. Required if the action 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<InputSchemaItem>
Example:
listActions
List all actions for a specific app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKey | 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>>
Example:
listInputFieldChoices
Get the available choices for a dynamic dropdown input field
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKey | string | Yes | App key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ actionKey | string | Yes | Action key to execute |
↳ inputFieldKey | string | Yes | Input field key to get choices for. |
↳ connectionId | string, number | No | Connection ID to use when listing available field choices. Required if the action 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>>
Example:
listInputFields
Get the input fields required for a specific action
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKey | string | Yes | App key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ actionKey | string | Yes | Action key to execute |
↳ connectionId | string, number | No | Connection ID to use when listing input fields. Required if the action 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<RootFieldItemItem>>
Example:
runAction
Execute an action with the given inputs
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKey | string | Yes | App key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ actionType | string | Yes | Action type that matches the action’s defined type |
↳ actionKey | string | Yes | Action key to execute |
↳ connectionId | string, number | No | Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service. |
↳ inputs | object | No | Input parameters for the action |
↳ timeoutMs | number | No | Maximum time to wait for action completion in milliseconds (default: 180000) |
↳ pageSize | number | No | Number of results per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ActionResultItem>>
Example:
Apps
apps.{appKey}
Bind a connection ID to an app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ connectionId | string, number | No | Connection ID to use for this action |
Promise<AppProxy>
Example:
apps.{appKey}.{actionType}.{actionKey}
Execute an action with the given inputs for the bound app, as an alternative to runAction
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ inputs | object | No | |
↳ connectionId | string, number | No | Connection ID to use for this action |
↳ timeoutMs | number | No | Maximum time to wait for action completion in milliseconds (default: 180000) |
Promise<PaginatedResult<ActionResultItem>>
Example:
getApp
Get detailed information about a specific app
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKey | string | Yes | App key of app to fetch (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
Promise<AppItem>
Example:
listApps
List all available apps with optional filtering
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ appKeys | array | No | Filter apps by app keys (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ search | string | No | Search term to filter apps by name |
↳ pageSize | number | No | Number of apps per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<AppItem>>
Example:
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<any>
Example:
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<any>
Example:
listClientCredentials
List client credentials for the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ pageSize | number | No | Number of credentials per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ClientCredentialsItem>>
Example:
Connections
findFirstConnection
Find the first connection matching the criteria
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ search | string | No | Search term to filter connections by title |
↳ title | string | No | Filter connections by exact title match (searches first, then filters locally) |
↳ owner | string | No | Filter by owner, ‘me’ for your own connections or a specific user ID |
↳ appKey | string | No | App key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ accountId | string | No | Account ID to filter by |
↳ isExpired | boolean | No | Filter by expired status |
Promise<ConnectionItem>
Example:
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 |
↳ appKey | string | No | App key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ accountId | string | No | Account ID to filter by |
↳ isExpired | boolean | No | Filter by expired status |
Promise<ConnectionItem>
Example:
getConnection
Execute getConnection
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ connectionId | string, number | No | Connection ID to use for this action |
Promise<ConnectionItem>
Example:
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 |
↳ appKey | string | No | App key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’) |
↳ connectionIds | array | No | List of connection IDs to filter by |
↳ accountId | string | No | Account ID to filter by |
↳ isExpired | boolean | No | Filter by expired status |
↳ pageSize | number | No | Number of connections per page |
↳ maxItems | number | No | Maximum total items to return across all pages |
↳ cursor | string | No | Cursor to start from |
Promise<PaginatedResult<ConnectionItem>>
Example:
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 |
↳ connectionId | string, number | No | Connection ID to use for this action |
↳ callbackUrl | string | No | URL to send async response to (makes request async) |
Promise<Response>
Example:
Tables
createTable
Create a new table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ name | string | Yes | The name for the new table |
↳ description | string | No | An optional description of the table |
Promise<any>
Example:
createTableFields
Create one or more fields in a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ fields | array | Yes | Array of field definitions to create |
Promise<any>
Example:
createTableRecords
Create one or more records in a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ records | array | Yes | Array of records to create (max 100) |
↳ 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<any>
Example:
deleteTable
Delete a table by its ID
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table to delete |
Promise<any>
Example:
deleteTableFields
Delete one or more fields from a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ fieldKeys | array | Yes | Fields to delete. Accepts field names (e.g., “Email”) or IDs (e.g., “f6”, “6”, or 6). |
Promise<any>
Example:
deleteTableRecords
Delete one or more records from a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ recordIds | array | Yes | Array of record IDs to delete (max 100) |
Promise<any>
Example:
getTable
Get detailed information about a specific table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table to retrieve |
Promise<TableItem>
Example:
getTableRecord
Get a single record from a table by ID
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ recordId | 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>
Example:
listTableFields
List fields for a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ fieldKeys | array | No | Filter by specific fields. Accepts field names (e.g., “Email”) or IDs (e.g., “f6”, “6”, or 6). |
Promise<PaginatedResult<FieldItem>>
Example:
listTableRecords
List records in a table with optional filtering and sorting
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ filters | array | No | Filter conditions for the query |
↳ 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). |
Promise<PaginatedResult<RecordItem>>
Example:
listTables
List tables available to the authenticated user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableIds | 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. |
↳ 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>>
Example:
updateTableRecords
Update one or more records in a table
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | object | Yes | |
↳ tableId | string | Yes | The unique identifier of the table |
↳ records | array | Yes | Array of records to update (max 100) |
↳ 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<any>
Example: