Skip to main content
This page documents all available methods in the Zapier SDK.

Installation

npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript

Initialization

Option 1: Browser-based auth Running npx zapier-sdk login authenticates through your browser and stores a token on your local machine. As long as you have the CLI package installed as a development dependency, the SDK will automatically use it.
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();
Option 2: Client credentials Provide a client ID and client secret. You can get these by running npx zapier-sdk create-client-credentials. This allows you to run the SDK in a server/serverless environment.
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk({
  credentials: {
    clientId: "your_client_id",
    clientSecret: "your_client_secret",
  },
});
Option 3: Direct token Provide a valid Zapier token. This is for partner OAuth or internal Zapier use.
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk({
  credentials: "your_zapier_token_here",
});

Accounts

getProfile

Get current user’s profile information Parameters:
NameTypeRequiredDescription
optionsobjectNo
Returns: Promise<ProfileItem> Example:
const { data: profile } = await zapier.getProfile();

Actions

getAction

Get detailed information about a specific action Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ actionTypestringYesAction type that matches the action’s defined type
↳ actionKeystringYesAction key to execute
Returns: Promise<ActionItem> Example:
const { data: action } = await zapier.getAction({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

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:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key (e.g., ‘SlackCLIAPI’ or slug like ‘github’) to get the input schema for
↳ actionTypestringYesAction type that matches the action’s defined type
↳ actionKeystringYesAction key to get the input schema for
↳ connectionIdstring, numberNoConnection ID to use when fetching the schema. Required if the action needs a connection to determine available fields.
↳ inputsobjectNoCurrent input values that may affect the schema (e.g., when fields depend on other field values)
Returns: Promise<InputSchemaItem> Example:
const { data: inputSchema } = await zapier.getInputFieldsSchema({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

listActions

List all actions for a specific app Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key of actions to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ actionTypestringNoFilter actions by type
↳ pageSizenumberNoNumber of actions per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<ActionItem>> Example:
// Get first page and a cursor for the second page
const { data: actions, nextCursor } = await zapier.listActions({
  appKey: "example-key",
});

// Or iterate over all pages
for await (const page of zapier.listActions({
  appKey: "example-key",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const action of zapier
  .listActions({
    appKey: "example-key",
  })
  .items()) {
  // Do something with each action
}

listInputFieldChoices

Get the available choices for a dynamic dropdown input field Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ actionTypestringYesAction type that matches the action’s defined type
↳ actionKeystringYesAction key to execute
↳ inputFieldKeystringYesInput field key to get choices for.
↳ connectionIdstring, numberNoConnection ID to use for this action
↳ inputsobjectNoCurrent input values that may affect available choices
↳ pagenumberNoPage number for paginated results
↳ pageSizenumberNoNumber of choices per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<InputFieldChoiceItem>> Example:
// Get first page and a cursor for the second page
const { data: inputFieldChoices, nextCursor } =
  await zapier.listInputFieldChoices({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
    inputFieldKey: "example-key",
  });

// Or iterate over all pages
for await (const page of zapier.listInputFieldChoices({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
  inputFieldKey: "example-key",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const inputFieldChoice of zapier
  .listInputFieldChoices({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
    inputFieldKey: "example-key",
  })
  .items()) {
  // Do something with each inputFieldChoice
}

listInputFields

Get the input fields required for a specific action Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ actionTypestringYesAction type that matches the action’s defined type
↳ actionKeystringYesAction key to execute
↳ connectionIdstring, numberNoConnection ID to use for this action
↳ inputsobjectNoCurrent input values that may affect available fields
↳ pageSizenumberNoNumber of input fields per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<RootFieldItemItem>> Example:
// Get first page and a cursor for the second page
const { data: rootFieldItems, nextCursor } = await zapier.listInputFields({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

// Or iterate over all pages
for await (const page of zapier.listInputFields({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const rootFieldItem of zapier
  .listInputFields({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
  })
  .items()) {
  // Do something with each rootFieldItem
}

runAction

Execute an action with the given inputs Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ actionTypestringYesAction type that matches the action’s defined type
↳ actionKeystringYesAction key to execute
↳ connectionIdstring, numberNoConnection ID to use for this action
↳ inputsobjectNoInput parameters for the action
↳ timeoutMsnumberNoMaximum time to wait for action completion in milliseconds (default: 180000)
↳ pageSizenumberNoNumber of results per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<ActionResultItem>> Example:
// Get first page and a cursor for the second page
const { data: actionResults, nextCursor } = await zapier.runAction({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
});

// Or iterate over all pages
for await (const page of zapier.runAction({
  appKey: "example-key",
  actionType: "read",
  actionKey: "example-key",
})) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const actionResult of zapier
  .runAction({
    appKey: "example-key",
    actionType: "read",
    actionKey: "example-key",
  })
  .items()) {
  // Do something with each actionResult
}

Apps

apps.{appKey}

Bind a connection ID to an app Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ connectionIdstring, numberNoConnection ID to use for this action
Returns: Promise<AppProxy> Example:
const result = await zapier.apps.appKey();

apps.{appKey}.{actionType}.{actionKey}

Execute an action with the given inputs for the bound app, as an alternative to runAction Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ inputsobjectNo
↳ connectionIdstring, numberNoConnection ID to use for this action
↳ timeoutMsnumberNoMaximum time to wait for action completion in milliseconds (default: 180000)
Returns: Promise<PaginatedResult<ActionResultItem>> Example:
// Get first page and a cursor for the second page
const { data: actionResults, nextCursor } =
  await zapier.apps.appKey.actionType.actionKey();

// Or iterate over all pages
for await (const page of zapier.apps.appKey.actionType.actionKey()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const actionResult of zapier.apps.appKey.actionType
  .actionKey()
  .items()) {
  // Do something with each actionResult
}

getApp

Get detailed information about a specific app Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeystringYesApp key of app to fetch (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
Returns: Promise<AppItem> Example:
const { data: app } = await zapier.getApp({
  appKey: "example-key",
});

listApps

List all available apps with optional filtering Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ appKeysarrayNoFilter apps by app keys (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ searchstringNoSearch term to filter apps by name
↳ pageSizenumberNoNumber of apps per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<AppItem>> Example:
// Get first page and a cursor for the second page
const { data: apps, nextCursor } = await zapier.listApps();

// Or iterate over all pages
for await (const page of zapier.listApps()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const app of zapier.listApps().items()) {
  // Do something with each app
}

Client Credentials

createClientCredentials

Create new client credentials for the authenticated user Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ namestringYesHuman-readable name for the client credentials
↳ allowedScopesarrayNoScopes to allow for these credentials
Returns: Promise<any> Example:
const result = await zapier.createClientCredentials({
  name: "example-value",
});

deleteClientCredentials

Delete client credentials by client ID Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ clientIdstringYesThe client ID of the client credentials to delete
Returns: Promise<any> Example:
const result = await zapier.deleteClientCredentials({
  clientId: "example-id",
});

listClientCredentials

List client credentials for the authenticated user Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ pageSizenumberNoNumber of credentials per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<ClientCredentialsItem>> Example:
// Get first page and a cursor for the second page
const { data: clientCredentials, nextCursor } =
  await zapier.listClientCredentials();

// Or iterate over all pages
for await (const page of zapier.listClientCredentials()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const clientCredentials of zapier.listClientCredentials().items()) {
  // Do something with each clientCredentials
}

Connections

findFirstConnection

Find the first connection matching the criteria Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ searchstringNoSearch term to filter connections by title
↳ titlestringNoFilter connections by exact title match (searches first, then filters locally)
↳ ownerstringNoFilter by owner, ‘me’ for your own connections or a specific user ID
↳ appKeystringNoApp key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ accountIdstringNoAccount ID to filter by
↳ isExpiredbooleanNoFilter by expired status
Returns: Promise<ConnectionItem> Example:
const { data: connection } = await zapier.findFirstConnection();

findUniqueConnection

Find a unique connection matching the criteria Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ searchstringNoSearch term to filter connections by title
↳ titlestringNoFilter connections by exact title match (searches first, then filters locally)
↳ ownerstringNoFilter by owner, ‘me’ for your own connections or a specific user ID
↳ appKeystringNoApp key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ accountIdstringNoAccount ID to filter by
↳ isExpiredbooleanNoFilter by expired status
Returns: Promise<ConnectionItem> Example:
const { data: connection } = await zapier.findUniqueConnection();

getConnection

Execute getConnection Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ connectionIdstring, numberNoConnection ID to use for this action
Returns: Promise<ConnectionItem> Example:
const { data: connection } = await zapier.getConnection();

listConnections

List available connections with optional filtering Parameters:
NameTypeRequiredDescription
optionsobjectYes
↳ searchstringNoSearch term to filter connections by title
↳ titlestringNoFilter connections by exact title match (searches first, then filters locally)
↳ ownerstringNoFilter by owner, ‘me’ for your own connections or a specific user ID
↳ appKeystringNoApp key of connections to list (e.g., ‘SlackCLIAPI’ or slug like ‘github’)
↳ connectionIdsarrayNoList of connection IDs to filter by
↳ accountIdstringNoAccount ID to filter by
↳ isExpiredbooleanNoFilter by expired status
↳ pageSizenumberNoNumber of connections per page
↳ maxItemsnumberNoMaximum total items to return across all pages
↳ cursorstringNoCursor to start from
Returns: Promise<PaginatedResult<ConnectionItem>> Example:
// Get first page and a cursor for the second page
const { data: connections, nextCursor } = await zapier.listConnections();

// Or iterate over all pages
for await (const page of zapier.listConnections()) {
  // Do something with each page
}

// Or iterate over individual items across all pages
for await (const connection of zapier.listConnections().items()) {
  // Do something with each connection
}

HTTP Requests

fetch

Make authenticated HTTP requests to any API through Zapier. Pass a connectionId to automatically inject the user’s stored credentials (OAuth tokens, API keys, etc.) into the outgoing request. Mirrors the native fetch(url, init?) signature with additional Zapier-specific options. Parameters:
NameTypeRequiredDescription
urlstring, customYesThe full URL of the API endpoint to call (proxied through Zapier’s Relay service)
initobjectNoRequest options including method, headers, body, and authentication
↳ methodstringNoHTTP method for the request (defaults to GET)
↳ headersobjectNoHTTP headers to include in the request
↳ bodystring, custom, custom, recordNoRequest body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly
↳ connectionIdstring, numberNoConnection ID to use for this action
↳ callbackUrlstringNoURL to send async response to (makes request async)
Returns: Promise<Response> Example:
const result = await zapier.fetch("example-value", { key: "value" });