VX Agents

API directory · Marketing & Analytics

Dub Short Links & Conversion Analytics

v1.0.0 · 12 endpoints · 0 connections · shared by vx.ai

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.

MethodPathOperationDescription
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

  1. Sign in at app.dub.co and open your workspace.
  2. Go to Settings → API Keys and click Create.
  3. 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 taken key on that domain, or a bad interval/groupBy value.
  • 429 Too Many Requests: per-plan rate limit; wait for the Retry-After header.

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 (from listDomains; without one Dub uses dub.sh) and a default tagIds value for campaign links.

Campaign link and its results

  1. listDomains and getTags to pick the domain and tag ids (createTag if the campaign tag is missing).
  2. upsertLink with url, domain, tagIds and utm_source / utm_medium / utm_campaign returns the existing link for that URL instead of a duplicate; use createLink when a custom key (slug) is needed. Set trackConversion=true to record leads and sales.
  3. getLinkInfo with domain + key (or linkId) to read a link back; getLinks with search, tagIds or folderId to browse.
  4. retrieveAnalytics with event=clicks|leads|sales|composite, interval (24h, 7d, 30d, 90d, ytd, all) or start/end, and groupBy:
    • count for a total, timeseries for a trend;
    • countries, devices, referers, utm_campaigns, top_links for breakdowns. Filter to one link with linkId or domain + key, or to a campaign with tagId.
  5. listEvents with the same filters to see individual clicks, leads or sales (who, when, from where).
  6. updateLink to change the destination, UTM values or expiresAt.

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 / end are ISO 8601 date-times; timezone (IANA, default UTC) sets day boundaries for timeseries.
  • A link is identified by domain + key, by its linkId (link_...), or by your own externalId (prefix with ext_ when looking it up).
  • Leads and sales only appear when conversion tracking is set up and the plan includes it.
  • getLinks pages with page and pageSize (max 100); getLinksCount gives the total first.

Source: Dub API reference (https://dub.co/docs/api-reference/introduction), checked 2026-10-19.

How to use this spec

  1. Create a free VX Agents account (sandbox tools included).
  2. Open the marketplace and connect “Dub Short Links & Conversion Analytics” to an agent.
  3. Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.

Related APIs