Links (v2)
Shorten Link
Create a trackable short link for any URL or offer.
POST
Create a trackable short link for any URL or an offer from your catalog. Unlike
POST /v2/links (which requires Offer Management and only supports PartnershipOffers), this endpoint works with any URL and with SMS Offers.
Requires SMS product. This endpoint is available to any account with the SMS product enabled. Returns
403 product_not_enabled otherwise.How It Works
There are two modes:- URL mode — provide a raw
urland get a short link pointing directly at it. No affiliate tracking. - Offer mode — provide an
offerId(from your SMS Offers, not PartnershipOffers) and the endpoint resolves the offer’s tracking URL with proper TUNE/Everflow parameters, preserving affiliate attribution.
Body Parameters
string
Raw destination URL to shorten. Must use
http or https scheme. Required unless offerId is provided.string
SMS Offer ID (from the
offers collection). If provided, the endpoint resolves the offer’s tracking URL with proper TUNE/Everflow params. url and offerId are mutually exclusive — provide exactly one; sending both returns 400 mutually_exclusive.integer
Sending list ID — determines which shortener domain to use. Required unless
phoneNumber is provided.string
Sending list phone number in E.164 format (e.g.
+18005551234). Alternative to listId. Required unless listId is provided.string
Contact phone number in E.164 format. Passed as a macro to offer URL templates (
{{phone}}, also available as {{phone_number}}). Optional.object
Key-value pairs stored on the short link for attribution. For example,
{"source": "ai_agent", "conversation_id": "abc123"}. Optional. Constraints: at most 10 keys; keys must be strings and cannot start with $; values are coerced to strings and cannot exceed 500 characters. Violations return 400 invalid_metadata.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 final destination URL that the recipient lands on after redirect.
string
The link shortener domain used for this short link.
string
The SMS offer ID the link is associated with, if an offer was used.
boolean
Whether bot filtering is enabled for this link. Inherited from the offer’s
filter_bots setting when offerId is provided.Examples
Shorten a raw URL
Shorten an offer link with metadata
Error Codes
Notes
- The
metadatafield is stored on theMessageShortLinkdocument and can be used for attribution tracking in analytics. - When
offerIdis provided, the offer’sfilter_botssetting is inherited by the short link. The link tracking service handles bot filtering on click. - Each call creates a new unique short link. There is no deduplication.
- This endpoint is separate from
POST /v2/links, which continues to serve PartnershipOffers only.
Next Steps
Create Link (Offers)
Create links for partnership offers
Link Tracking
Track clicks and attribute conversions