- Deleting is permanent. Deleted links, tags, domains, folders and customers cannot be restored, and a recreated link starts with zero analytics.
- Tracking cannot be undone.
track.leadandtrack.saleappend conversion data with no delete;invoiceIdontrack.saleis the only duplicate guard (one sale per invoice ID). - Retries. Dub rate limits per key (60-3000 requests/minute by plan, separate per-second
caps on analytics). A 429 is retried up to three times, honouring
Retry-After. Writes are never replayed on a 5xx because Dub has no idempotency keys;links.upsertis the exception: it matches the existing link by destinationurl, so replaying the same body gives the same result. A differentkeyon an existing url renames that link’s slug. - Paging.
links.listandcustomers.listpage by cursor: passnextCursorasstartingAfter.events.list,tags.list,domains.listandfolders.listpage by page number, and a full last page leads to one empty page. - Plans. On Dub’s free plan these answer 403
forbidden“Need higher plan” (checked 11-28):folders.create/update/delete(folders.listworks),track.leadandtrack.sale(track.openworks), everycustomers.*operation,domains.checkStatus, and most of the Partners program (partners, program applications, discount codes, bounties, messages, embed tokens,commissions.create). Without a partner program,commissions.list/update/bulkUpdateandpayouts.listanswer 404 “Program not found” instead. The analytics routes answer 429 withX-RateLimit-Limit: 0. Webhooks need the Business plan. - Webhooks. Dub sends link, click, lead, sale, partner, commission, discount code and message events. Add the endpoint in the workspace’s webhook settings and store its secret as the webhook signature; each delivery’s
Dub-Signature(an HMAC-SHA256 of the body) is checked. - Analytics shapes.
analytics.retrievereturns a count object forgroupBy: 'count'and an array of rows for every other groupBy. - QR codes.
qr.getreturns the SVG document as a string. PNG is not exposed. - Partners program. The partners, program applications, commissions, payouts, discount
codes, bounties, messages and embed token operations come straight from Dub’s OpenAPI file.
The ones that pay, email or ban a partner are
destructive.domains.registerclaims a.linkdomain and isdestructivetoo.
- 63 typed API operations
- 14 incoming webhook event types
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Dub API key before the first call: More: API Key
pnpm corsair setup --plugin=dub --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List the workspace linksWebhooks
This plugin registers 14 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then usewebhookHooks on the plugin factory.
See Webhooks for every event path and payload shape, and Webhooks concept for routing.
What’s next
API reference
Every
dub.api.* operation with input and output types.Webhooks
Event paths, payloads, and
webhookHooks examples.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.