Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Zapier SDK Examples
Copyright (c) 2026 Zapier, Inc.

The example code in this folder is licensed under the MIT License; see LICENSE.

Third-party trademarks
----------------------
Product and company names referenced in these examples (e.g., Google, HubSpot, ActiveCampaign, Notion, Discord, and others) are trademarks or registered trademarks of their respective owners. They are used solely to identify the third-party service that each example integrates with via the Zapier platform.

These examples are not affiliated with, endorsed by, or sponsored by any of those companies, and no affiliation or endorsement should be inferred.

The MIT License covers the example code only. No trademark rights are granted, whether in the marks of Zapier or of any third party.

Zapier and the Zapier logo are trademarks of Zapier, Inc.
59 changes: 59 additions & 0 deletions examples/by-app/activecampaign/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ActiveCampaign — Zapier SDK

> Product and company names used in these examples are trademarks of their respective owners
> and are used only to identify the service each example integrates with. These examples are
> not affiliated with, endorsed by, or sponsored by those companies.

**Catalog:** Write 22 · Read 22 · Search 8 · **Total:** 52 actions

## Discovery flow

Run these commands to explore this app's available actions and input schemas at runtime.

```bash
# 1. Confirm the app slug
npx zapier-sdk list-apps

# 2. App metadata
npx zapier-sdk get-app activecampaign

# 3. List all actions (or filter by type: write | read | search)
npx zapier-sdk list-actions activecampaign
npx zapier-sdk list-actions activecampaign --action-type write
npx zapier-sdk list-actions activecampaign --action-type read
npx zapier-sdk list-actions activecampaign --action-type search

# 4. Full definition and input schema for any action
npx zapier-sdk get-action activecampaign <action-type> <action-key>
npx zapier-sdk list-action-input-fields activecampaign <action-type> <action-key>

# 5. Manage connections
npx zapier-sdk list-connections activecampaign
npx zapier-sdk create-connection activecampaign # human completes OAuth
```

For dynamic input fields, list the valid choices (requires a connection):

```bash
npx zapier-sdk list-action-input-field-choices activecampaign <action-type> <action-key> <field-key> \
--connection <connection-id>
```

## CLI examples

```bash
# Create an account with a name and optional URL.
npx zapier-sdk run-action activecampaign write account_add --connection <connection-id> \
--inputs '{"name":"Acme Corporation","account_url":"https://acme-corp.com"}'

# Find an account by name.
npx zapier-sdk run-action activecampaign search find_account --connection <connection-id> \
--inputs '{"name":"Acme Corporation"}'
```

## SDK examples

| File | JTBD |
|---|---|
| [`create-account.ts`](./create-account.ts) | Create an account with a name and optional URL. |
| [`find-account.ts`](./find-account.ts) | Find an account by name. |
29 changes: 29 additions & 0 deletions examples/by-app/activecampaign/create-account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* ActiveCampaign — Zapier SDK example.
* Create an account with a name and optional URL.
* Discover all actions at runtime — see ./README.md ("Discovery" section).
* Generated from live discovery. Do not edit by hand.
* Trademarks belong to their respective owners; not affiliated or endorsed. Licensed under MIT; see LICENSE.
*/
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function connect() {
const { data: connection } = await zapier.findFirstConnection({ app: "activecampaign", owner: "me" });
return zapier.apps.activecampaign({ connection: connection.id });
}

/**
* Create Account
* Creates a new account.
*/
export async function createAccount() {
const activecampaign = await connect();
await activecampaign.write.account_add({
inputs: {
name: "Acme Corporation", // required
account_url: "https://acme-corp.com", // optional — Suggested Format: `https://www.example.com`
},
});
}
28 changes: 28 additions & 0 deletions examples/by-app/activecampaign/find-account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* ActiveCampaign — Zapier SDK example.
* Find an account by name.
* Discover all actions at runtime — see ./README.md ("Discovery" section).
* Generated from live discovery. Do not edit by hand.
* Trademarks belong to their respective owners; not affiliated or endorsed. Licensed under MIT; see LICENSE.
*/
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function connect() {
const { data: connection } = await zapier.findFirstConnection({ app: "activecampaign", owner: "me" });
return zapier.apps.activecampaign({ connection: connection.id });
}

/**
* Find Account
* Finds account by name.
*/
export async function findAccount() {
const activecampaign = await connect();
await activecampaign.search.find_account({
inputs: {
name: "Acme Corporation", // required
},
});
}
59 changes: 59 additions & 0 deletions examples/by-app/acuity-scheduling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# AcuityScheduling — Zapier SDK

> Product and company names used in these examples are trademarks of their respective owners
> and are used only to identify the service each example integrates with. These examples are
> not affiliated with, endorsed by, or sponsored by those companies.

**Catalog:** Write 3 · Read 5 · Search 2 · **Total:** 10 actions

## Discovery flow

Run these commands to explore this app's available actions and input schemas at runtime.

```bash
# 1. Confirm the app slug
npx zapier-sdk list-apps

# 2. App metadata
npx zapier-sdk get-app acuity-scheduling

# 3. List all actions (or filter by type: write | read | search)
npx zapier-sdk list-actions acuity-scheduling
npx zapier-sdk list-actions acuity-scheduling --action-type write
npx zapier-sdk list-actions acuity-scheduling --action-type read
npx zapier-sdk list-actions acuity-scheduling --action-type search

# 4. Full definition and input schema for any action
npx zapier-sdk get-action acuity-scheduling <action-type> <action-key>
npx zapier-sdk list-action-input-fields acuity-scheduling <action-type> <action-key>

# 5. Manage connections
npx zapier-sdk list-connections acuity-scheduling
npx zapier-sdk create-connection acuity-scheduling # human completes OAuth
```

For dynamic input fields, list the valid choices (requires a connection):

```bash
npx zapier-sdk list-action-input-field-choices acuity-scheduling <action-type> <action-key> <field-key> \
--connection <connection-id>
```

## CLI examples

```bash
# Block off a specific time period in the Acuity Scheduling calendar.
npx zapier-sdk run-action acuity-scheduling write block --connection <connection-id> \
--inputs '{"start":"2024-07-01T09:00:00-04:00","end":"2024-07-01T11:00:00-04:00","notes":"Vacation time"}'

# Find all appointments for a client using their name or email address.
npx zapier-sdk run-action acuity-scheduling search appointmentsFind --connection <connection-id> \
--inputs '{"firstName":"Emily","lastName":"Johnson","email":"emily.johnson@example.com"}'
```

## SDK examples

| File | JTBD |
|---|---|
| [`add-blocked-off-time.ts`](./add-blocked-off-time.ts) | Block off a specific time period in the Acuity Scheduling calendar. |
| [`find-appointments-by-client-info.ts`](./find-appointments-by-client-info.ts) | Find all appointments for a client using their name or email address. |
30 changes: 30 additions & 0 deletions examples/by-app/acuity-scheduling/add-blocked-off-time.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* AcuityScheduling — Zapier SDK example.
* Block off a specific time period in the Acuity Scheduling calendar.
* Discover all actions at runtime — see ./README.md ("Discovery" section).
* Generated from live discovery. Do not edit by hand.
* Trademarks belong to their respective owners; not affiliated or endorsed. Licensed under MIT; see LICENSE.
*/
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function connect() {
const { data: connection } = await zapier.findFirstConnection({ app: "acuity-scheduling", owner: "me" });
return zapier.apps["acuity-scheduling"]({ connection: connection.id });
}

/**
* Add Blocked Off Time
* Block off a new range of time on your schedule.
*/
export async function addBlockedOffTime() {
const acuityScheduling = await connect();
await acuityScheduling.write.block({
inputs: {
start: "2024-07-01T09:00:00-04:00", // required
end: "2024-07-01T11:00:00-04:00", // required
notes: "Vacation time", // optional — Any notes to attach to the blocked off time.
},
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* AcuityScheduling — Zapier SDK example.
* Find all appointments for a client using their name or email address.
* Discover all actions at runtime — see ./README.md ("Discovery" section).
* Generated from live discovery. Do not edit by hand.
* Trademarks belong to their respective owners; not affiliated or endorsed. Licensed under MIT; see LICENSE.
*/
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function connect() {
const { data: connection } = await zapier.findFirstConnection({ app: "acuity-scheduling", owner: "me" });
return zapier.apps["acuity-scheduling"]({ connection: connection.id });
}

/**
* Find Appointments by Client Info
* Find existing appointments from client info.
*/
export async function findAppointmentsByClientInfo() {
const acuityScheduling = await connect();
await acuityScheduling.search.appointmentsFind({
inputs: {
firstName: "Emily", // optional
lastName: "Johnson", // optional
email: "emily.johnson@example.com", // optional
},
});
}
59 changes: 48 additions & 11 deletions examples/by-app/airtable/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,59 @@
# Airtable
# Airtable — Zapier SDK

Single-action Airtable examples. One authenticated call, no orchestration.
> Product and company names used in these examples are trademarks of their respective owners
> and are used only to identify the service each example integrates with. These examples are
> not affiliated with, endorsed by, or sponsored by those companies.

| File | JTBD |
|---|---|
| [`find-record.ts`](./find-record.ts) | Find a record by matching a field value. Read-only. |
**Catalog:** Write 9 · Read 2 · Search 8 · **Total:** 19 actions

## Run
## Discovery flow

Run these commands to explore this app's available actions and input schemas at runtime.

```bash
npx tsx examples/by-app/airtable/find-record.ts
# 1. Confirm the app slug
npx zapier-sdk list-apps

# 2. App metadata
npx zapier-sdk get-app airtable

# 3. List all actions (or filter by type: write | read | search)
npx zapier-sdk list-actions airtable
npx zapier-sdk list-actions airtable --action-type write
npx zapier-sdk list-actions airtable --action-type read
npx zapier-sdk list-actions airtable --action-type search

# 4. Full definition and input schema for any action
npx zapier-sdk get-action airtable <action-type> <action-key>
npx zapier-sdk list-action-input-fields airtable <action-type> <action-key>

# 5. Manage connections
npx zapier-sdk list-connections airtable
npx zapier-sdk create-connection airtable # human completes OAuth
```

## Discovery
For dynamic input fields, list the valid choices (requires a connection):

```bash
zapier-sdk list-actions airtable
zapier-sdk list-action-input-fields airtable search findRecord
npx zapier-sdk list-action-input-field-choices airtable <action-type> <action-key> <field-key> \
--connection <connection-id>
```

Base ID, table name, and searchable fields are dynamic per connection. Verify with `list-action-input-fields` before running.
## CLI examples

```bash
# Create a new Airtable base in a specific workspace.
npx zapier-sdk run-action airtable write create_base --connection <connection-id> \
--inputs '{"baseName":"Project Tracker","workspaceId":"wspc12345","tableCount":2}'

# Find a table in Airtable matching a keyword.
npx zapier-sdk run-action airtable search findTable --connection <connection-id> \
--inputs '{"keyword":"Tasks","searchField":"name"}'
```

## SDK examples

| File | JTBD |
|---|---|
| [`create-base.ts`](./create-base.ts) | Create a new Airtable base in a specific workspace. |
| [`find-table.ts`](./find-table.ts) | Find a table in Airtable matching a keyword. |
30 changes: 30 additions & 0 deletions examples/by-app/airtable/create-base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Airtable — Zapier SDK example.
* Create a new Airtable base in a specific workspace.
* Discover all actions at runtime — see ./README.md ("Discovery" section).
* Generated from live discovery. Do not edit by hand.
* Trademarks belong to their respective owners; not affiliated or endorsed. Licensed under MIT; see LICENSE.
*/
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function connect() {
const { data: connection } = await zapier.findFirstConnection({ app: "airtable", owner: "me" });
return zapier.apps.airtable({ connection: connection.id });
}

/**
* Create Base
* Create a new Airtable base in your workspace.
*/
export async function createBase() {
const airtable = await connect();
await airtable.write.create_base({
inputs: {
baseName: "Project Tracker", // required — Enter the name for the new base.
workspaceId: "wspc12345", // required — Enter the workspace ID where the base will be created. Find this in your Airtable workspace URL (...
tableCount: 2, // required — default 1 — choices: 1, 2, 3, 4, 5 — How many tables would you like to create?
},
});
}
40 changes: 0 additions & 40 deletions examples/by-app/airtable/find-record.ts

This file was deleted.

Loading
Loading