First-party app
Dub

Dub

Create and manage Dub short links, domains, tags, folders and customers, read click analytics and events, and track lead and sale conversions.

stable MarketingAnalytics & BI

About

Dub ships in the w6w first-party pack. It declares 29 actions, 3 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.dub
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Marketing · Analytics & BI

Overview

Dub is a link management and attribution platform. This app creates, updates, upserts and deletes short links one at a time or in bulk of up to 100, lists and counts them, and manages the domains, tags and folders that organise them.

It reads click, lead and sale analytics (grouped by time, location, device, referrer, UTM and more) and the raw event stream, lists and edits tracked customers, and records lead and sale conversions server-side.

Health checks verify the API key, whether api.dub.co is answering, Dub’s own status page, and the hourly rate-limit headroom.

Build with Dub

Three routes to the same 29 actions. The Workflow tab is generated from Dub's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Get Analytics

analytics-get

Retrieve click, lead or sale analytics for a link, a domain or the whole workspace, optionally grouped (time series, country, device, referrer, UTM, top links…). Requires a paid Dub plan.

Delete Customer

customer-delete

Delete a customer from the workspace.

Get Customer

customer-get

Retrieve one customer by Dub ID, or by your own external ID prefixed with `ext_`.

List Customers

customer-list

List customers recorded by conversion tracking, one cursor page at a time. Pass `nextCursor` as `startingAfter` for the next page.

Update Customer

customer-update

Update a customer's profile, Stripe link or subscription-canceled date.

Check Domain Availability

domain-check-availability

Check whether one or more domains can be registered. Dub supports `.link` domains only.

Create Domain

domain-create

Add a custom domain to the workspace. DNS must then be configured and verified before it serves links.

Delete Domain

domain-delete

Delete a domain from the workspace. This cannot be undone and also deletes every link on the domain.

Update Domain

domain-update

Change a domain's redirects, archive state or deep-link files.

List Events

event-list

List individual click, lead or sale events, newest first, one page at a time. Requires a paid Dub plan.

Create Folder

folder-create

Create a folder to organise links and control who can edit them.

Delete Folder

folder-delete

Delete a folder. Its links keep working but are no longer in the folder.

List Folders

folder-list

List the workspace's link folders, one page at a time.

Update Folder

folder-update

Rename a folder or change its description or access level.

Bulk Create Links

link-bulk-create

Create up to 100 short links in one request. A link that fails is reported in `errors` while the rest are still created.

Bulk Delete Links

link-bulk-delete

Permanently delete up to 100 links by ID. IDs that do not exist are ignored, and the count of links actually removed is returned.

Bulk Update Links

link-bulk-update

Apply the same changes to up to 100 links, selected by link ID or external ID. Only the fields you set change.

Count Links

link-count

Count the short links in the workspace that match the filters.

Create Link

link-create

Create a short link. Leave the slug empty for a random one (7 characters unless `keyLength` says otherwise).

Delete Link

link-delete

Permanently delete a short link and its click history.

Get Link

link-get

Retrieve one short link by its ID, by its external ID, or by domain and slug together.

List Links

link-list

List short links, newest first, one cursor page at a time. Pass `nextCursor` from the result as `startingAfter` for the next page.

Update Link

link-update

Update a short link by ID. Only the fields you set are changed.

Upsert Link

link-upsert

Create a short link, or update the existing one if a link with the same destination URL already exists in the workspace. Safe to repeat.

Create Tag

tag-create

Create a tag for organising links. A random color is picked when none is given.

List Tags

tag-list

List the workspace's link tags, one page at a time.

Update Tag

tag-update

Rename a tag or change its color.

Track Lead

track-lead

Record a lead conversion (a sign-up, trial start…) attributed to a click on a Dub link, and create or match the customer.

Track Sale

track-sale

Record a sale conversion for a customer, optionally tied to an earlier lead event. For a sale with no prior lead, pass a click ID and the customer details (direct sale tracking).

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Dub's real ids.

{
  "manifestVersion": "2",
  "name": "dub-example",
  "steps": [
    {
      "id": "customer-get",
      "uses": {
        "app": "io.w6w.dub",
        "action": "customer-get",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "customerId": "<customerId>"
      }
    }
  ]
}

Here are some of the things you can do

  • Get Customer

    read
    customer-get
  • Get Analytics

    read
    analytics-get
  • List Customers

    search
    customer-list
  • Update Customer

    perform
    customer-update
  • Check Domain Availability

    read
    domain-check-availability

+24 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Dub, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Dub. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "customer-get",
  payload: {
    customerId: "<value>",
    // includeExpandedFields: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action customer-get --payload '{"customerId":"<value>"}'

Give an AI agent Dub — without giving it Dub's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.dub#customer-get",
    "input": {
      "customerId": "<customerId>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Dub connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Dub's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Dub itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Dub declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Dub platform status

status.dub.co (incident.io, Statuspage v2 shape). The `API` component decides; `Link Redirects` is capped at degraded; the dashboard and website are detail only.

dependency

API reachability

Unauthenticated GET of api.dub.co/links. Dub's documented 401 error envelope is the expected healthy answer; credential validity is the `auth:api-key` check's job.

quota

API rate-limit headroom

Requests left in this key's rate-limit window, read from the `X-RateLimit-*` headers of a signed `GET /links?pageSize=1`.