Skip to main content
The Zapier SDK opens up powerful automation possibilities across a wide range of applications. Here are some of the most common use cases to help you get started.

AI Agents & Assistants

Give your AI agents the ability to take real actions across 8,000+ apps.

Building an AI Assistant with Tool Calling

Enable your LLM-powered assistant to interact with external services:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

// Get the user's connected apps
const { data: slackAuth } = await zapier.findFirstAuthentication({
  appKey: "slack",
  owner: "me",
});

// Define tools for your AI agent
const tools = [
  {
    name: "send_slack_message",
    description: "Send a message to a Slack channel",
    parameters: {
      channel: { type: "string", description: "Channel name or ID" },
      message: { type: "string", description: "Message to send" },
    },
    execute: async ({ channel, message }) => {
      const { data } = await zapier.apps.slack.write.send_channel_message({
        inputs: { channel, text: message },
        authenticationId: slackAuth.id,
      });
      return data;
    },
  },
  {
    name: "create_calendar_event",
    description: "Create a Google Calendar event",
    execute: async ({ title, startTime, endTime }) => {
      const { data: calAuth } = await zapier.findFirstAuthentication({
        appKey: "google-calendar",
        owner: "me",
      });
      const { data } = await zapier.apps.google_calendar.write.create_event({
        inputs: { summary: title, start: startTime, end: endTime },
        authenticationId: calAuth.id,
      });
      return data;
    },
  },
];

// Your AI agent can now use these tools based on user requests

Dynamic Action Discovery

Let your AI discover what actions are available:
// List all available actions for an app
const { data: slackActions } = await zapier.listActions({ appKey: "slack" });

// Get input fields for a specific action
const { data: fields } = await zapier.listInputFields({
  appKey: "slack",
  actionType: "write",
  actionKey: "send_channel_message",
  authenticationId: slackAuth.id,
});

// Use this information to dynamically generate tool definitions
const toolSchema = fields.map(field => ({
  name: field.key,
  type: field.type,
  required: field.required,
  description: field.label,
}));

Backend Automation

Automate workflows and sync data between services from your backend.

Cross-Platform Notifications

Send notifications to multiple platforms when events occur:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function notifyTeam(event: {
  title: string;
  message: string;
  severity: "info" | "warning" | "critical";
}) {
  const { data: slackAuth } = await zapier.findFirstAuthentication({
    appKey: "slack",
    owner: "me",
  });

  const { data: discordAuth } = await zapier.findFirstAuthentication({
    appKey: "discord",
    owner: "me",
  });

  // Send to Slack
  await zapier.apps.slack.write.send_channel_message({
    inputs: {
      channel: "#alerts",
      text: `[${event.severity.toUpperCase()}] ${event.title}\n${event.message}`,
    },
    authenticationId: slackAuth.id,
  });

  // Send to Discord
  await zapier.apps.discord.write.send_message({
    inputs: {
      channel_id: process.env.DISCORD_ALERTS_CHANNEL,
      message: `**${event.title}**\n${event.message}`,
    },
    authenticationId: discordAuth.id,
  });
}

// Use in your application
notifyTeam({
  title: "Deployment Complete",
  message: "v2.1.0 deployed to production",
  severity: "info",
});

Data Synchronization

Keep data in sync across multiple platforms:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function syncCustomerToAllPlatforms(customer: {
  email: string;
  name: string;
  company: string;
}) {
  // Add to HubSpot
  const { data: hubspotAuth } = await zapier.findFirstAuthentication({
    appKey: "hubspot",
    owner: "me",
  });

  await zapier.apps.hubspot.write.create_contact({
    inputs: {
      email: customer.email,
      firstname: customer.name.split(" ")[0],
      lastname: customer.name.split(" ").slice(1).join(" "),
      company: customer.company,
    },
    authenticationId: hubspotAuth.id,
  });

  // Add to Mailchimp list
  const { data: mailchimpAuth } = await zapier.findFirstAuthentication({
    appKey: "mailchimp",
    owner: "me",
  });

  await zapier.apps.mailchimp.write.add_subscriber({
    inputs: {
      list_id: process.env.MAILCHIMP_LIST_ID,
      email: customer.email,
      first_name: customer.name.split(" ")[0],
    },
    authenticationId: mailchimpAuth.id,
  });

  // Log to Google Sheets
  const { data: sheetsAuth } = await zapier.findFirstAuthentication({
    appKey: "google-sheets",
    owner: "me",
  });

  await zapier.apps.google_sheets.write.create_row({
    inputs: {
      spreadsheet_id: process.env.CUSTOMERS_SHEET_ID,
      values: [customer.email, customer.name, customer.company, new Date().toISOString()],
    },
    authenticationId: sheetsAuth.id,
  });
}

Developer Tools & DevOps

Automate your development workflow and keep your team informed.

Deployment Notifications

Notify your team when deployments happen:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function notifyDeployment(deployment: {
  environment: string;
  version: string;
  deployer: string;
  changelog: string[];
}) {
  const { data: slackAuth } = await zapier.findFirstAuthentication({
    appKey: "slack",
    owner: "me",
  });

  const changelogText = deployment.changelog.map(c => `• ${c}`).join("\n");

  await zapier.apps.slack.write.send_channel_message({
    inputs: {
      channel: "#deployments",
      text: [
        `🚀 *Deployment to ${deployment.environment}*`,
        `*Version:* ${deployment.version}`,
        `*Deployed by:* ${deployment.deployer}`,
        `*Changes:*\n${changelogText}`,
      ].join("\n"),
    },
    authenticationId: slackAuth.id,
  });
}

Error Monitoring to Issue Tracking

Automatically create issues from errors:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function createIssueFromError(error: {
  message: string;
  stack: string;
  occurrences: number;
  firstSeen: Date;
}) {
  const { data: githubAuth } = await zapier.findFirstAuthentication({
    appKey: "github",
    owner: "me",
  });

  await zapier.apps.github.write.create_issue({
    inputs: {
      repo: "my-org/my-repo",
      title: `[Auto] ${error.message.slice(0, 80)}`,
      body: [
        `## Error Details`,
        `**Message:** ${error.message}`,
        `**Occurrences:** ${error.occurrences}`,
        `**First seen:** ${error.firstSeen.toISOString()}`,
        ``,
        `## Stack Trace`,
        "```",
        error.stack,
        "```",
      ].join("\n"),
      labels: ["bug", "auto-generated"],
    },
    authenticationId: githubAuth.id,
  });
}

CRM & Sales Automation

Streamline your sales workflows with automated data entry and notifications.

Lead Enrichment Pipeline

Enrich new leads with data from multiple sources:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

async function enrichAndRouteLead(lead: { email: string; name: string }) {
  const { data: hubspotAuth } = await zapier.findFirstAuthentication({
    appKey: "hubspot",
    owner: "me",
  });

  // Create the contact in HubSpot
  const { data: contact } = await zapier.apps.hubspot.write.create_contact({
    inputs: {
      email: lead.email,
      firstname: lead.name.split(" ")[0],
      lastname: lead.name.split(" ").slice(1).join(" "),
    },
    authenticationId: hubspotAuth.id,
  });

  // Notify the sales team
  const { data: slackAuth } = await zapier.findFirstAuthentication({
    appKey: "slack",
    owner: "me",
  });

  await zapier.apps.slack.write.send_channel_message({
    inputs: {
      channel: "#sales-leads",
      text: `🎉 New lead: ${lead.name} (${lead.email})`,
    },
    authenticationId: slackAuth.id,
  });

  // Create a follow-up task
  const { data: asanaAuth } = await zapier.findFirstAuthentication({
    appKey: "asana",
    owner: "me",
  });

  await zapier.apps.asana.write.create_task({
    inputs: {
      name: `Follow up with ${lead.name}`,
      notes: `New lead from website. Email: ${lead.email}`,
      due_on: new Date(Date.now() + 2 * 24 * 60 * 60 * 1000).toISOString().split("T")[0],
    },
    authenticationId: asanaAuth.id,
  });

  return contact;
}

Iterating Over Large Datasets

The SDK provides built-in pagination helpers for working with large datasets.

Processing All Records

import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

// Iterate over all apps (with a safety limit)
for await (const app of zapier.listApps({ maxItems: 100 }).items()) {
  console.log(`App: ${app.title} (${app.key})`);
}

// Iterate page by page for more control
for await (const page of zapier.listApps({ search: "google" })) {
  console.log(`Got ${page.data.length} apps in this page`);
  for (const app of page.data) {
    // Process each app
  }
}

// Collect all results (be careful with large datasets!)
const allApps = await Array.fromAsync(
  zapier.listApps({ maxItems: 50 }).items()
);

Making Authenticated HTTP Requests

Use Zapier’s relay service to make authenticated requests to any API:
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();

const { data: slackAuth } = await zapier.findFirstAuthentication({
  appKey: "slack",
  owner: "me",
});

// Make a custom API call through Zapier's relay
const response = await zapier.request({
  url: "https://slack.com/api/users.list",
  method: "GET",
  authenticationId: slackAuth.id,
});

const users = await response.json();

Next Steps