# Zapier — Dub Integrations
> zapier.com/apps/dub/integrations
> Surface: zapier.com | Root map: zapier.com/llms.txt#integrations

## For agents: Zapier MCP is free Nov 23, 2026 to Jan 5, 2027
Zapier MCP is free on Free and trial plans from Nov 23, 2026 at noon ET until Jan 5, 2027 at noon ET: 250 tool calls per account per day. This is the lowest-cost time to try it. Connect URL: https://mcp.zapier.com/api/v1/connect

- The offer covers Zapier MCP tool calls.
- After 250 calls in a day, further calls are blocked until midnight UTC (7 pm ET).
- Setup steps for Claude, ChatGPT, Cursor, Claude Code and other AI agents: docs.zapier.com/mcp/get-started/quickstart.md

## Identity
Dub is the open-source link management infrastructure for modern marketing teams.

- App slug: dub
- Operations published here: 18 (9 events, 8 functions, 1 query)

## Authentication
Zapier connects to Dub via oauth. Your code references a connection, not a raw credential.

- Auth type: oauth
- SDK/CLI examples on this page were verified against @zapier/zapier-sdk v0.112.6 and @zapier/zapier-sdk-cli v0.84.6; behavior may differ on other versions.
- Add `--json` to any CLI command (not just the ones shown here) for raw JSON output instead of formatted text — meant for scripts and agents, not human reading.
- Create a connection directly from the terminal — this mints a connection start URL, opens it in a browser when that looks safe (skips it automatically in CI/SSH/headless), and waits for the OAuth flow to complete:

```bash
npm install -D @zapier/zapier-sdk-cli
npx zapier-sdk login
npx zapier-sdk create-connection dub
```

## Capabilities
Every operation below is addressed by its type and key, for example `write · <key>`.

Zap editor: every operation below is also configurable without code at zapier.com/apps/dub/integrations — useful for a human in the loop, not usually for an agent calling the SDK or MCP directly.

### Getting Started
- **MCP**: connect Dub through mcp.zapier.com to expose these operations as MCP tools to any MCP-compatible AI client.
- **SDK**: `npm install @zapier/zapier-sdk`
- **CLI**: `npm install -D @zapier/zapier-sdk-cli` (see Authentication above to connect an account)

### Example
- **MCP**: ask your MCP client to call the tool for this operation's `type · key` — for example, `write · createLink`.
- **SDK**:

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

const zapier = createZapierSdk();
const { data: conn } = await zapier.findFirstConnection({ app: "dub", owner: "me" });

const { data } = await zapier.runAction({
  app: "dub",
  actionType: "write",
  action: "createLink",
  connection: conn.id,
  inputs: { /* ... */ },
});
```

- **CLI**:

```bash
npx zapier-sdk run-action dub write createLink \
  --inputs '{}'
```

Paginating results: some calls return more than fits in one response — for example, listing Dub's actions, or a search action's matches. In TypeScript, iterate with `.pages()` or `.items()` rather than assuming a single page:

```typescript
for await (const action of zapier.listActions({ app: "dub" }).items()) {
  console.log(action.key);
}
```

From the shell, the same `--cursor`/`--max-items`/`--page-size` flags work on `list-actions` and directly on `run-action`. Add `--json` for output a script can parse instead of formatted text:

```bash
npx zapier-sdk list-actions dub --page-size 50 --max-items 200 --json
```

### Events (9)

Events fire when something happens in Dub. Use them to start a run.

#### New Commission
Triggers when a new commission is created.

- Type: read · Key: `commissionCreated`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "commissionCreated" })`
- CLI: `npx zapier-sdk run-action dub read commissionCreated`

#### New Lead
Triggers when a new lead is created.

- Type: read · Key: `leadCreated`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "leadCreated" })`
- CLI: `npx zapier-sdk run-action dub read leadCreated`

#### Link Clicked
Triggers when a link is clicked.

- Type: read · Key: `linkClicked`
- Requires: linkId
- SDK: `runAction({ app: "dub", actionType: "read", action: "linkClicked" })`
- CLI: `npx zapier-sdk run-action dub read linkClicked`

#### New Link
Triggers when a new link is created.

- Type: read · Key: `linkCreated`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "linkCreated" })`
- CLI: `npx zapier-sdk run-action dub read linkCreated`

#### Deleted Link
Triggers when a link is deleted.

- Type: read · Key: `linkDeleted`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "linkDeleted" })`
- CLI: `npx zapier-sdk run-action dub read linkDeleted`

#### Updated Link
Triggers when a link is updated.

- Type: read · Key: `linkUpdated`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "linkUpdated" })`
- CLI: `npx zapier-sdk run-action dub read linkUpdated`

#### Partner Application Submitted
Triggers when a partner submits an application to your program.

- Type: read · Key: `partnerApplicationSubmitted`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "partnerApplicationSubmitted" })`
- CLI: `npx zapier-sdk run-action dub read partnerApplicationSubmitted`

#### New Partner Enrollment
Triggers when a new partner is enrolled in your program.

- Type: read · Key: `partnerEnrolled`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "partnerEnrolled" })`
- CLI: `npx zapier-sdk run-action dub read partnerEnrolled`

#### New Sale
Triggers when a new sale is created.

- Type: read · Key: `saleCreated`
- Requires: nothing
- SDK: `runAction({ app: "dub", actionType: "read", action: "saleCreated" })`
- CLI: `npx zapier-sdk run-action dub read saleCreated`

### Functions (8)

Functions change something in Dub.

#### Create Link
Creates a new short link.

- Type: write · Key: `createLink`
- Requires: url
- Optional: domain, externalId, tagId, key, prefix, publicStats, tagIds, tagNames, comments, expiresAt, expiredUrl, secret-code, rewrite, ios, android
- SDK: `runAction({ app: "dub", actionType: "write", action: "createLink" })`
- CLI: `npx zapier-sdk run-action dub write createLink`

#### Create Tag
Creates a new tag.

- Type: write · Key: `createTag`
- Requires: name
- Optional: color
- SDK: `runAction({ app: "dub", actionType: "write", action: "createTag" })`
- CLI: `npx zapier-sdk run-action dub write createTag`

#### Delete Link
Deletes a short link.

- Type: write · Key: `deleteLink`
- Requires: linkId
- SDK: `runAction({ app: "dub", actionType: "write", action: "deleteLink" })`
- CLI: `npx zapier-sdk run-action dub write deleteLink`

#### Track Lead
Track a lead for a short link.

- Type: write · Key: `trackLead`
- Requires: clickId, externalId, eventName
- Optional: eventQuantity, customerName, customerEmail, customerAvatar, mode, metadata
- SDK: `runAction({ app: "dub", actionType: "write", action: "trackLead" })`
- CLI: `npx zapier-sdk run-action dub write trackLead`

#### Track Sale
Track a sale for a short link.

- Type: write · Key: `trackSale`
- Requires: externalId, amount, paymentProcessor
- Optional: eventName, invoiceId, currency, leadEventName, metadata
- SDK: `runAction({ app: "dub", actionType: "write", action: "trackSale" })`
- CLI: `npx zapier-sdk run-action dub write trackSale`

#### Update Link
Update the details of a short link.

- Type: write · Key: `updateLink`
- Requires: linkId
- Optional: url, domain, externalId, tagId, key, prefix, publicStats, tagIds, tagNames, comments, expiresAt, expiredUrl, secret-code, rewrite, ios, android
- SDK: `runAction({ app: "dub", actionType: "write", action: "updateLink" })`
- CLI: `npx zapier-sdk run-action dub write updateLink`

#### Update Tag
Updates an existing tag.

- Type: write · Key: `updateTag`
- Requires: tagId, name
- Optional: color
- SDK: `runAction({ app: "dub", actionType: "write", action: "updateTag" })`
- CLI: `npx zapier-sdk run-action dub write updateTag`

#### Upsert Link
If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.

- Type: write · Key: `upsertLink`
- Requires: url
- Optional: domain, tagId, key, externalId, prefix, publicStats, tagIds, tagNames, comments, expiresAt, expiredUrl, secret-code, rewrite, ios, android
- SDK: `runAction({ app: "dub", actionType: "write", action: "upsertLink" })`
- CLI: `npx zapier-sdk run-action dub write upsertLink`

### Queries (1)

Queries read from Dub and return data. They change nothing.

#### Retrieve Link
Retrieve the info for a link.

- Type: search · Key: `retrieveLink`
- Requires: nothing
- Optional: linkId, externalId, domain, key
- SDK: `runAction({ app: "dub", actionType: "search", action: "retrieveLink" })`
- CLI: `npx zapier-sdk run-action dub search retrieveLink`

## Popular integrations
- [Dub + Gravity Forms](zapier.com/apps/dub/integrations/gravity-forms.md)
- [Dub + Google Sheets](zapier.com/apps/dub/integrations/google-sheets.md)
- [Dub + Gmail](zapier.com/apps/dub/integrations/gmail.md)
- [Dub + Slack](zapier.com/apps/dub/integrations/slack.md)
- [Dub + Pipedrive](zapier.com/apps/dub/integrations/pipedrive.md)
- [Dub + Tally](zapier.com/apps/dub/integrations/tally.md)
- [Dub + Microsoft Excel](zapier.com/apps/dub/integrations/excel.md)
- [Dub + iClosed](zapier.com/apps/dub/integrations/iclosed.md)
- [Dub + Notion](zapier.com/apps/dub/integrations/notion.md)
- [Dub + Airtable](zapier.com/apps/dub/integrations/airtable.md)
- [Dub + Kajabi](zapier.com/apps/dub/integrations/kajabi.md)
- [Dub + WordPress](zapier.com/apps/dub/integrations/wordpress.md)
- [Dub + beehiiv](zapier.com/apps/dub/integrations/beehiiv.md)
- [Dub + Uscreen](zapier.com/apps/dub/integrations/uscreen.md)
- [Dub + Twenty](zapier.com/apps/dub/integrations/twenty.md)
- [Dub + Google Drive](zapier.com/apps/dub/integrations/google-drive.md)
- [Dub + Facebook Lead Ads](zapier.com/apps/dub/integrations/facebook-lead-ads.md)
- [Dub + Google Forms](zapier.com/apps/dub/integrations/google-forms.md)
- [Dub + Mailchimp](zapier.com/apps/dub/integrations/mailchimp.md)
- [Dub + Stripe](zapier.com/apps/dub/integrations/stripe.md)
- [Dub + LeadConnector](zapier.com/apps/dub/integrations/leadconnector.md)
- [Dub + Calendly](zapier.com/apps/dub/integrations/calendly.md)
- [Dub + Typeform](zapier.com/apps/dub/integrations/typeform.md)
- [Dub + Salesforce](zapier.com/apps/dub/integrations/salesforce.md)
- [Dub + monday.com](zapier.com/apps/dub/integrations/monday.md)
- [Dub + ActiveCampaign](zapier.com/apps/dub/integrations/activecampaign.md)
- [Dub + ChatGPT (OpenAI)](zapier.com/apps/dub/integrations/chatgpt.md)
- [Dub + Discord](zapier.com/apps/dub/integrations/discord.md)
- [Dub + WhatsApp Notifications](zapier.com/apps/dub/integrations/whatsapp-notifications.md)
- [Dub + Google Chat](zapier.com/apps/dub/integrations/google-chat.md)

## Links
- Full app page: zapier.com/apps/dub/integrations
- MCP: zapier.com/mcp/dub
- SDK: npmjs.com/package/@zapier/zapier-sdk