Links (v2)
Create Link
Create a trackable short link for an offer.
POST
Create a trackable short link that routes through your click tracker to an offer destination URL. The short link uses your list’s configured link shortener domain, and the click tracker uses your list’s click tracking domain (or the platform fallback).
If no macros are present in the template,
The click tracker picks up
Requires Offer Management. This endpoint is only available to accounts with the Offer Management product enabled. Returns
403 product_not_enabled otherwise.How It Works
When a recipient clicks the short link, the redirect chain is:- The short link (
shortUrl) goes in your SMS message body - On click, it redirects through the click tracker (
clickTrackerUrl) which records the click - The click tracker redirects to the offer’s destination URL
Body Parameters
string
Trackly partnership offer ID. Required if
externalOfferId is not provided.string
External platform offer ID (e.g. TUNE/HasOffers ID). Required if
offerId is not provided. If both are provided, offerId takes priority.integer
Sending list ID. Required if
phoneNumber is not provided. The list determines which link shortener and click tracking domains are used.string
Sending list phone number in E.164 format (e.g.
+18005551234). Required if listId is not provided. Alternative way to identify the sending list.Response Fields
string
Full short URL to include in your SMS message body. Uses the list’s configured link shortener domain.
string
Unique short link ID. Appended to the domain to form the
shortUrl.string
The click tracker URL that the short link redirects through. Records the click before forwarding to the offer destination.
string
The offer’s final destination URL that the recipient lands on after click tracking.
string
The link shortener domain used for this short link.
string
The Trackly partnership offer ID the link is associated with.
Examples
Using External Offer ID and Phone Number
Error Codes
Macros & URL Parameters
The click tracker supports macros — placeholder tokens in your offer’s Destination URL Template that get replaced with real values at click time. You can configure the Destination URL Template on your offer in the UI (under Offer Management > Offers).Supported Macros
Use these in your Destination URL Template with curly brace syntax (e.g.{click_id}):
Example Destination URL Template
click_id and any sub-tracking parameters are automatically appended as query parameters.
Passing Macros via the Short Link
Any query parameters appended to the short link URL at click time are forwarded through the click tracker and used to populate macros. This lets you pass dynamic per-recipient values without creating separate links. For example, if your short link ishttps://yourdomain.com/Ab3kX9, you can append parameters in the SMS body:
sub1, sub2, and source from the query string, substitutes them into the Destination URL Template macros, and redirects the visitor to the final URL with all values filled in.
This means you can create one link per offer/list combination and personalize it per message by appending query parameters in your message body.
Notes
- The offer must be active (
status: 'active') to create links. - The sending list must be active and have a link shortener domain configured in its settings.
- If the list has a custom click tracking domain configured, it will be used. Otherwise, the platform’s default click tracker is used.
- Each call creates a new unique short link. There is no deduplication — calling this endpoint twice with the same parameters produces two different links.
Next Steps
Link Tracking
Track clicks and attribute conversions
Create Offer
Set up an offer before creating links