Marketing
Dub in your product and your AI agents, through one API
The Dub toolkit lists, creates and updates short links, organizes them with tags and folders, and reads analytics and individual click, lead and sale events. Your product or AI agent calls them through Connect, which handles the customer's OAuth connection and logs every execution.
15 days to try it. No credit card.
POST https://connect.reportei.com/api/tools/dub_create_link/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json
{
"customer_toolkit": "<connection UUID>",
"arguments": {
"url": "<url>"
}
}How it works
From a connected customer to the first Dub call.
- 1
Your customer connects the account
Your system opens a Connect session for the toolkit and your customer connects their Dub account. You get the connection id.
- 2
Your product calls the tool
A POST to /api/tools/{tool}/execute with the connection id and arguments. On success, Connect preserves the app's response status and body.
- 3
Connect handles the rest
It stores the credential encrypted, renews tokens for OAuth connections that support renewal and records executions in an audit trail available through the API.
Use cases
What your product does with Dub.
Short links inside your product
A SaaS creates a short link with UTM parameters for each campaign or invite and stores the returned shortLink.
Campaign reports from click data
An agency tool pulls clicks, leads and sales by link, tag or folder and charts them in its own dashboard.
Agent that tidies links
An AI agent lists links, creates a tag for a client and updates or archives links that are out of date.
Tools
10 Dub tools
- List linksGETLists the short links of the workspace with destination, tags, folder, UTM parameters and the counts of clicks, leads and sales. For the next page, send the id of the last link as startingAfter; a page shorter than pageSize is the last one.
- Get linkGETReturns one short link with its counts of clicks, leads and sales. Send domain and key together, such as dub.sh and abc123 for dub.sh/abc123, or send linkId.
- Create linkPOSTShortens a URL and returns the short link in shortLink, with its id. Without domain it uses the primary domain of the workspace, or dub.sh when there is none, and without key Dub picks a random 7-character slug.
- Update linkPATCHChanges a short link; only the fields sent change. A new domain or key changes the short link itself, and archived true hides the link from List links.
- Get analyticsGETReturns clicks, leads or sales of the workspace, a domain, a link, a tag or a folder, as a total, a time series or a ranking chosen by groupBy. Without start and interval it covers the last 24 hours, and it needs the Pro plan or higher.
- List eventsGETLists click, lead or sale events one by one, with time, link and click details and, for leads and sales, the customer; it needs the Business plan or higher. Without start and interval it covers the last 24 hours, and a page shorter than limit is the last one.
- List domainsGETLists the custom domains of the workspace, whose slug goes in the domain argument of the link tools. Pages start at 1, and a page shorter than pageSize is the last one.
- List tagsGETLists the tags of the workspace with their ids and colors. Pages start at 1, and a page shorter than pageSize is the last one.
- Create tagPOSTCreates a tag to organize links, such as a campaign or a client. The response has the id that goes in tagIds.
- List foldersGETLists the link folders of the workspace with their ids. Pages start at 1, and a page shorter than pageSize is the last one.
OAuth with your product's app
You register your product's OAuth app once, with POST /api/merchants/credentials/dub, and your customer authorizes the account on a consent screen. Connect renews the token when it is about to expire.
Questions about the Dub toolkit
Do I need to build against the Dub API?
No. Connect ships 10 Dub tools, described and ready. Your customer connects the account and your system calls every tool through the same endpoint, with the same request format.
How does my customer connect their Dub account?
With the mode the toolkit accepts: OAuth with your product's app. Connect stores the credential encrypted and never returns it to your system.
Does it work with AI agents?
Yes. Each tool's input is described in JSON Schema, which your agent uses directly as a tool definition. The agent picks the tool and the arguments, and your system makes the call to Connect.
Does my customer need a Reportei account?
No. Your customer connects the account on a Connect screen, or your system sends the credential through the API, and they keep using only your product.
See Connect applied to your product.
Try it for 15 days with no card, or walk our team through your use case.
