@zapier/zapier-sdk 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/CLAUDE.md +6 -6
- package/README.md +217 -222
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/types.d.ts +3 -3
- package/dist/api/types.d.ts.map +1 -1
- package/dist/index.cjs +367 -216
- package/dist/index.d.mts +171 -91
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +359 -211
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +20 -13
- package/dist/plugins/apps/schemas.d.ts +6 -2
- package/dist/plugins/apps/schemas.d.ts.map +1 -1
- package/dist/plugins/apps/schemas.js +7 -3
- package/dist/plugins/deprecated/authentications.d.ts +79 -0
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -0
- package/dist/plugins/deprecated/authentications.js +90 -0
- package/dist/plugins/fetch/index.d.ts +4 -0
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +7 -4
- package/dist/plugins/fetch/schemas.d.ts +1 -0
- package/dist/plugins/fetch/schemas.d.ts.map +1 -1
- package/dist/plugins/fetch/schemas.js +3 -1
- package/dist/plugins/findFirstConnection/index.d.ts +21 -0
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -0
- package/dist/plugins/findFirstConnection/index.js +37 -0
- package/dist/plugins/findFirstConnection/index.test.d.ts.map +1 -0
- package/dist/plugins/{findFirstAuthentication → findFirstConnection}/index.test.js +43 -43
- package/dist/plugins/findFirstConnection/schemas.d.ts +22 -0
- package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -0
- package/dist/plugins/findFirstConnection/schemas.js +8 -0
- package/dist/plugins/findUniqueConnection/index.d.ts +21 -0
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -0
- package/dist/plugins/findUniqueConnection/index.js +40 -0
- package/dist/plugins/findUniqueConnection/index.test.d.ts.map +1 -0
- package/dist/plugins/{findUniqueAuthentication → findUniqueConnection}/index.test.js +41 -41
- package/dist/plugins/findUniqueConnection/schemas.d.ts +22 -0
- package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -0
- package/dist/plugins/findUniqueConnection/schemas.js +8 -0
- package/dist/plugins/getApp/index.js +2 -2
- package/dist/plugins/getConnection/index.d.ts +22 -0
- package/dist/plugins/getConnection/index.d.ts.map +1 -0
- package/dist/plugins/getConnection/index.js +35 -0
- package/dist/plugins/getConnection/index.test.d.ts.map +1 -0
- package/dist/plugins/{getAuthentication → getConnection}/index.test.js +46 -28
- package/dist/plugins/getConnection/schemas.d.ts +13 -0
- package/dist/plugins/getConnection/schemas.d.ts.map +1 -0
- package/dist/plugins/getConnection/schemas.js +8 -0
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +7 -4
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +1 -0
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/schemas.js +6 -2
- package/dist/plugins/listApps/schemas.js +2 -2
- package/dist/plugins/listClientCredentials/schemas.js +2 -2
- package/dist/plugins/listConnections/index.d.ts +24 -0
- package/dist/plugins/listConnections/index.d.ts.map +1 -0
- package/dist/plugins/{listAuthentications → listConnections}/index.js +28 -21
- package/dist/plugins/listConnections/index.test.d.ts.map +1 -0
- package/dist/plugins/{listAuthentications → listConnections}/index.test.js +219 -198
- package/dist/plugins/{listAuthentications → listConnections}/schemas.d.ts +11 -10
- package/dist/plugins/listConnections/schemas.d.ts.map +1 -0
- package/dist/plugins/listConnections/schemas.js +47 -0
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +8 -5
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +1 -0
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +3 -1
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +7 -4
- package/dist/plugins/listInputFields/schemas.d.ts +1 -0
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFields/schemas.js +3 -1
- package/dist/plugins/manifest/schemas.d.ts +2 -0
- package/dist/plugins/manifest/schemas.d.ts.map +1 -1
- package/dist/plugins/manifest/schemas.js +3 -1
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +3 -2
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +5 -2
- package/dist/plugins/request/schemas.d.ts +2 -0
- package/dist/plugins/request/schemas.d.ts.map +1 -1
- package/dist/plugins/request/schemas.js +3 -1
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +12 -8
- package/dist/plugins/runAction/schemas.d.ts +1 -0
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/plugins/runAction/schemas.js +4 -2
- package/dist/resolvers/connectionId.d.ts +9 -0
- package/dist/resolvers/connectionId.d.ts.map +1 -0
- package/dist/resolvers/connectionId.js +42 -0
- package/dist/resolvers/index.d.ts +5 -1
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +6 -1
- package/dist/resolvers/inputFieldKey.d.ts +1 -1
- package/dist/resolvers/inputFieldKey.d.ts.map +1 -1
- package/dist/resolvers/inputFieldKey.js +2 -2
- package/dist/resolvers/inputs.d.ts +1 -1
- package/dist/resolvers/inputs.d.ts.map +1 -1
- package/dist/resolvers/inputs.js +4 -4
- package/dist/schemas/Connection.d.ts +29 -0
- package/dist/schemas/Connection.d.ts.map +1 -0
- package/dist/schemas/{Auth.js → Connection.js} +5 -7
- package/dist/sdk.d.ts +29 -7
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +12 -5
- package/dist/sdk.test.js +9 -8
- package/dist/services/implementations.d.ts +6 -6
- package/dist/services/implementations.d.ts.map +1 -1
- package/dist/services/implementations.js +10 -10
- package/dist/types/domain.d.ts +4 -4
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/properties.d.ts +5 -1
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/properties.js +4 -2
- package/dist/types/sdk.d.ts +12 -9
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/index.js +0 -36
- package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -21
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/schemas.js +0 -8
- package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/index.js +0 -39
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -21
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/schemas.js +0 -8
- package/dist/plugins/getAuthentication/index.d.ts +0 -21
- package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/index.js +0 -29
- package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
- package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/schemas.js +0 -1
- package/dist/plugins/listAuthentications/index.d.ts +0 -24
- package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/schemas.js +0 -32
- package/dist/resolvers/authenticationId.d.ts +0 -9
- package/dist/resolvers/authenticationId.d.ts.map +0 -1
- package/dist/resolvers/authenticationId.js +0 -42
- package/dist/schemas/Auth.d.ts +0 -55
- package/dist/schemas/Auth.d.ts.map +0 -1
- /package/dist/plugins/{findFirstAuthentication → findFirstConnection}/index.test.d.ts +0 -0
- /package/dist/plugins/{findUniqueAuthentication → findUniqueConnection}/index.test.d.ts +0 -0
- /package/dist/plugins/{getAuthentication → getConnection}/index.test.d.ts +0 -0
- /package/dist/plugins/{listAuthentications → listConnections}/index.test.d.ts +0 -0
package/README.md
CHANGED
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
- [`apps.{appKey}.{actionType}.{actionKey}`](#appsappkeyactiontypeactionkey)
|
|
22
22
|
- [`getApp`](#getapp)
|
|
23
23
|
- [`listApps`](#listapps)
|
|
24
|
-
- [Authentications](#authentications)
|
|
25
|
-
- [`findFirstAuthentication`](#findfirstauthentication)
|
|
26
|
-
- [`findUniqueAuthentication`](#finduniqueauthentication)
|
|
27
|
-
- [`getAuthentication`](#getauthentication)
|
|
28
|
-
- [`listAuthentications`](#listauthentications)
|
|
29
24
|
- [Client Credentials](#client-credentials)
|
|
30
25
|
- [`createClientCredentials`](#createclientcredentials)
|
|
31
26
|
- [`deleteClientCredentials`](#deleteclientcredentials)
|
|
32
27
|
- [`listClientCredentials`](#listclientcredentials)
|
|
28
|
+
- [Connections](#connections)
|
|
29
|
+
- [`findFirstConnection`](#findfirstconnection)
|
|
30
|
+
- [`findUniqueConnection`](#finduniqueconnection)
|
|
31
|
+
- [`getConnection`](#getconnection)
|
|
32
|
+
- [`listConnections`](#listconnections)
|
|
33
33
|
- [HTTP Requests](#http-requests)
|
|
34
34
|
- [`fetch`](#fetch)
|
|
35
35
|
|
|
@@ -64,7 +64,7 @@ npm install -D @zapier/zapier-sdk-cli @types/node typescript
|
|
|
64
64
|
|
|
65
65
|
## Quick Start
|
|
66
66
|
|
|
67
|
-
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,
|
|
67
|
+
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.
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
# See all available commands
|
|
@@ -82,19 +82,19 @@ npx zapier-sdk list-apps --search "gmail"
|
|
|
82
82
|
npx zapier-sdk run-action gmail
|
|
83
83
|
# This will ask you for the type of action you want to run.
|
|
84
84
|
# `search` or `write` are typically great for testing.
|
|
85
|
-
# Note that you usually need
|
|
85
|
+
# Note that you usually need a connection to the app to run
|
|
86
86
|
# the action. If you don't already have one, you can create a new one at:
|
|
87
87
|
# https://zapier.com/app/assets/connections
|
|
88
88
|
|
|
89
|
-
# List
|
|
90
|
-
npx zapier-sdk list-
|
|
89
|
+
# List connections for an app.
|
|
90
|
+
npx zapier-sdk list-connections gmail
|
|
91
91
|
# Or only list the ones you own.
|
|
92
|
-
npx zapier-sdk list-
|
|
92
|
+
npx zapier-sdk list-connections gmail --owner me
|
|
93
93
|
# Or just grab the first one.
|
|
94
|
-
npx zapier-sdk find-first-
|
|
94
|
+
npx zapier-sdk find-first-connection gmail --owner me
|
|
95
95
|
|
|
96
|
-
# Make any API request to an app using your
|
|
97
|
-
npx zapier-sdk fetch "https://gmail.googleapis.com/gmail/v1/users/me/labels" --
|
|
96
|
+
# Make any API request to an app using your connection.
|
|
97
|
+
npx zapier-sdk fetch "https://gmail.googleapis.com/gmail/v1/users/me/labels" --connection-id 123
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
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.
|
|
@@ -156,7 +156,7 @@ console.log({
|
|
|
156
156
|
secondPageApps,
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
// List methods also return an
|
|
159
|
+
// List methods also return an iterable for all pages.
|
|
160
160
|
// Be careful with lots of pages, note the `search` to filter.
|
|
161
161
|
for await (const page of zapier.listApps({ search: "slack" })) {
|
|
162
162
|
const { data: apps } = page;
|
|
@@ -190,14 +190,14 @@ console.log({
|
|
|
190
190
|
app,
|
|
191
191
|
});
|
|
192
192
|
|
|
193
|
-
// ########
|
|
194
|
-
const { data:
|
|
193
|
+
// ######## Connection Usage ########
|
|
194
|
+
const { data: myConnections } = await zapier.listConnections({
|
|
195
195
|
appKey: "slack",
|
|
196
196
|
owner: "me",
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
console.log({
|
|
200
|
-
|
|
200
|
+
myConnections,
|
|
201
201
|
});
|
|
202
202
|
|
|
203
203
|
// ######## Find Actions ########
|
|
@@ -233,7 +233,7 @@ const { data: channels } = await zapier.runAction({
|
|
|
233
233
|
appKey: "slack",
|
|
234
234
|
actionType: "read",
|
|
235
235
|
actionKey: "channels",
|
|
236
|
-
|
|
236
|
+
connectionId: myConnections[0].id,
|
|
237
237
|
});
|
|
238
238
|
|
|
239
239
|
console.log({
|
|
@@ -243,9 +243,9 @@ console.log({
|
|
|
243
243
|
const { data: profile } = await zapier.getProfile();
|
|
244
244
|
|
|
245
245
|
// Option 2:
|
|
246
|
-
// Create an app binding to your
|
|
246
|
+
// Create an app binding to your connection.
|
|
247
247
|
const mySlack = zapier.apps.slack({
|
|
248
|
-
|
|
248
|
+
connectionId: myConnections[0].id,
|
|
249
249
|
});
|
|
250
250
|
|
|
251
251
|
// Use your app binding to run the action.
|
|
@@ -259,12 +259,12 @@ console.log({
|
|
|
259
259
|
users,
|
|
260
260
|
});
|
|
261
261
|
|
|
262
|
-
// You can also skip the app binding and pass the
|
|
262
|
+
// You can also skip the app binding and pass the connection into the action.
|
|
263
263
|
const { data: sameUsers } = await zapier.apps.slack.search.user_by_email({
|
|
264
264
|
inputs: {
|
|
265
265
|
email: profile.email,
|
|
266
266
|
},
|
|
267
|
-
|
|
267
|
+
connectionId: myConnections[0].id,
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
console.log({
|
|
@@ -278,10 +278,10 @@ console.log({
|
|
|
278
278
|
|
|
279
279
|
// We have tens of thousands of actions across thousands of apps, but you're
|
|
280
280
|
// still not limited to those. You can make any arbitrary API request to an app
|
|
281
|
-
// using the same
|
|
281
|
+
// using the same connections with `.fetch`! This returns a response just
|
|
282
282
|
// like a normal `fetch` call in JavaScript.
|
|
283
283
|
const emojiResponse = await zapier.fetch("https://slack.com/api/emoji.list", {
|
|
284
|
-
|
|
284
|
+
connectionId: myConnections[0].id,
|
|
285
285
|
});
|
|
286
286
|
|
|
287
287
|
const emojiData = await emojiResponse.json();
|
|
@@ -308,7 +308,7 @@ Get current user's profile information
|
|
|
308
308
|
**Example:**
|
|
309
309
|
|
|
310
310
|
```typescript
|
|
311
|
-
const { data: profile } = await
|
|
311
|
+
const { data: profile } = await zapier.getProfile();
|
|
312
312
|
```
|
|
313
313
|
|
|
314
314
|
### Actions
|
|
@@ -331,7 +331,7 @@ Get detailed information about a specific action
|
|
|
331
331
|
**Example:**
|
|
332
332
|
|
|
333
333
|
```typescript
|
|
334
|
-
const { data: action } = await
|
|
334
|
+
const { data: action } = await zapier.getAction({
|
|
335
335
|
appKey: "example-key",
|
|
336
336
|
actionType: "read",
|
|
337
337
|
actionKey: "example-key",
|
|
@@ -344,21 +344,21 @@ Get the JSON Schema representation of input fields for an action. Returns a JSON
|
|
|
344
344
|
|
|
345
345
|
**Parameters:**
|
|
346
346
|
|
|
347
|
-
| Name
|
|
348
|
-
|
|
|
349
|
-
| `options`
|
|
350
|
-
| ↳ `appKey`
|
|
351
|
-
| ↳ `actionType`
|
|
352
|
-
| ↳ `actionKey`
|
|
353
|
-
| ↳ `
|
|
354
|
-
| ↳ `inputs`
|
|
347
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
348
|
+
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
349
|
+
| `options` | `object` | ✅ | — | — | |
|
|
350
|
+
| ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
|
|
351
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
352
|
+
| ↳ `actionKey` | `string` | ✅ | — | — | Action key to get the input schema for |
|
|
353
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields. |
|
|
354
|
+
| ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect the schema (e.g., when fields depend on other field values) |
|
|
355
355
|
|
|
356
356
|
**Returns:** `Promise<InputSchemaItem>`
|
|
357
357
|
|
|
358
358
|
**Example:**
|
|
359
359
|
|
|
360
360
|
```typescript
|
|
361
|
-
const { data: inputSchema } = await
|
|
361
|
+
const { data: inputSchema } = await zapier.getInputFieldsSchema({
|
|
362
362
|
appKey: "example-key",
|
|
363
363
|
actionType: "read",
|
|
364
364
|
actionKey: "example-key",
|
|
@@ -386,19 +386,19 @@ List all actions for a specific app
|
|
|
386
386
|
|
|
387
387
|
```typescript
|
|
388
388
|
// Get first page and a cursor for the second page
|
|
389
|
-
const { data: actions, nextCursor } = await
|
|
389
|
+
const { data: actions, nextCursor } = await zapier.listActions({
|
|
390
390
|
appKey: "example-key",
|
|
391
391
|
});
|
|
392
392
|
|
|
393
393
|
// Or iterate over all pages
|
|
394
|
-
for await (const page of
|
|
394
|
+
for await (const page of zapier.listActions({
|
|
395
395
|
appKey: "example-key",
|
|
396
396
|
})) {
|
|
397
397
|
// Do something with each page
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
// Or iterate over individual items across all pages
|
|
401
|
-
for await (const action of
|
|
401
|
+
for await (const action of zapier
|
|
402
402
|
.listActions({
|
|
403
403
|
appKey: "example-key",
|
|
404
404
|
})
|
|
@@ -413,19 +413,19 @@ Get the available choices for a dynamic dropdown input field
|
|
|
413
413
|
|
|
414
414
|
**Parameters:**
|
|
415
415
|
|
|
416
|
-
| Name
|
|
417
|
-
|
|
|
418
|
-
| `options`
|
|
419
|
-
| ↳ `appKey`
|
|
420
|
-
| ↳ `actionType`
|
|
421
|
-
| ↳ `actionKey`
|
|
422
|
-
| ↳ `inputFieldKey`
|
|
423
|
-
| ↳ `
|
|
424
|
-
| ↳ `inputs`
|
|
425
|
-
| ↳ `page`
|
|
426
|
-
| ↳ `pageSize`
|
|
427
|
-
| ↳ `maxItems`
|
|
428
|
-
| ↳ `cursor`
|
|
416
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
417
|
+
| ----------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
418
|
+
| `options` | `object` | ✅ | — | — | |
|
|
419
|
+
| ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
420
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
421
|
+
| ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
|
|
422
|
+
| ↳ `inputFieldKey` | `string` | ✅ | — | — | Input field key to get choices for. |
|
|
423
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
424
|
+
| ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available choices |
|
|
425
|
+
| ↳ `page` | `number` | ❌ | — | — | Page number for paginated results |
|
|
426
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of choices per page |
|
|
427
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
428
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
429
429
|
|
|
430
430
|
**Returns:** `Promise<PaginatedResult<InputFieldChoiceItem>>`
|
|
431
431
|
|
|
@@ -433,17 +433,16 @@ Get the available choices for a dynamic dropdown input field
|
|
|
433
433
|
|
|
434
434
|
```typescript
|
|
435
435
|
// Get first page and a cursor for the second page
|
|
436
|
-
const { data: inputFieldChoices, nextCursor } =
|
|
437
|
-
{
|
|
436
|
+
const { data: inputFieldChoices, nextCursor } =
|
|
437
|
+
await zapier.listInputFieldChoices({
|
|
438
438
|
appKey: "example-key",
|
|
439
439
|
actionType: "read",
|
|
440
440
|
actionKey: "example-key",
|
|
441
441
|
inputFieldKey: "example-key",
|
|
442
|
-
}
|
|
443
|
-
);
|
|
442
|
+
});
|
|
444
443
|
|
|
445
444
|
// Or iterate over all pages
|
|
446
|
-
for await (const page of
|
|
445
|
+
for await (const page of zapier.listInputFieldChoices({
|
|
447
446
|
appKey: "example-key",
|
|
448
447
|
actionType: "read",
|
|
449
448
|
actionKey: "example-key",
|
|
@@ -453,7 +452,7 @@ for await (const page of sdk.listInputFieldChoices({
|
|
|
453
452
|
}
|
|
454
453
|
|
|
455
454
|
// Or iterate over individual items across all pages
|
|
456
|
-
for await (const inputFieldChoice of
|
|
455
|
+
for await (const inputFieldChoice of zapier
|
|
457
456
|
.listInputFieldChoices({
|
|
458
457
|
appKey: "example-key",
|
|
459
458
|
actionType: "read",
|
|
@@ -471,17 +470,17 @@ Get the input fields required for a specific action
|
|
|
471
470
|
|
|
472
471
|
**Parameters:**
|
|
473
472
|
|
|
474
|
-
| Name
|
|
475
|
-
|
|
|
476
|
-
| `options`
|
|
477
|
-
| ↳ `appKey`
|
|
478
|
-
| ↳ `actionType`
|
|
479
|
-
| ↳ `actionKey`
|
|
480
|
-
| ↳ `
|
|
481
|
-
| ↳ `inputs`
|
|
482
|
-
| ↳ `pageSize`
|
|
483
|
-
| ↳ `maxItems`
|
|
484
|
-
| ↳ `cursor`
|
|
473
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
474
|
+
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
475
|
+
| `options` | `object` | ✅ | — | — | |
|
|
476
|
+
| ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
477
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
478
|
+
| ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
|
|
479
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
480
|
+
| ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect available fields |
|
|
481
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of input fields per page |
|
|
482
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
483
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
485
484
|
|
|
486
485
|
**Returns:** `Promise<PaginatedResult<RootFieldItemItem>>`
|
|
487
486
|
|
|
@@ -489,14 +488,14 @@ Get the input fields required for a specific action
|
|
|
489
488
|
|
|
490
489
|
```typescript
|
|
491
490
|
// Get first page and a cursor for the second page
|
|
492
|
-
const { data: rootFieldItems, nextCursor } = await
|
|
491
|
+
const { data: rootFieldItems, nextCursor } = await zapier.listInputFields({
|
|
493
492
|
appKey: "example-key",
|
|
494
493
|
actionType: "read",
|
|
495
494
|
actionKey: "example-key",
|
|
496
495
|
});
|
|
497
496
|
|
|
498
497
|
// Or iterate over all pages
|
|
499
|
-
for await (const page of
|
|
498
|
+
for await (const page of zapier.listInputFields({
|
|
500
499
|
appKey: "example-key",
|
|
501
500
|
actionType: "read",
|
|
502
501
|
actionKey: "example-key",
|
|
@@ -505,7 +504,7 @@ for await (const page of sdk.listInputFields({
|
|
|
505
504
|
}
|
|
506
505
|
|
|
507
506
|
// Or iterate over individual items across all pages
|
|
508
|
-
for await (const rootFieldItem of
|
|
507
|
+
for await (const rootFieldItem of zapier
|
|
509
508
|
.listInputFields({
|
|
510
509
|
appKey: "example-key",
|
|
511
510
|
actionType: "read",
|
|
@@ -522,18 +521,18 @@ Execute an action with the given inputs
|
|
|
522
521
|
|
|
523
522
|
**Parameters:**
|
|
524
523
|
|
|
525
|
-
| Name
|
|
526
|
-
|
|
|
527
|
-
| `options`
|
|
528
|
-
| ↳ `appKey`
|
|
529
|
-
| ↳ `actionType`
|
|
530
|
-
| ↳ `actionKey`
|
|
531
|
-
| ↳ `
|
|
532
|
-
| ↳ `inputs`
|
|
533
|
-
| ↳ `timeoutMs`
|
|
534
|
-
| ↳ `pageSize`
|
|
535
|
-
| ↳ `maxItems`
|
|
536
|
-
| ↳ `cursor`
|
|
524
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
525
|
+
| ---------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
526
|
+
| `options` | `object` | ✅ | — | — | |
|
|
527
|
+
| ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
528
|
+
| ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
529
|
+
| ↳ `actionKey` | `string` | ✅ | — | — | Action key to execute |
|
|
530
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
531
|
+
| ↳ `inputs` | `object` | ❌ | — | — | Input parameters for the action |
|
|
532
|
+
| ↳ `timeoutMs` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
|
|
533
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of results per page |
|
|
534
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
535
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
537
536
|
|
|
538
537
|
**Returns:** `Promise<PaginatedResult<ActionResultItem>>`
|
|
539
538
|
|
|
@@ -541,14 +540,14 @@ Execute an action with the given inputs
|
|
|
541
540
|
|
|
542
541
|
```typescript
|
|
543
542
|
// Get first page and a cursor for the second page
|
|
544
|
-
const { data: actionResults, nextCursor } = await
|
|
543
|
+
const { data: actionResults, nextCursor } = await zapier.runAction({
|
|
545
544
|
appKey: "example-key",
|
|
546
545
|
actionType: "read",
|
|
547
546
|
actionKey: "example-key",
|
|
548
547
|
});
|
|
549
548
|
|
|
550
549
|
// Or iterate over all pages
|
|
551
|
-
for await (const page of
|
|
550
|
+
for await (const page of zapier.runAction({
|
|
552
551
|
appKey: "example-key",
|
|
553
552
|
actionType: "read",
|
|
554
553
|
actionKey: "example-key",
|
|
@@ -557,7 +556,7 @@ for await (const page of sdk.runAction({
|
|
|
557
556
|
}
|
|
558
557
|
|
|
559
558
|
// Or iterate over individual items across all pages
|
|
560
|
-
for await (const actionResult of
|
|
559
|
+
for await (const actionResult of zapier
|
|
561
560
|
.runAction({
|
|
562
561
|
appKey: "example-key",
|
|
563
562
|
actionType: "read",
|
|
@@ -572,23 +571,21 @@ for await (const actionResult of sdk
|
|
|
572
571
|
|
|
573
572
|
#### `apps.{appKey}`
|
|
574
573
|
|
|
575
|
-
Bind
|
|
574
|
+
Bind a connection ID to an app
|
|
576
575
|
|
|
577
576
|
**Parameters:**
|
|
578
577
|
|
|
579
|
-
| Name
|
|
580
|
-
|
|
|
581
|
-
| `options`
|
|
582
|
-
| ↳ `
|
|
578
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
579
|
+
| ---------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------ |
|
|
580
|
+
| `options` | `object` | ✅ | — | — | |
|
|
581
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
583
582
|
|
|
584
583
|
**Returns:** `Promise<AppProxy>`
|
|
585
584
|
|
|
586
585
|
**Example:**
|
|
587
586
|
|
|
588
587
|
```typescript
|
|
589
|
-
const result = await
|
|
590
|
-
authenticationId: "example-value",
|
|
591
|
-
});
|
|
588
|
+
const result = await zapier.apps.appKey();
|
|
592
589
|
```
|
|
593
590
|
|
|
594
591
|
#### `apps.{appKey}.{actionType}.{actionKey}`
|
|
@@ -597,12 +594,12 @@ Execute an action with the given inputs for the bound app, as an alternative to
|
|
|
597
594
|
|
|
598
595
|
**Parameters:**
|
|
599
596
|
|
|
600
|
-
| Name
|
|
601
|
-
|
|
|
602
|
-
| `options`
|
|
603
|
-
| ↳ `inputs`
|
|
604
|
-
| ↳ `
|
|
605
|
-
| ↳ `timeoutMs`
|
|
597
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
598
|
+
| ---------------- | ---------------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------- |
|
|
599
|
+
| `options` | `object` | ✅ | — | — | |
|
|
600
|
+
| ↳ `inputs` | `object` | ❌ | — | — | |
|
|
601
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
602
|
+
| ↳ `timeoutMs` | `number` | ❌ | — | — | Maximum time to wait for action completion in milliseconds (default: 180000) |
|
|
606
603
|
|
|
607
604
|
**Returns:** `Promise<PaginatedResult<ActionResultItem>>`
|
|
608
605
|
|
|
@@ -611,15 +608,15 @@ Execute an action with the given inputs for the bound app, as an alternative to
|
|
|
611
608
|
```typescript
|
|
612
609
|
// Get first page and a cursor for the second page
|
|
613
610
|
const { data: actionResults, nextCursor } =
|
|
614
|
-
await
|
|
611
|
+
await zapier.apps.appKey.actionType.actionKey();
|
|
615
612
|
|
|
616
613
|
// Or iterate over all pages
|
|
617
|
-
for await (const page of
|
|
614
|
+
for await (const page of zapier.apps.appKey.actionType.actionKey()) {
|
|
618
615
|
// Do something with each page
|
|
619
616
|
}
|
|
620
617
|
|
|
621
618
|
// Or iterate over individual items across all pages
|
|
622
|
-
for await (const actionResult of
|
|
619
|
+
for await (const actionResult of zapier.apps.appKey.actionType
|
|
623
620
|
.actionKey()
|
|
624
621
|
.items()) {
|
|
625
622
|
// Do something with each actionResult
|
|
@@ -642,7 +639,7 @@ Get detailed information about a specific app
|
|
|
642
639
|
**Example:**
|
|
643
640
|
|
|
644
641
|
```typescript
|
|
645
|
-
const { data: app } = await
|
|
642
|
+
const { data: app } = await zapier.getApp({
|
|
646
643
|
appKey: "example-key",
|
|
647
644
|
});
|
|
648
645
|
```
|
|
@@ -668,204 +665,202 @@ List all available apps with optional filtering
|
|
|
668
665
|
|
|
669
666
|
```typescript
|
|
670
667
|
// Get first page and a cursor for the second page
|
|
671
|
-
const { data: apps, nextCursor } = await
|
|
668
|
+
const { data: apps, nextCursor } = await zapier.listApps();
|
|
672
669
|
|
|
673
670
|
// Or iterate over all pages
|
|
674
|
-
for await (const page of
|
|
671
|
+
for await (const page of zapier.listApps()) {
|
|
675
672
|
// Do something with each page
|
|
676
673
|
}
|
|
677
674
|
|
|
678
675
|
// Or iterate over individual items across all pages
|
|
679
|
-
for await (const app of
|
|
676
|
+
for await (const app of zapier.listApps().items()) {
|
|
680
677
|
// Do something with each app
|
|
681
678
|
}
|
|
682
679
|
```
|
|
683
680
|
|
|
684
|
-
###
|
|
685
|
-
|
|
686
|
-
#### `findFirstAuthentication`
|
|
687
|
-
|
|
688
|
-
Find the first authentication matching the criteria
|
|
689
|
-
|
|
690
|
-
**Parameters:**
|
|
691
|
-
|
|
692
|
-
| Name | Type | Required | Default | Possible Values | Description |
|
|
693
|
-
| ------------- | --------- | -------- | ------- | --------------- | ---------------------------------------------------------------------------------- |
|
|
694
|
-
| `options` | `object` | ✅ | — | — | |
|
|
695
|
-
| ↳ `appKey` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
696
|
-
| ↳ `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
697
|
-
| ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match (searches first, then filters locally) |
|
|
698
|
-
| ↳ `accountId` | `string` | ❌ | — | — | Filter authentications by account ID |
|
|
699
|
-
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
700
|
-
| ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status (true = expired only, false = non-expired only) |
|
|
701
|
-
|
|
702
|
-
**Returns:** `Promise<AuthenticationItem>`
|
|
703
|
-
|
|
704
|
-
**Example:**
|
|
705
|
-
|
|
706
|
-
```typescript
|
|
707
|
-
const { data: authentication } = await sdk.findFirstAuthentication();
|
|
708
|
-
```
|
|
681
|
+
### Client Credentials
|
|
709
682
|
|
|
710
|
-
#### `
|
|
683
|
+
#### `createClientCredentials`
|
|
711
684
|
|
|
712
|
-
|
|
685
|
+
Create new client credentials for the authenticated user
|
|
713
686
|
|
|
714
687
|
**Parameters:**
|
|
715
688
|
|
|
716
|
-
| Name
|
|
717
|
-
|
|
|
718
|
-
| `options`
|
|
719
|
-
| ↳ `
|
|
720
|
-
| ↳ `
|
|
721
|
-
| ↳ `title` | `string` | ❌ | — | — | Filter authentications by exact title match (searches first, then filters locally) |
|
|
722
|
-
| ↳ `accountId` | `string` | ❌ | — | — | Filter authentications by account ID |
|
|
723
|
-
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
724
|
-
| ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status (true = expired only, false = non-expired only) |
|
|
689
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
690
|
+
| ----------------- | -------- | -------- | -------------- | --------------- | ---------------------------------------------- |
|
|
691
|
+
| `options` | `object` | ✅ | — | — | |
|
|
692
|
+
| ↳ `name` | `string` | ✅ | — | — | Human-readable name for the client credentials |
|
|
693
|
+
| ↳ `allowedScopes` | `array` | ❌ | `["external"]` | — | Scopes to allow for these credentials |
|
|
725
694
|
|
|
726
|
-
**Returns:** `Promise<
|
|
695
|
+
**Returns:** `Promise<any>`
|
|
727
696
|
|
|
728
697
|
**Example:**
|
|
729
698
|
|
|
730
699
|
```typescript
|
|
731
|
-
const
|
|
700
|
+
const result = await zapier.createClientCredentials({
|
|
701
|
+
name: "example-value",
|
|
702
|
+
});
|
|
732
703
|
```
|
|
733
704
|
|
|
734
|
-
#### `
|
|
705
|
+
#### `deleteClientCredentials`
|
|
735
706
|
|
|
736
|
-
|
|
707
|
+
Delete client credentials by client ID
|
|
737
708
|
|
|
738
709
|
**Parameters:**
|
|
739
710
|
|
|
740
|
-
| Name
|
|
741
|
-
|
|
|
742
|
-
| `options`
|
|
743
|
-
| ↳ `
|
|
711
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
712
|
+
| ------------ | -------- | -------- | ------- | --------------- | ------------------------------------------------- |
|
|
713
|
+
| `options` | `object` | ✅ | — | — | |
|
|
714
|
+
| ↳ `clientId` | `string` | ✅ | — | — | The client ID of the client credentials to delete |
|
|
744
715
|
|
|
745
|
-
**Returns:** `Promise<
|
|
716
|
+
**Returns:** `Promise<any>`
|
|
746
717
|
|
|
747
718
|
**Example:**
|
|
748
719
|
|
|
749
720
|
```typescript
|
|
750
|
-
const
|
|
751
|
-
|
|
721
|
+
const result = await zapier.deleteClientCredentials({
|
|
722
|
+
clientId: "example-id",
|
|
752
723
|
});
|
|
753
724
|
```
|
|
754
725
|
|
|
755
|
-
#### `
|
|
726
|
+
#### `listClientCredentials`
|
|
756
727
|
|
|
757
|
-
List
|
|
728
|
+
List client credentials for the authenticated user
|
|
758
729
|
|
|
759
730
|
**Parameters:**
|
|
760
731
|
|
|
761
|
-
| Name
|
|
762
|
-
|
|
|
763
|
-
| `options`
|
|
764
|
-
| ↳ `
|
|
765
|
-
| ↳ `
|
|
766
|
-
| ↳ `
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own authentications or a specific user ID |
|
|
770
|
-
| ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status (true = expired only, false = non-expired only) |
|
|
771
|
-
| ↳ `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
|
|
772
|
-
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
773
|
-
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
774
|
-
|
|
775
|
-
**Returns:** `Promise<PaginatedResult<AuthenticationItem>>`
|
|
732
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
733
|
+
| ------------ | -------- | -------- | ------- | --------------- | ---------------------------------------------- |
|
|
734
|
+
| `options` | `object` | ✅ | — | — | |
|
|
735
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of credentials per page |
|
|
736
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
737
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
738
|
+
|
|
739
|
+
**Returns:** `Promise<PaginatedResult<ClientCredentialsItem>>`
|
|
776
740
|
|
|
777
741
|
**Example:**
|
|
778
742
|
|
|
779
743
|
```typescript
|
|
780
744
|
// Get first page and a cursor for the second page
|
|
781
|
-
const { data:
|
|
745
|
+
const { data: clientCredentials, nextCursor } =
|
|
746
|
+
await zapier.listClientCredentials();
|
|
782
747
|
|
|
783
748
|
// Or iterate over all pages
|
|
784
|
-
for await (const page of
|
|
749
|
+
for await (const page of zapier.listClientCredentials()) {
|
|
785
750
|
// Do something with each page
|
|
786
751
|
}
|
|
787
752
|
|
|
788
753
|
// Or iterate over individual items across all pages
|
|
789
|
-
for await (const
|
|
790
|
-
// Do something with each
|
|
754
|
+
for await (const clientCredentials of zapier.listClientCredentials().items()) {
|
|
755
|
+
// Do something with each clientCredentials
|
|
791
756
|
}
|
|
792
757
|
```
|
|
793
758
|
|
|
794
|
-
###
|
|
759
|
+
### Connections
|
|
795
760
|
|
|
796
|
-
#### `
|
|
761
|
+
#### `findFirstConnection`
|
|
797
762
|
|
|
798
|
-
|
|
763
|
+
Find the first connection matching the criteria
|
|
799
764
|
|
|
800
765
|
**Parameters:**
|
|
801
766
|
|
|
802
|
-
| Name
|
|
803
|
-
|
|
|
804
|
-
| `options`
|
|
805
|
-
| ↳ `
|
|
806
|
-
| ↳ `
|
|
767
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
768
|
+
| ------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
|
|
769
|
+
| `options` | `object` | ✅ | — | — | |
|
|
770
|
+
| ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
771
|
+
| ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
772
|
+
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
773
|
+
| ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
774
|
+
| ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
|
|
775
|
+
| ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
|
|
807
776
|
|
|
808
|
-
**Returns:** `Promise<
|
|
777
|
+
**Returns:** `Promise<ConnectionItem>`
|
|
809
778
|
|
|
810
779
|
**Example:**
|
|
811
780
|
|
|
812
781
|
```typescript
|
|
813
|
-
const
|
|
814
|
-
name: "example-value",
|
|
815
|
-
});
|
|
782
|
+
const { data: connection } = await zapier.findFirstConnection();
|
|
816
783
|
```
|
|
817
784
|
|
|
818
|
-
#### `
|
|
785
|
+
#### `findUniqueConnection`
|
|
819
786
|
|
|
820
|
-
|
|
787
|
+
Find a unique connection matching the criteria
|
|
821
788
|
|
|
822
789
|
**Parameters:**
|
|
823
790
|
|
|
824
|
-
| Name
|
|
825
|
-
|
|
|
826
|
-
| `options`
|
|
827
|
-
| ↳ `
|
|
791
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
792
|
+
| ------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
|
|
793
|
+
| `options` | `object` | ✅ | — | — | |
|
|
794
|
+
| ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
795
|
+
| ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
796
|
+
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
797
|
+
| ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
798
|
+
| ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
|
|
799
|
+
| ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
|
|
828
800
|
|
|
829
|
-
**Returns:** `Promise<
|
|
801
|
+
**Returns:** `Promise<ConnectionItem>`
|
|
830
802
|
|
|
831
803
|
**Example:**
|
|
832
804
|
|
|
833
805
|
```typescript
|
|
834
|
-
const
|
|
835
|
-
clientId: "example-id",
|
|
836
|
-
});
|
|
806
|
+
const { data: connection } = await zapier.findUniqueConnection();
|
|
837
807
|
```
|
|
838
808
|
|
|
839
|
-
#### `
|
|
809
|
+
#### `getConnection`
|
|
840
810
|
|
|
841
|
-
|
|
811
|
+
Execute getConnection
|
|
842
812
|
|
|
843
813
|
**Parameters:**
|
|
844
814
|
|
|
845
|
-
| Name
|
|
846
|
-
|
|
|
847
|
-
| `options`
|
|
848
|
-
| ↳ `
|
|
849
|
-
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
850
|
-
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
815
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
816
|
+
| ---------------- | ---------------- | -------- | ------- | --------------- | ------------------------------------ |
|
|
817
|
+
| `options` | `object` | ✅ | — | — | |
|
|
818
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
851
819
|
|
|
852
|
-
**Returns:** `Promise<
|
|
820
|
+
**Returns:** `Promise<ConnectionItem>`
|
|
821
|
+
|
|
822
|
+
**Example:**
|
|
823
|
+
|
|
824
|
+
```typescript
|
|
825
|
+
const { data: connection } = await zapier.getConnection();
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
#### `listConnections`
|
|
829
|
+
|
|
830
|
+
List available connections with optional filtering
|
|
831
|
+
|
|
832
|
+
**Parameters:**
|
|
833
|
+
|
|
834
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
835
|
+
| ----------------- | --------- | -------- | ------- | --------------- | ------------------------------------------------------------------------------ |
|
|
836
|
+
| `options` | `object` | ✅ | — | — | |
|
|
837
|
+
| ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
838
|
+
| ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
839
|
+
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
840
|
+
| ↳ `appKey` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
841
|
+
| ↳ `connectionIds` | `array` | ❌ | — | — | List of connection IDs to filter by |
|
|
842
|
+
| ↳ `accountId` | `string` | ❌ | — | — | Account ID to filter by |
|
|
843
|
+
| ↳ `isExpired` | `boolean` | ❌ | — | — | Filter by expired status |
|
|
844
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of connections per page |
|
|
845
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
846
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
847
|
+
|
|
848
|
+
**Returns:** `Promise<PaginatedResult<ConnectionItem>>`
|
|
853
849
|
|
|
854
850
|
**Example:**
|
|
855
851
|
|
|
856
852
|
```typescript
|
|
857
853
|
// Get first page and a cursor for the second page
|
|
858
|
-
const { data:
|
|
859
|
-
await sdk.listClientCredentials();
|
|
854
|
+
const { data: connections, nextCursor } = await zapier.listConnections();
|
|
860
855
|
|
|
861
856
|
// Or iterate over all pages
|
|
862
|
-
for await (const page of
|
|
857
|
+
for await (const page of zapier.listConnections()) {
|
|
863
858
|
// Do something with each page
|
|
864
859
|
}
|
|
865
860
|
|
|
866
861
|
// Or iterate over individual items across all pages
|
|
867
|
-
for await (const
|
|
868
|
-
// Do something with each
|
|
862
|
+
for await (const connection of zapier.listConnections().items()) {
|
|
863
|
+
// Do something with each connection
|
|
869
864
|
}
|
|
870
865
|
```
|
|
871
866
|
|
|
@@ -873,24 +868,24 @@ for await (const clientCredentials of sdk.listClientCredentials().items()) {
|
|
|
873
868
|
|
|
874
869
|
#### `fetch`
|
|
875
870
|
|
|
876
|
-
Make authenticated HTTP requests to any API through Zapier's Relay service. Pass
|
|
871
|
+
Make authenticated HTTP requests to any API through Zapier's Relay service. 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.
|
|
877
872
|
|
|
878
873
|
**Parameters:**
|
|
879
874
|
|
|
880
|
-
| Name
|
|
881
|
-
|
|
|
882
|
-
| `url`
|
|
883
|
-
| `init`
|
|
884
|
-
| ↳ `method`
|
|
885
|
-
| ↳ `headers`
|
|
886
|
-
| ↳ `body`
|
|
887
|
-
| ↳ `
|
|
888
|
-
| ↳ `callbackUrl`
|
|
875
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
876
|
+
| ---------------- | -------------------------------- | -------- | ------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
877
|
+
| `url` | `string, custom` | ✅ | — | — | The full URL of the API endpoint to call (proxied through Zapier's Relay service) |
|
|
878
|
+
| `init` | `object` | ❌ | — | — | Request options including method, headers, body, and authentication |
|
|
879
|
+
| ↳ `method` | `string` | ❌ | — | `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS` | HTTP method for the request (defaults to GET) |
|
|
880
|
+
| ↳ `headers` | `object` | ❌ | — | — | HTTP headers to include in the request |
|
|
881
|
+
| ↳ `body` | `string, custom, custom, record` | ❌ | — | — | Request body — plain objects and JSON strings are auto-detected and Content-Type is set accordingly |
|
|
882
|
+
| ↳ `connectionId` | `string, number` | ❌ | — | — | Connection ID to use for this action |
|
|
883
|
+
| ↳ `callbackUrl` | `string` | ❌ | — | — | URL to send async response to (makes request async) |
|
|
889
884
|
|
|
890
885
|
**Returns:** `Promise<Response>`
|
|
891
886
|
|
|
892
887
|
**Example:**
|
|
893
888
|
|
|
894
889
|
```typescript
|
|
895
|
-
const result = await
|
|
890
|
+
const result = await zapier.fetch("example-value", { key: "value" });
|
|
896
891
|
```
|