@zapier/zapier-sdk
Table of Contents
Documentation
The official documentation is available at:
https://docs.zapier.com/sdk
Agents are sometimes blocked from viewing docs on npm, so you may want to provide them a link to the official docs or copy the docs here into a prompt.
Quick Start
For new projects.
The following will create a new project from scratch, set up the SDK and the SDK CLI, and give you a working starter example to get you going:
npx @zapier/zapier-sdk-cli init my-zapier-app
npx @zapier/zapier-sdk-cli init my-zapier-app --skip-prompts
Installation
For existing projects.
If you already have a project and want to start integrating apps through Zapier using the SDK:
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript
Walkthrough
Assuming you've installed the CLI package into your project (see instructions above), you (or an agent) can start using it right away. This is useful for introspecting actions, connections, etc. that you want to use in code, but you can also use it to directly use integrations.
npx zapier-sdk --help
npx zapier-sdk login
npx zapier-sdk list-apps --search "gmail"
npx zapier-sdk run-action gmail
npx zapier-sdk list-connections gmail
npx zapier-sdk list-connections gmail --owner me
npx zapier-sdk find-first-connection gmail --owner me
npx zapier-sdk fetch "https://gmail.googleapis.com/gmail/v1/users/me/labels" --connection-id 123
The following is optional, but if you want to call our actions from code, it can be helpful to install TypeScript types for those actions. You can also just use fetch to make arbitrary API requests. In that case, you don't really need this, and instead you might need types or a good agent that will look up third party API docs.
npx zapier-sdk list-apps --search "slack"
npx zapier-sdk list-apps --search "google sheets"
npx zapier-sdk add slack google-sheets
npx zapier-sdk add slack google-sheets --types-output ./types
Now let's write some code!
import { createZapierSdk } from "@zapier/zapier-sdk";
const zapier = createZapierSdk();
const { data: firstPageApps, nextCursor } = await zapier.listApps();
const { data: secondPageApps } = await zapier.listApps({ cursor: nextCursor });
console.log({
firstPageApps,
secondPageApps,
});
for await (const page of zapier.listApps({ search: "slack" })) {
const { data: apps } = page;
console.log({
apps,
});
}
for await (const app of zapier.listApps({ maxItems: 100 }).items()) {
console.log({
app,
});
}
const allApps = await Array.fromAsync(
zapier.listApps({ maxItems: 100 }).items(),
);
console.log({
allApps,
});
const { data: app } = await zapier.getApp({ app: "slack" });
console.log({
app,
});
const { data: myConnections } = await zapier.listConnections({
app: "slack",
owner: "me",
});
console.log({
myConnections,
});
const { data: actions } = await zapier.listActions({ app: "slack" });
console.log({
actions,
});
const singleAction = await zapier.getAction({
app: "slack",
actionType: actions[0].action_type,
action: actions[0].key,
});
console.log({
singleAction,
});
const { data: channels } = await zapier.runAction({
app: "slack",
actionType: "read",
action: "channels",
connection: myConnections[0].id,
});
console.log({
channels,
});
const { data: profile } = await zapier.getProfile();
const mySlack = zapier.apps.slack({
connection: myConnections[0].id,
});
const { data: users } = await mySlack.search.user_by_email({
inputs: {
email: profile.email,
},
});
console.log({
users,
});
const { data: sameUsers } = await zapier.apps.slack.search.user_by_email({
inputs: {
email: profile.email,
},
connection: myConnections[0].id,
});
console.log({
sameUsers,
});
const emojiResponse = await zapier.fetch("https://slack.com/api/emoji.list", {
connection: myConnections[0].id,
});
const emojiData = await emojiResponse.json();
console.log(emojiData.emoji);
Factory
The createZapierSdk(...) factory function is the main entry point for the SDK. It provides methods for managing connections, listing apps, running actions, and more.
credentials | string, object, function | β | β | β | Authentication credentials. Can be a string (token or API key), a client credentials object ({ clientId, clientSecret }), a PKCE object ({ clientId }), or a function returning any of those. |
debug | boolean | β | β | β | Enable debug logging. |
baseUrl | string | β | β | β | Base URL for Zapier API endpoints. |
trackingBaseUrl | string | β | β | β | Base URL for Zapier tracking endpoints. |
maxNetworkRetries | number | β | β | β | Max retries for rate-limited requests (default: 3). |
maxNetworkRetryDelayMs | number | β | β | β | Max delay in ms to wait for retry (default: 60000). |
canIncludeSharedConnections | boolean | β | β | β | Allow listing shared connections. |
canIncludeSharedTables | boolean | β | β | β | Allow listing shared tables. |
canDeleteTables | boolean | β | β | β | Allow deleting tables. |
Named Connections
Named connections let you decouple workflow code from specific connection IDs. Instead of hardcoding an ID, you reference a connection by name and the SDK resolves it from a mapping.
This is useful when an execution engine or deployment system manages which connections a workflow should use.
Providing the mapping
Connections are configured in .zapierrc alongside app version pins, or inline via the manifest option:
const zapier = createZapierSdk({
manifest: {
apps: { slack: { implementationName: "SlackCLIAPI", version: "1.21.1" } },
connections: {
slack_work: { connectionId: "01234567-89ab-cdef-0123-456789abcdef" },
google_sheets: { connectionId: 67890 },
},
},
});
Each connection entry maps a name to a connectionId. The Zapier connections API returns UUID-format IDs (the id field on entries from listConnections); positive integers from older connections are also accepted. App version resolution is handled separately via the apps section of .zapierrc.
Using named connections
Reference connections using the connection parameter. Pass a connection name to be resolved from the connections map, or a connection ID to be used directly.
await zapier.apps.slack.read.channels({ connection: "slack_work" });
const slack = zapier.apps.slack({ connection: "slack_work" });
await slack.read.channels({});
await zapier.runAction({
app: "slack",
actionType: "read",
action: "channels",
connection: "slack_work",
});
await zapier.fetch("https://slack.com/api/auth.test", {
connection: "slack_work",
});
await zapier.apps.slack.read.channels({
connection: "01234567-89ab-cdef-0123-456789abcdef",
});
Available Functions
Accounts
getProfile
Get current user's profile information
Parameters:
Returns: Promise<ProfileItem>
Example:
const { data: profile } = await zapier.getProfile();
Actions
getAction
Get detailed information about a specific action
Parameters:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
β³Β actionType | string | β
| β | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type |
β³Β action | string | β
| β | β | Action key (e.g., 'send_message' or 'find_row') |
Returns: Promise<ActionItem>
Example:
const { data: action } = await zapier.getAction({
app: "example-value",
actionType: "read",
action: "example-value",
});
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:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
β³Β actionType | string | β
| β | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type |
β³Β action | string | β
| β | β | Action key to get the input schema for |
β³Β connection | string, number | β | β | β | 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 | β | β | β | Current input values that may affect the schema (e.g., when fields depend on other field values) |
Returns: Promise<InputSchemaItem>
Example:
const { data: inputSchema } = await zapier.getInputFieldsSchema({
app: "example-value",
actionType: "read",
action: "example-value",
});
listActions
List all actions for a specific app
Parameters:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github') |
β³Β actionType | string | β | β | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Filter actions by type |
β³Β pageSize | number | β | β | β | Number of actions per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<ActionItem>>
Example:
const { data: actions, nextCursor } = await zapier.listActions({
app: "example-value",
});
for await (const page of zapier.listActions({
app: "example-value",
})) {
}
for await (const action of zapier
.listActions({
app: "example-value",
})
.items()) {
}
listInputFieldChoices
Get the available choices for a dynamic dropdown input field
Parameters:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
β³Β actionType | string | β
| β | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type |
β³Β action | string | β
| β | β | Action key (e.g., 'send_message' or 'find_row') |
β³Β inputField | string | β
| β | β | Input field key to get choices for |
β³Β connection | string, number | β | β | β | 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 | β | β | β | Current input values that may affect available choices |
β³Β page | number | β | β | β | Page number for paginated results |
β³Β pageSize | number | β | β | β | Number of choices per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<InputFieldChoiceItem>>
Example:
const { data: inputFieldChoices, nextCursor } =
await zapier.listInputFieldChoices({
app: "example-value",
actionType: "read",
action: "example-value",
inputField: "example-value",
});
for await (const page of zapier.listInputFieldChoices({
app: "example-value",
actionType: "read",
action: "example-value",
inputField: "example-value",
})) {
}
for await (const inputFieldChoice of zapier
.listInputFieldChoices({
app: "example-value",
actionType: "read",
action: "example-value",
inputField: "example-value",
})
.items()) {
}
listInputFields
Get the input fields required for a specific action
Parameters:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
β³Β actionType | string | β
| β | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type |
β³Β action | string | β
| β | β | Action key (e.g., 'send_message' or 'find_row') |
β³Β connection | string, number | β | β | β | 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 | β | β | β | Current input values that may affect available fields |
β³Β pageSize | number | β | β | β | Number of input fields per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<RootFieldItemItem>>
Example:
const { data: rootFieldItems, nextCursor } = await zapier.listInputFields({
app: "example-value",
actionType: "read",
action: "example-value",
});
for await (const page of zapier.listInputFields({
app: "example-value",
actionType: "read",
action: "example-value",
})) {
}
for await (const rootFieldItem of zapier
.listInputFields({
app: "example-value",
actionType: "read",
action: "example-value",
})
.items()) {
}
runAction
Execute an action with the given inputs
Parameters:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
β³Β actionType | string | β
| β | read, read_bulk, write, run, search, search_or_write, search_and_write, filter | Action type that matches the action's defined type |
β³Β action | string | β
| β | β | Action key (e.g., 'send_message' or 'find_row') |
β³Β connection | string, number | β | β | β | 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 | β | β | β | Input parameters for the action |
β³Β timeoutMs | number | β | β | β | Maximum time to wait for action completion in milliseconds (default: 180000) |
β³Β pageSize | number | β | β | β | Number of results per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<ActionResultItem>>
Example:
const { data: actionResults, nextCursor } = await zapier.runAction({
app: "example-value",
actionType: "read",
action: "example-value",
});
for await (const page of zapier.runAction({
app: "example-value",
actionType: "read",
action: "example-value",
})) {
}
for await (const actionResult of zapier
.runAction({
app: "example-value",
actionType: "read",
action: "example-value",
})
.items()) {
}
Apps
apps.{appKey}
Bind a connection alias or numeric connectionId to an app
Parameters:
options | object | β
| β | β | |
β³Β connection | string, number | β | β | β | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
Returns: Promise<AppProxy>
Example:
const result = await zapier.apps.appKey();
apps.{appKey}.{actionType}.{actionKey}
Execute an action with the given inputs for the bound app, as an alternative to runAction
Parameters:
options | object | β
| β | β | |
β³Β inputs | object | β | β | β | |
β³Β connection | string, number | β | β | β | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
β³Β timeoutMs | number | β | β | β | Maximum time to wait for action completion in milliseconds (default: 180000) |
Returns: Promise<PaginatedResult<ActionResultItem>>
Example:
const { data: actionResults, nextCursor } =
await zapier.apps.appKey.actionType.actionKey();
for await (const page of zapier.apps.appKey.actionType.actionKey()) {
}
for await (const actionResult of zapier.apps.appKey.actionType
.actionKey()
.items()) {
}
getApp
Get detailed information about a specific app
Parameters:
options | object | β
| β | β | |
β³Β app | string | β
| β | β | App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3') |
Returns: Promise<AppItem>
Example:
const { data: app } = await zapier.getApp({
app: "example-value",
});
listApps
List all available apps with optional filtering
Parameters:
options | object | β
| β | β | |
β³Β search | string | β | β | β | Search term to filter apps by name |
β³Β pageSize | number | β | β | β | Number of apps per page |
β³Β apps | array | β | β | β | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<AppItem>>
Example:
const { data: apps, nextCursor } = await zapier.listApps();
for await (const page of zapier.listApps()) {
}
for await (const app of zapier.listApps().items()) {
}
Client Credentials
createClientCredentials
Create new client credentials for the authenticated user
Parameters:
options | object | β
| β | β | |
β³Β name | string | β
| β | β | Human-readable name for the client credentials |
β³Β allowedScopes | array | β | ["external"] | β | Scopes 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:
options | object | β
| β | β | |
β³Β clientId | string | β
| β | β | The 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:
options | object | β
| β | β | |
β³Β pageSize | number | β | β | β | Number of credentials per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<ClientCredentialsItem>>
Example:
const { data: clientCredentials, nextCursor } =
await zapier.listClientCredentials();
for await (const page of zapier.listClientCredentials()) {
}
for await (const clientCredentials of zapier.listClientCredentials().items()) {
}
Connections
findFirstConnection
Find the first connection matching the criteria
Parameters:
options | object | β
| β | β | |
β³Β search | string | β | β | β | Search term to filter connections by title |
β³Β title | string | β | β | β | Filter connections by exact title match (searches first, then filters locally) |
β³Β owner | string | β | β | β | Filter by owner, 'me' for your own connections or a specific user ID |
β³Β app | string | β | β | β | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
β³Β account | string | β | β | β | Account to filter by |
β³Β includeShared | boolean | β | β | β | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
β³Β expired | boolean | β | β | β | Show only expired connections (default: only non-expired connections are returned) |
Returns: Promise<ConnectionItem>
Example:
const { data: connection } = await zapier.findFirstConnection();
findUniqueConnection
Find a unique connection matching the criteria
Parameters:
options | object | β
| β | β | |
β³Β search | string | β | β | β | Search term to filter connections by title |
β³Β title | string | β | β | β | Filter connections by exact title match (searches first, then filters locally) |
β³Β owner | string | β | β | β | Filter by owner, 'me' for your own connections or a specific user ID |
β³Β app | string | β | β | β | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
β³Β account | string | β | β | β | Account to filter by |
β³Β includeShared | boolean | β | β | β | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
β³Β expired | boolean | β | β | β | Show only expired connections (default: only non-expired connections are returned) |
Returns: Promise<ConnectionItem>
Example:
const { data: connection } = await zapier.findUniqueConnection();
getConnection
Execute getConnection
Parameters:
options | object | β
| β | β | |
β³Β connection | string, number | β | β | β | Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. |
Returns: Promise<ConnectionItem>
Example:
const { data: connection } = await zapier.getConnection();
listConnections
List available connections with optional filtering
Parameters:
options | object | β
| β | β | |
β³Β search | string | β | β | β | Search term to filter connections by title |
β³Β title | string | β | β | β | Filter connections by exact title match (searches first, then filters locally) |
β³Β owner | string | β | β | β | Filter by owner, 'me' for your own connections or a specific user ID |
β³Β app | string | β | β | β | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
β³Β connections | array | β | β | β | List of connection IDs to filter by |
β³Β account | string | β | β | β | Account to filter by |
β³Β includeShared | boolean | β | β | β | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
β³Β expired | boolean | β | β | β | Show only expired connections (default: only non-expired connections are returned) |
β³Β pageSize | number | β | β | β | Number of connections per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<ConnectionItem>>
Example:
const { data: connections, nextCursor } = await zapier.listConnections();
for await (const page of zapier.listConnections()) {
}
for await (const connection of zapier.listConnections().items()) {
}
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:
url | string, custom | β
| β | β | The full URL of the API endpoint to call (proxied through Zapier's Relay service) |
init | object | β | β | β | Request options including method, headers, body, and authentication |
β³Β method | string | β | β | GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS | HTTP method for the request (defaults to GET) |
β³Β headers | object | β | β | β | HTTP headers to include in the request |
β³Β body | string, custom, record | β | β | β | Request body β plain objects and JSON strings are auto-detected and Content-Type is set accordingly |
β³Β connection | string, number | β | β | β | 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 | β | β | β | URL to send async response to (makes request async) |
β³Β maxTime | number | β | β | β | Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling. |
Returns: Promise<Response>
Example:
const result = await zapier.fetch("example-value", { key: "value" });
Tables
createTable
Create a new table
Parameters:
options | object | β
| β | β | |
β³Β name | string | β
| β | β | The name for the new table |
β³Β description | string | β | β | β | An optional description of the table |
Returns: Promise<any>
Example:
const result = await zapier.createTable({
name: "example-value",
});
createTableFields
Create one or more fields in a table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β fields | array | β
| β | β | Array of field definitions to create |
Returns: Promise<any>
Example:
const result = await zapier.createTableFields({
table: "example-value",
fields: ["example-item"],
});
createTableRecords
Create one or more records in a table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β records | array | β
| β | β | Array of records to create (max 100) |
β³Β keyMode | string | β | "names" | β | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |
Returns: Promise<any>
Example:
const result = await zapier.createTableRecords({
table: "example-value",
records: ["example-item"],
});
deleteTable
Delete a table by its ID
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
Returns: Promise<any>
Example:
const result = await zapier.deleteTable({
table: "example-value",
});
deleteTableFields
Delete one or more fields from a table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β fields | array | β
| β | β | |
Returns: Promise<any>
Example:
const result = await zapier.deleteTableFields({
table: "example-value",
fields: ["example-item"],
});
deleteTableRecords
Delete one or more records from a table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β records | array | β
| β | β | Record IDs to operate on |
Returns: Promise<any>
Example:
const result = await zapier.deleteTableRecords({
table: "example-value",
records: ["example-item"],
});
getTable
Get detailed information about a specific table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
Returns: Promise<TableItem>
Example:
const { data: table } = await zapier.getTable({
table: "example-value",
});
getTableRecord
Get a single record from a table by ID
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β record | string | β
| β | β | The unique identifier of the record |
β³Β keyMode | string | β | "names" | β | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |
Returns: Promise<RecordItem>
Example:
const { data: record } = await zapier.getTableRecord({
table: "example-value",
record: "example-value",
});
listTableFields
List fields for a table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β fields | array | β | β | β | Fields to operate on. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6). |
Returns: Promise<PaginatedResult<FieldItem>>
Example:
const { data: fields, nextCursor } = await zapier.listTableFields({
table: "example-value",
});
for await (const page of zapier.listTableFields({
table: "example-value",
})) {
}
for await (const field of zapier
.listTableFields({
table: "example-value",
})
.items()) {
}
listTableRecords
List records in a table with optional filtering and sorting
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β filters | array | β | β | β | Filter conditions for the query |
β³Β sort | object | β | β | β | Sort records by a field |
Β Β β³Β fieldKey | string | β
| β | β | The field key to sort by |
Β Β β³Β direction | string | β | "asc" | β | Sort direction |
β³Β pageSize | number | β | β | β | Number of records per page (max 1000) |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
β³Β keyMode | string | β | "names" | β | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |
Returns: Promise<PaginatedResult<RecordItem>>
Example:
const { data: records, nextCursor } = await zapier.listTableRecords({
table: "example-value",
});
for await (const page of zapier.listTableRecords({
table: "example-value",
})) {
}
for await (const record of zapier
.listTableRecords({
table: "example-value",
})
.items()) {
}
listTables
List tables available to the authenticated user
Parameters:
options | object | β
| β | β | |
β³Β tables | array | β | β | β | Filter by specific table IDs |
β³Β kind | string | β | β | table, virtual_table, both | Filter by table type |
β³Β search | string | β | β | β | Search term to filter tables by name |
β³Β owner | string | β | β | β | Filter by table owner. Use "me" for the current user, or a numeric user ID. Requires includeShared to be true. |
β³Β includeShared | boolean | β | β | β | Include tables shared with you. Without this, only your own tables are returned. |
β³Β pageSize | number | β | β | β | Number of tables per page |
β³Β maxItems | number | β | β | β | Maximum total items to return across all pages |
β³Β cursor | string | β | β | β | Cursor to start from |
Returns: Promise<PaginatedResult<TableItem>>
Example:
const { data: tables, nextCursor } = await zapier.listTables();
for await (const page of zapier.listTables()) {
}
for await (const table of zapier.listTables().items()) {
}
updateTableRecords
Update one or more records in a table
Parameters:
options | object | β
| β | β | |
β³Β table | string | β
| β | β | The unique identifier of the table |
β³Β records | array | β
| β | β | Array of records to update (max 100) |
β³Β keyMode | string | β | "names" | β | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |
Returns: Promise<any>
Example:
const result = await zapier.updateTableRecords({
table: "example-value",
records: ["example-item"],
});