Dub Short Links & Conversion Analytics
Which campaign link actually drove signups and sales? Create branded Dub short links with UTM tags, then pull clicks, leads and sales broken down by country, device, referer or tag, and list the individual click and conversion events behind the numbers.
Connect this API to an AI agent Browse all specs
What you can do with Dub Short Links & Conversion Analytics via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /links |
getLinks | List short links, filtered by domain, tag, folder or search text |
| POST | /links |
createLink | Create a short link for a destination URL |
| GET | /links/info |
getLinkInfo | Look up one link by domain + key, link id or external id |
| GET | /links/count |
getLinksCount | Count links matching a filter |
| PUT | /links/upsert |
upsertLink | Create a link, or return the existing one for the same URL |
| PATCH | /links/{linkId} |
updateLink | Change a link's destination, tags, UTM values or expiry |
| GET | /analytics |
retrieveAnalytics | Get clicks, leads and sales totals, timeseries or breakdowns |
| GET | /events |
listEvents | List individual click, lead or sale events |
| GET | /tags |
getTags | List the workspace's link tags |
| POST | /tags |
createTag | Create a tag for grouping links |
| GET | /folders |
listFolders | List link folders |
| GET | /domains |
listDomains | List the workspace's custom short-link domains |
Authentication
token
Bearer token — sent as Authorization: Bearer <token>
How to get a credential
- Sign in at app.dub.co and open your workspace.
- Go to Settings → API Keys and click Create.
- Name the key, choose All permissions or Restricted with the scopes below, and copy the key (it starts with
dub_). It is shown only once.
Permissions used
| Scope | Operations |
|---|---|
| links.read | getLinks, getLinkInfo, getLinksCount |
| links.write | createLink, upsertLink, updateLink |
| analytics.read | retrieveAnalytics, listEvents |
| tags.read / tags.write | getTags / createTag |
| folders.read | listFolders |
| domains.read | listDomains |
Common errors
- 401 Unauthorized: the key is missing, mistyped or deleted. Create a new one.
- 403 Forbidden: the key lacks the scope above, or the feature (for example conversion events) is not on your plan.
- 400 / 422: invalid
url, a takenkeyon that domain, or a badinterval/groupByvalue. - 429 Too Many Requests: per-plan rate limit; wait for the
Retry-Afterheader.
Store the key as a VX Agents credential (Bearer token); it is sent as Authorization: Bearer dub_....
Usage guide
Setup
- Credential: a Dub workspace API key (
dub_...) from Settings → API Keys, stored as a Bearer credential. The key is tied to one workspace. - Worth pinning: your custom short
domain(fromlistDomains; without one Dub usesdub.sh) and a defaulttagIdsvalue for campaign links.
Campaign link and its results
listDomainsandgetTagsto pick the domain and tag ids (createTagif the campaign tag is missing).upsertLinkwithurl,domain,tagIdsandutm_source/utm_medium/utm_campaignreturns the existing link for that URL instead of a duplicate; usecreateLinkwhen a customkey(slug) is needed. SettrackConversion=trueto record leads and sales.getLinkInfowithdomain+key(orlinkId) to read a link back;getLinkswithsearch,tagIdsorfolderIdto browse.retrieveAnalyticswithevent=clicks|leads|sales|composite,interval(24h,7d,30d,90d,ytd,all) orstart/end, andgroupBy:countfor a total,timeseriesfor a trend;countries,devices,referers,utm_campaigns,top_linksfor breakdowns. Filter to one link withlinkIdordomain+key, or to a campaign withtagId.
listEventswith the same filters to see individual clicks, leads or sales (who, when, from where).updateLinkto change the destination, UTM values orexpiresAt.
Confirm with the user before updateLink on a link that is already shared publicly: changing its url redirects every existing visitor.
Good to know
start/endare ISO 8601 date-times;timezone(IANA, default UTC) sets day boundaries fortimeseries.- A link is identified by
domain+key, by itslinkId(link_...), or by your ownexternalId(prefix withext_when looking it up). - Leads and sales only appear when conversion tracking is set up and the plan includes it.
getLinkspages withpageandpageSize(max 100);getLinksCountgives the total first.
Source: Dub API reference (https://dub.co/docs/api-reference/introduction), checked 2026-10-19.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “Dub Short Links & Conversion Analytics” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.