Use Dub to create and manage short links with custom domains, slugs, UTM parameters, and link-preview titles and descriptions. Upsert Link creates or updates a link by destination URL; lookup and deletion also support the identifiers documented for each action.
List actions support filtering, sorting, and pagination. Analytics report clicks, leads, and sales, with grouping by time, geography, device, browser, referrer, and other supported dimensions.
Create, update, delete, or list short links with custom domains, slugs, link-preview titles and descriptions, and UTM parameters. Retrieve click, lead, and sales analytics.
Create a new short link with Dub. Supports custom domains, slugs, UTM parameters, and more.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key urlstring Yes The destination URL of the short link domainstring No Custom domain for the short link (defaults to dub.sh) keystring No Custom slug for the short link (randomly generated if not provided) externalIdstring No External ID for the link in your database tenantIdstring No Tenant ID for grouping links created on behalf of a customer/tenant folderIdstring No Folder ID to organize the link into trackConversionboolean No Whether to track conversions (leads/sales) for the short link tagIdsstring No Comma-separated tag IDs to assign to the link commentsstring No Comments for the short link expiresAtstring No Expiration date in ISO 8601 format passwordstring No Password to protect the short link rewriteboolean No Whether to enable link cloaking archivedboolean No Whether to archive the link titlestring No Custom OG title for the link preview descriptionstring No Custom OG description for the link preview utm_sourcestring No UTM source parameter utm_mediumstring No UTM medium parameter utm_campaignstring No UTM campaign parameter utm_termstring No UTM term parameter utm_contentstring No UTM content parameter
Parameter Type Description idstring Unique ID of the created link domainstring Domain of the short link keystring Slug of the short link urlstring Destination URL shortLinkstring Full short link URL qrCodestring QR code URL for the short link archivedboolean Whether the link is archived externalIdstring External ID titlestring OG title descriptionstring OG description tagsjson Tags assigned to the link (id, name, color) folderIdstring Folder the link is organized into tenantIdstring Tenant ID associated with the link trackConversionboolean Whether conversion tracking is enabled clicksnumber Number of clicks leadsnumber Number of leads conversionsnumber Number of conversions salesnumber Number of sales saleAmountnumber Total sale amount in cents lastClickedstring Last clicked timestamp createdAtstring Creation timestamp updatedAtstring Last update timestamp utm_sourcestring UTM source parameter utm_mediumstring UTM medium parameter utm_campaignstring UTM campaign parameter utm_termstring UTM term parameter utm_contentstring UTM content parameter
Create or update a short link by its URL. If a link with the same URL already exists, update it. Otherwise, create a new link.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key urlstring Yes The destination URL of the short link domainstring No Custom domain for the short link (defaults to dub.sh) keystring No Custom slug for the short link (randomly generated if not provided) externalIdstring No External ID for the link in your database tenantIdstring No Tenant ID for grouping links created on behalf of a customer/tenant folderIdstring No Folder ID to organize the link into trackConversionboolean No Whether to track conversions (leads/sales) for the short link tagIdsstring No Comma-separated tag IDs to assign to the link commentsstring No Comments for the short link expiresAtstring No Expiration date in ISO 8601 format passwordstring No Password to protect the short link rewriteboolean No Whether to enable link cloaking archivedboolean No Whether to archive the link titlestring No Custom OG title for the link preview descriptionstring No Custom OG description for the link preview utm_sourcestring No UTM source parameter utm_mediumstring No UTM medium parameter utm_campaignstring No UTM campaign parameter utm_termstring No UTM term parameter utm_contentstring No UTM content parameter
Parameter Type Description idstring Unique ID of the link domainstring Domain of the short link keystring Slug of the short link urlstring Destination URL shortLinkstring Full short link URL qrCodestring QR code URL for the short link archivedboolean Whether the link is archived externalIdstring External ID titlestring OG title descriptionstring OG description tagsjson Tags assigned to the link (id, name, color) folderIdstring Folder the link is organized into tenantIdstring Tenant ID associated with the link trackConversionboolean Whether conversion tracking is enabled clicksnumber Number of clicks leadsnumber Number of leads conversionsnumber Number of conversions salesnumber Number of sales saleAmountnumber Total sale amount in cents lastClickedstring Last clicked timestamp createdAtstring Creation timestamp updatedAtstring Last update timestamp utm_sourcestring UTM source parameter utm_mediumstring UTM medium parameter utm_campaignstring UTM campaign parameter utm_termstring UTM term parameter utm_contentstring UTM content parameter
Retrieve information about a short link by its link ID, external ID, or domain + key combination.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key linkIdstring No The unique ID of the short link externalIdstring No The external ID of the link in your database domainstring No The domain of the link (use with key) keystring No The slug of the link (use with domain)
Parameter Type Description idstring Unique ID of the link domainstring Domain of the short link keystring Slug of the short link urlstring Destination URL shortLinkstring Full short link URL qrCodestring QR code URL for the short link archivedboolean Whether the link is archived externalIdstring External ID titlestring OG title descriptionstring OG description tagsjson Tags assigned to the link (id, name, color) folderIdstring Folder the link is organized into tenantIdstring Tenant ID associated with the link trackConversionboolean Whether conversion tracking is enabled clicksnumber Number of clicks leadsnumber Number of leads conversionsnumber Number of conversions salesnumber Number of sales saleAmountnumber Total sale amount in cents lastClickedstring Last clicked timestamp createdAtstring Creation timestamp updatedAtstring Last update timestamp utm_sourcestring UTM source parameter utm_mediumstring UTM medium parameter utm_campaignstring UTM campaign parameter utm_termstring UTM term parameter utm_contentstring UTM content parameter
Update an existing short link's destination URL, domain, slug, link-preview title and description, UTM parameters, and other supported settings.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key linkIdstring Yes The link ID or external ID prefixed with ext_ urlstring No New destination URL domainstring No New custom domain keystring No New custom slug titlestring No Custom OG title descriptionstring No Custom OG description externalIdstring No External ID for the link tenantIdstring No Tenant ID for grouping links created on behalf of a customer/tenant folderIdstring No Folder ID to organize the link into trackConversionboolean No Whether to track conversions (leads/sales) for the short link tagIdsstring No Comma-separated tag IDs commentsstring No Comments for the short link expiresAtstring No Expiration date in ISO 8601 format passwordstring No Password to protect the link rewriteboolean No Whether to enable link cloaking archivedboolean No Whether to archive the link utm_sourcestring No UTM source parameter utm_mediumstring No UTM medium parameter utm_campaignstring No UTM campaign parameter utm_termstring No UTM term parameter utm_contentstring No UTM content parameter
Parameter Type Description idstring Unique ID of the updated link domainstring Domain of the short link keystring Slug of the short link urlstring Destination URL shortLinkstring Full short link URL qrCodestring QR code URL for the short link archivedboolean Whether the link is archived externalIdstring External ID titlestring OG title descriptionstring OG description tagsjson Tags assigned to the link (id, name, color) folderIdstring Folder the link is organized into tenantIdstring Tenant ID associated with the link trackConversionboolean Whether conversion tracking is enabled clicksnumber Number of clicks leadsnumber Number of leads conversionsnumber Number of conversions salesnumber Number of sales saleAmountnumber Total sale amount in cents lastClickedstring Last clicked timestamp createdAtstring Creation timestamp updatedAtstring Last update timestamp utm_sourcestring UTM source parameter utm_mediumstring UTM medium parameter utm_campaignstring UTM campaign parameter utm_termstring UTM term parameter utm_contentstring UTM content parameter
Delete a short link by its link ID or external ID (prefixed with ext_).
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key linkIdstring Yes The link ID or external ID prefixed with ext_
Parameter Type Description idstring ID of the deleted link
Retrieve a paginated list of short links for the authenticated workspace. Supports filtering by domain, search query, tags, and sorting.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key domainstring No Filter by domain searchstring No Search query matched against the short link slug and destination URL tagIdsstring No Comma-separated tag IDs to filter by tenantIdstring No Filter by tenant ID folderIdstring No Filter by folder ID showArchivedboolean No Whether to include archived links (defaults to false) pagenumber No Page number (deprecated by Dub in favor of startingAfter/endingBefore) pageSizenumber No Number of links per page (default: 100, max: 100) startingAfterstring No Cursor: fetch results after this link ID endingBeforestring No Cursor: fetch results before this link ID
Parameter Type Description linksjson Array of link objects (id, domain, key, url, shortLink, clicks, tags, createdAt) countnumber Number of links returned
Retrieve the number of short links for the authenticated workspace, optionally filtered and grouped by domain, tag, user, or folder.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key domainstring No Filter by domain searchstring No Search query matched against the short link slug and destination URL tagIdsstring No Comma-separated tag IDs to filter by tagNamesstring No Comma-separated tag names to filter by (case-insensitive) folderIdstring No Filter by folder ID showArchivedboolean No Whether to include archived links (defaults to false) groupBystring No Group counts by: domain, tagId, userId, or folderId
Parameter Type Description countnumber Total number of links matching the filters groupsjson Per-group counts when groupBy is set (e.g. [{ domain, count }])
Create up to 100 short links in a single request. Returns the created links alongside any per-link errors.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key linksjson Yes JSON array of link objects to create. Each object requires a "url" and may include domain, key, tagIds, and other link fields (max 100).
Parameter Type Description createdjson Array of successfully created link objects errorsjson Array of per-link errors ({ link, error, code }) for links that failed countnumber Number of links successfully created
Apply the same set of field updates to up to 100 links at once, selected by link IDs or external IDs.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key linkIdsstring No Comma-separated link IDs to update (max 100, takes precedence over externalIds) externalIdsstring No Comma-separated external IDs to update (max 100) datajson Yes JSON object of fields to apply to every selected link (e.g. { "archived": true, "tagIds": ["..."] })
Parameter Type Description updatedjson Array of updated link objects countnumber Number of links updated
Delete up to 100 short links in a single request by their link IDs. Non-existing IDs are ignored.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key linkIdsstring Yes Comma-separated link IDs to delete (max 100)
Parameter Type Description deletedCountnumber Number of links that were deleted
Retrieve analytics for links including clicks, leads, and sales. Supports filtering by link, time range, and grouping by various dimensions.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key eventstring No Event type: clicks (default), leads, sales, or composite groupBystring No Group results by: count (default), timeseries, countries, cities, devices, browsers, os, referers, top_links, top_urls linkIdstring No Filter by link ID externalIdstring No Filter by external ID (prefix with ext_) domainstring No Filter by domain intervalstring No Time interval: 24h (default), 7d, 30d, 90d, 1y, mtd, qtd, ytd, or all startstring No Start date/time in ISO 8601 format (overrides interval) endstring No End date/time in ISO 8601 format (defaults to now) countrystring No Filter by country (ISO 3166-1 alpha-2 code) timezonestring No IANA timezone for timeseries data (defaults to UTC)
Parameter Type Description clicksnumber Total number of clicks leadsnumber Total number of leads salesnumber Total number of sales saleAmountnumber Total sale amount in cents datajson Grouped analytics data (timeseries, countries, devices, etc.)
Retrieve a paginated stream of individual click, lead, and sale events for links, with filtering by link, time range, and location.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key eventstring No Event type: clicks (default), leads, or sales linkIdstring No Filter by link ID externalIdstring No Filter by external ID (prefix with ext_) domainstring No Filter by domain intervalstring No Time interval: 24h (default), 7d, 30d, 90d, 1y, mtd, qtd, ytd, or all startstring No Start date/time in ISO 8601 format (overrides interval) endstring No End date/time in ISO 8601 format (defaults to now) countrystring No Filter by country (ISO 3166-1 alpha-2 code) timezonestring No IANA timezone for event timestamps (defaults to UTC) pagenumber No Page number (default: 1) limitnumber No Number of events per page (default: 100, max: 1000) sortOrderstring No Sort order: desc (default) or asc
Parameter Type Description eventsjson Array of event objects (event, timestamp, click, link, and customer/sale data when applicable) countnumber Number of events returned
Generate a customizable QR code (PNG) for a short link, with control over size, error correction, colors, and margin.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key urlstring Yes The short link URL to encode in the QR code logostring No URL of a custom logo to embed in the QR code (requires a paid Dub plan) sizenumber No QR code size in pixels (default: 600) levelstring No Error correction level: L (default), M, Q, or H fgColorstring No Foreground color in hex (default: #000000) bgColorstring No Background color in hex (default: #FFFFFF) hideLogoboolean No Whether to hide the logo in the center of the QR code (default: false) marginnumber No Margin (quiet zone) around the QR code (default: 2)
Parameter Type Description filefile Generated QR code image stored in execution files
Retrieve the custom domains registered in the workspace, so links can be created against the right domain.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key archivedboolean No Whether to include archived domains (defaults to false) searchstring No Search by domain name pagenumber No Page number (default: 1) pageSizenumber No Number of domains per page (default: 50, max: 50)
Parameter Type Description domainsjson Array of domain objects (slug, verified, primary, archived) countnumber Number of domains returned
Retrieve the tags defined in the workspace, so the right tag IDs can be assigned to links.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key searchstring No Search by tag name sortBystring No Field to sort by: name (default) or createdAt sortOrderstring No Sort order: asc (default) or desc pagenumber No Page number (default: 1) pageSizenumber No Number of tags per page (default: 100, max: 100)
Parameter Type Description tagsjson Array of tag objects (id, name, color) countnumber Number of tags returned
Create a new tag in the workspace for organizing and filtering short links.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key namestring Yes The name of the tag to create (1-50 characters) colorstring No Tag color: red, yellow, green, blue, purple, brown, gray, or pink (random if omitted)
Parameter Type Description idstring Unique ID of the created tag namestring Name of the tag colorstring Color assigned to the tag
Retrieve the folders defined in the workspace, so the right folder ID can be used to organize links.
Inputs and outputsParameter Type Required Description apiKeystring Yes Dub API key searchstring No Search by folder name pagenumber No Page number (default: 1) pageSizenumber No Number of folders per page (default: 50, max: 50)
Parameter Type Description foldersjson Array of folder objects (id, name, accessLevel) countnumber Number of folders returned