master-zapier-plan-draft/research/zapier/FUNCTIONS-REFERENCE.md
George Lambert b4150c8250 Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe),
packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier
(CLI app), vendor/zapier-platform, and research/zapier vendor corpus.

Gate 0 structure checks pass. Product code and research are not yet wired.
2026-09-09 02:37:36 -04:00

180 lines
11 KiB
Markdown

# Zapier function reference (CLI, core, SDK)
**Grok start:** `db.platform_reference.findOne({ kind: "guide", key: "build-new-connector" })`
MCP tools: [MCP-REFERENCE.md](MCP-REFERENCE.md). This file is everything else.
Each function has a Mongo document with the same sections as MCP: high-level, internals, typed inputs, outputs, related, twins, examples.
## Core (`kind: "core_function"`)
| Function | Signature | Category |
|----------|-----------|----------|
| `AfterResponseMiddleware` | `(response, z, bundle) => response | Promise<response>` | middleware |
| `BeforeRequestMiddleware` | `(request, z, bundle) => request | Promise<request>` | middleware |
| `CreatePerform` | `(z, bundle) => object | Promise<object>` | perform |
| `PollingTriggerPerform` | `(z, bundle) => object[] | Promise<object[]>` | perform |
| `SearchPerform` | `(z, bundle) => object[] | Promise<object[]>` | perform |
| `WebhookTriggerPerform` | `(z, bundle) => object[] | Promise<object[]>` | perform |
| `createAppTester` | `createAppTester(appRaw, options?) → (func|request, bundle?) => Promise` | testing |
| `performBuffer` | `(z, BufferedBundle) => Promise<{[id]: {outputData?, error?}}>` | perform |
| `z.JSON.parse` | `z.JSON.parse(text) → any` | json |
| `z.JSON.stringify` | `z.JSON.stringify(value) → string` | json |
| `z.cache.delete` | `z.cache.delete(key) → Promise<boolean>` | cache |
| `z.cache.get` | `z.cache.get(key) → Promise<any>` | cache |
| `z.cache.set` | `z.cache.set(key, value, ttl?, scope?, nx?) → Promise<boolean|null>` | cache |
| `z.console` | `z.console.log|info|warn|error(...args) → void` | debug |
| `z.cursor.get` | `z.cursor.get() → Promise<string>` | polling |
| `z.cursor.set` | `z.cursor.set(cursor) → Promise<null>` | polling |
| `z.dehydrate` | `z.dehydrate(func, inputData?, cacheExpiration?) → string` | hydration |
| `z.dehydrateFile` | `z.dehydrateFile(func, inputData?, cacheExpiration?) → string` | hydration |
| `z.errors.CheckError` | `throw new z.errors.CheckError(message?)` | errors |
| `z.errors.DehydrateError` | `throw new z.errors.DehydrateError(message?)` | errors |
| `z.errors.Error` | `throw new z.errors.Error(message, code?, status?)` | errors |
| `z.errors.ExpiredAuthError` | `throw new z.errors.ExpiredAuthError(message?)` | errors |
| `z.errors.HaltedError` | `throw new z.errors.HaltedError(message?)` | errors |
| `z.errors.RefreshAuthError` | `throw new z.errors.RefreshAuthError(message?)` | errors |
| `z.errors.ResponseError` | `throw new z.errors.ResponseError(response)` | errors |
| `z.errors.StopRequestError` | `throw new z.errors.StopRequestError(message?)` | errors |
| `z.errors.ThrottledError` | `throw new z.errors.ThrottledError(message, delaySeconds?)` | errors |
| `z.generateCallbackUrl` | `z.generateCallbackUrl() → string` | callback |
| `z.hash` | `z.hash(algorithm, data, encoding?, input_encoding?) → string` | crypto |
| `z.request` | `z.request(url, options?) → Promise<HttpResponse>` | http |
| `z.stashFile` | `z.stashFile(input, knownLength?, filename?, contentType?) → string` | files |
| `zapier.tools.env.inject` | `zapier.tools.env.inject(filename?)` | testing |
## Platform CLI (`kind: "cli_function"`)
| Command | Usage |
|---------|-------|
| `analytics` | `zapier-platform analytics` |
| `build` | `zapier-platform build` |
| `canary:create` | `zapier-platform canary:create VERSIONFROM VERSIONTO` |
| `canary:delete` | `zapier-platform canary:delete VERSIONFROM VERSIONTO` |
| `canary:list` | `zapier-platform canary:list` |
| `convert` | `zapier-platform convert PATH` |
| `delete:integration` | `zapier-platform delete:integration` |
| `delete:version` | `zapier-platform delete:version VERSION` |
| `deprecate` | `zapier-platform deprecate VERSION DATE` |
| `describe` | `zapier-platform describe` |
| `env:get` | `zapier-platform env:get VERSION` |
| `env:set` | `zapier-platform env:set VERSION [KEY-VALUE PAIRS...]` |
| `env:unset` | `zapier-platform env:unset VERSION [KEYS...]` |
| `history` | `zapier-platform history` |
| `init` | `zapier-platform init PATH` |
| `integrations` | `zapier-platform integrations` |
| `invoke` | `zapier-platform invoke [ACTIONTYPE] [ACTIONKEY] [AUTHDATA]` |
| `jobs` | `zapier-platform jobs` |
| `legacy` | `zapier-platform legacy VERSION` |
| `link` | `zapier-platform link` |
| `login` | `zapier-platform login` |
| `logout` | `zapier-platform logout` |
| `logs` | `zapier-platform logs` |
| `migrate` | `zapier-platform migrate FROMVERSION TOVERSION [PERCENT]` |
| `promote` | `zapier-platform promote VERSION` |
| `pull` | `zapier-platform pull` |
| `push` | `zapier-platform push` |
| `register` | `zapier-platform register [TITLE]` |
| `scaffold` | `zapier-platform scaffold ACTIONTYPE NOUN` |
| `team:add` | `zapier-platform team:add EMAIL ROLE [MESSAGE]` |
| `team:get` | `zapier-platform team:get` |
| `team:remove` | `zapier-platform team:remove` |
| `test` | `zapier-platform test` |
| `upload` | `zapier-platform upload` |
| `users:add` | `zapier-platform users:add EMAIL [VERSION]` |
| `users:get` | `zapier-platform users:get` |
| `users:links` | `zapier-platform users:links` |
| `users:remove` | `zapier-platform users:remove EMAIL` |
| `validate` | `zapier-platform validate` |
| `versions` | `zapier-platform versions` |
## SDK (`kind: "sdk_function"`)
| CLI | TypeScript | Category | MCP twin |
|-----|------------|----------|----------|
| `get-profile` | `zapier.getProfile` | Accounts | — |
| `login` | `zapier.login` | Accounts | — |
| `logout` | `zapier.logout` | Accounts | — |
| `signup` | `zapier.signup` | Accounts | — |
| `get-action` | `zapier.getAction` | Actions | inspect_zapier_actions |
| `get-action-input-fields-schema` | `zapier.getActionInputFieldsSchema` | Actions | inspect_zapier_actions |
| `list-action-input-field-choices` | `zapier.listActionInputFieldChoices` | Actions | inspect_zapier_actions (enum_property) |
| `list-action-input-fields` | `zapier.listActionInputFields` | Actions | inspect_zapier_actions |
| `list-actions` | `zapier.listActions` | Actions | inspect_zapier_actions / discover_zapier_actions |
| `run-action` | `zapier.runAction` | Actions | execute_zapier_read_action / execute_zapier_write_action |
| `get-app` | `zapier.getApp` | Apps | discover_zapier_actions |
| `list-apps` | `zapier.listApps` | Apps | discover_zapier_actions |
| `create-client-credentials` | `zapier.createClientCredentials` | Client Credentials | — |
| `delete-client-credentials` | `zapier.deleteClientCredentials` | Client Credentials | — |
| `list-client-credentials` | `zapier.listClientCredentials` | Client Credentials | — |
| `cancel-durable-run` | `zapier.cancelDurableRun` | Code Workflows | — |
| `create-workflow` | `zapier.createWorkflow` | Code Workflows | — |
| `delete-workflow` | `zapier.deleteWorkflow` | Code Workflows | — |
| `disable-workflow` | `zapier.disableWorkflow` | Code Workflows | — |
| `enable-workflow` | `zapier.enableWorkflow` | Code Workflows | — |
| `get-durable-run` | `zapier.getDurableRun` | Code Workflows | — |
| `get-trigger-run` | `zapier.getTriggerRun` | Code Workflows | — |
| `get-workflow` | `zapier.getWorkflow` | Code Workflows | — |
| `get-workflow-run` | `zapier.getWorkflowRun` | Code Workflows | — |
| `get-workflow-version` | `zapier.getWorkflowVersion` | Code Workflows | — |
| `list-durable-runs` | `zapier.listDurableRuns` | Code Workflows | — |
| `list-workflow-runs` | `zapier.listWorkflowRuns` | Code Workflows | — |
| `list-workflow-versions` | `zapier.listWorkflowVersions` | Code Workflows | — |
| `list-workflows` | `zapier.listWorkflows` | Code Workflows | — |
| `publish-workflow-version` | `zapier.publishWorkflowVersion` | Code Workflows | — |
| `run-durable` | `zapier.runDurable` | Code Workflows | — |
| `trigger-workflow` | `zapier.triggerWorkflow` | Code Workflows | — |
| `update-workflow` | `zapier.updateWorkflow` | Code Workflows | — |
| `create-connection` | `zapier.createConnection` | Connections | manage_zapier_connections |
| `find-first-connection` | `zapier.findFirstConnection` | Connections | list_zapier_connections |
| `find-unique-connection` | `zapier.findUniqueConnection` | Connections | list_zapier_connections |
| `get-connection` | `zapier.getConnection` | Connections | — |
| `get-connection-start-url` | `zapier.getConnectionStartUrl` | Connections | manage_zapier_connections |
| `list-connections` | `zapier.listConnections` | Connections | list_zapier_connections |
| `wait-for-new-connection` | `zapier.waitForNewConnection` | Connections | manage_zapier_connections (after auth_url) |
| `curl` | `zapier.curl` | HTTP Requests | write_code_action / z.request analog |
| `create-table` | `zapier.createTable` | Tables | — |
| `create-table-fields` | `zapier.createTableFields` | Tables | — |
| `create-table-records` | `zapier.createTableRecords` | Tables | — |
| `delete-table` | `zapier.deleteTable` | Tables | — |
| `delete-table-fields` | `zapier.deleteTableFields` | Tables | — |
| `delete-table-records` | `zapier.deleteTableRecords` | Tables | — |
| `get-table` | `zapier.getTable` | Tables | — |
| `get-table-record` | `zapier.getTableRecord` | Tables | — |
| `list-table-fields` | `zapier.listTableFields` | Tables | — |
| `list-table-records` | `zapier.listTableRecords` | Tables | — |
| `list-tables` | `zapier.listTables` | Tables | — |
| `update-table-records` | `zapier.updateTableRecords` | Tables | — |
| `ack-trigger-inbox-messages` | `zapier.ackTriggerInboxMessages` | Triggers | — |
| `create-trigger-inbox` | `zapier.createTriggerInbox` | Triggers | — |
| `delete-trigger-inbox` | `zapier.deleteTriggerInbox` | Triggers | — |
| `drain-trigger-inbox` | `zapier.drainTriggerInbox` | Triggers | — |
| `ensure-trigger-inbox` | `zapier.ensureTriggerInbox` | Triggers | — |
| `get-trigger-inbox` | `zapier.getTriggerInbox` | Triggers | — |
| `get-trigger-input-fields-schema` | `zapier.getTriggerInputFieldsSchema` | Triggers | — |
| `lease-trigger-inbox-messages` | `zapier.leaseTriggerInboxMessages` | Triggers | — |
| `list-trigger-inbox-messages` | `zapier.listTriggerInboxMessages` | Triggers | — |
| `list-trigger-inboxes` | `zapier.listTriggerInboxes` | Triggers | — |
| `list-trigger-input-field-choices` | `zapier.listTriggerInputFieldChoices` | Triggers | — |
| `list-trigger-input-fields` | `zapier.listTriggerInputFields` | Triggers | — |
| `list-triggers` | `zapier.listTriggers` | Triggers | — |
| `pause-trigger-inbox` | `zapier.pauseTriggerInbox` | Triggers | — |
| `release-trigger-inbox-messages` | `zapier.releaseTriggerInboxMessages` | Triggers | — |
| `resume-trigger-inbox` | `zapier.resumeTriggerInbox` | Triggers | — |
| `update-trigger-inbox` | `zapier.updateTriggerInbox` | Triggers | — |
| `watch-trigger-inbox` | `zapier.watchTriggerInbox` | Triggers | — |
| `add` | `zapier.add` | Utilities | — |
| `build-manifest` | `zapier.buildManifest` | Utilities | — |
| `feedback` | `zapier.feedback` | Utilities | send_feedback |
| `generate-app-types` | `zapier.generateAppTypes` | Utilities | — |
| `get-login-config-path` | `zapier.getLoginConfigPath` | Utilities | — |
| `init` | `zapier.init` | Utilities | — |
| `mcp` | `zapier.mcp` | Utilities | hosted Zapier MCP (different server) |
## Query
```js
db.platform_reference.findOne({ kind: "guide", key: "zapier-functions" })
db.platform_reference.find({ kind: "core_function", key: "z.request" })
db.platform_reference.find({ kind: "sdk_function", "meta.category": "Actions" })
```