{ "error": "Blocked URL: URL must use HTTPS", "code": "unsafe_url"}
{ "error": "Offer not found", "code": "offer_not_found"}
{ "error": "No link domain configured for this list", "code": "no_domain_configured"}
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 partnership offers), 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 url and get a short link pointing directly at it. No affiliate tracking.
Offer mode — provide an offerId (from your SMS Offers, not partnership offers) and the endpoint resolves the offer’s tracking URL with proper TUNE/Everflow parameters, preserving affiliate attribution.
When a recipient clicks the short link:
Short link (list domain) -> Link tracking service -> Destination URL
Body Parameters
string
Raw destination URL to shorten. Only https URLs are accepted; http URLs are rejected with 400 unsafe_url. Required unless offerId is provided.
string
ID of an SMS offer in your catalog (see List Offers). Required unless url is provided — url and offerId are mutually exclusive; 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. Fills these macros in the offer’s URL. Optional.
Macro
Value
{{phone}} or {{phone_number}}
The contactPhone value
{{contactId}} or {{contact_id}}
The contact’s Trackly ID
{{listContactId}} or {{list_contact_id}}
The ID of the contact’s subscription to the sending list
{{contactId}} and {{listContactId}} resolve to an empty string when contactPhone is omitted or the contact is not on the sending list.
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.
{ "error": "Blocked URL: URL must use HTTPS", "code": "unsafe_url"}
{ "error": "Offer not found", "code": "offer_not_found"}
{ "error": "No link domain configured for this list", "code": "no_domain_configured"}
Error Codes
HTTP Status
Error Code
Description
400
missing_url_or_offer
Neither url nor offerId was provided.
400
mutually_exclusive
Both url and offerId were provided; supply exactly one.
400
missing_list_identifier
Neither listId nor phoneNumber was provided.
400
invalid_url_scheme
The url does not use http or https scheme.
400
invalid_metadata
The metadata object violates a constraint (not an object, >10 keys, non-string key, key starting with $, or value >500 chars).
400
unsafe_url
The url is blocked by safety checks — for example it uses http instead of https, or it resolves to a private or non-public IP address.
400
invalid_phone
The phoneNumber is not a valid E.164 phone number.
403
product_not_enabled
Your account does not have the SMS product enabled.
404
offer_not_found
No active offer found matching the provided offerId.
404
list_not_found
The sending list was not found or does not belong to your account.
409
no_domain_configured
The sending list does not have a link shortener domain configured.
500
id_collision
Failed to generate a unique link ID after multiple attempts. Retry the request.
Notes
The metadata field is stored with the short link for attribution tracking.
When offerId is provided, the offer’s filter_bots setting 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 partnership offers only.
Next Steps
Create Link (Offers)
Create links for partnership offers
Link Tracking
Track clicks and attribute conversions
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Trackly SMS","colors":{"primary":"#84DE4D","light":"#A8E87A","dark":"#5CB030"},"favicon":"https://mintcdn.com/trackly/m198FBazwIseN-2r/images/favicon.svg?fit=max\u0026auto=format\u0026n=m198FBazwIseN-2r\u0026q=85\u0026s=61a63692248026382c71445dd67beb20","logo":{"light":"https://mintcdn.com/trackly/m198FBazwIseN-2r/images/logo-light.svg?fit=max\u0026auto=format\u0026n=m198FBazwIseN-2r\u0026q=85\u0026s=675b2c397e9309f5fea1d36c1f87c412","dark":"https://mintcdn.com/trackly/m198FBazwIseN-2r/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=m198FBazwIseN-2r\u0026q=85\u0026s=2d8dda3d4bf41d024a88f041f57b57a1"},"api":{"openapi":"openapi.json","playground":{"display":"interactive"},"mdx":{"server":"https://api.tracklysms.com/api","auth":{"method":"key","name":"X-Api-Key"}}},"background":{"decoration":null,"color":{"light":"#F3F7EF","dark":"#0C0F0C"}},"navbar":{"links":[{"label":"Discord","href":"https://discord.gg/trackly"},{"label":"Support","href":"mailto:support@tracklysms.com"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.tracklysms.com"}},"footer":{"socials":{"twitter":"https://twitter.com/tracklysms","linkedin":"https://linkedin.com/company/tracklysms"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"trackly","hasAudioNarration":false,"actualSubdomain":"trackly","customDomains":["docs.tracklysms.com"],"gitSource":{"type":"github","owner":"it-s-today-media","repo":"trackly_sms_python","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b011652e6c40135846ae806","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Documentation","count":350},{"language":"default","tag":"API Reference","count":182},{"language":"default","tag":"Guides","count":55},{"language":"default","tag":"Voice Calls (v1)","count":33},{"language":"default","tag":"Number Requests (v2)","count":14},{"language":"default","tag":"Business Verification (v2)","count":13},{"language":"default","tag":"Platform Integrations","count":12},{"language":"default","tag":"Partner Accounts (v2)","count":11},{"language":"default","tag":"V2 API Reference","count":11},{"language":"default","tag":"Webhooks (v2)","count":11}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tTN1OVgaY.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tTPlOVgaY.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tTOVOVgaY.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tTNVOVgaY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tTNFOVgaY.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tTOlOV.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\nh1,h2,h3{font-family:'JetBrains Mono', monospace;font-weight:700}body,p,li,td{font-family:'Inter', system-ui, -apple-system, sans-serif}"}]}
{"page":{"pagePath":"api-reference/v2/links/shorten-link","slug":"/api-reference/v2/links/shorten-link","pageMetadata":{"title":"Shorten Link","api":"POST /v2/links/shorten","description":"Create a trackable short link for any URL or offer.","href":"/api-reference/v2/links/shorten-link"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a trackable short link for any URL or offer.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Note,ParamField,ResponseField,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Create a trackable short link for any URL or an offer from your catalog. Unlike `,_jsx(_components.code,{children:`POST /v2/links`}),` (which requires Offer Management and only supports partnership offers), this endpoint works with any URL and with SMS Offers.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Requires SMS product.`}),` This endpoint is available to any account with the SMS product enabled. Returns `,_jsx(_components.code,{children:`403 product_not_enabled`}),` otherwise.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How It Works`}),`\n`,_jsx(_components.p,{children:`There are two modes:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`URL mode`}),` — provide a raw `,_jsx(_components.code,{children:`url`}),` and get a short link pointing directly at it. No affiliate tracking.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Offer mode`}),` — provide an `,_jsx(_components.code,{children:`offerId`}),` (from your SMS Offers, not partnership offers) and the endpoint resolves the offer’s tracking URL with proper TUNE/Everflow parameters, preserving affiliate attribution.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`When a recipient clicks the short link:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Short link (list domain) -> Link tracking service -> Destination URL`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsx(ParamField,{body:`url`,type:`string`,id:`param-url`,children:_jsxs(_components.p,{children:[`Raw destination URL to shorten. Only `,_jsx(_components.code,{children:`https`}),` URLs are accepted; `,_jsx(_components.code,{children:`http`}),` URLs are rejected with `,_jsx(_components.code,{children:`400 unsafe_url`}),`. `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`offerId`}),` is provided.`]})}),`\n`,_jsx(ParamField,{body:`offerId`,type:`string`,id:`param-offer-id`,children:_jsxs(_components.p,{children:[`ID of an SMS offer in your catalog (see `,_jsx(_components.a,{href:`/api-reference/v2/offers/list-offers`,children:`List Offers`}),`). `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`url`}),` is provided — `,_jsx(_components.code,{children:`url`}),` and `,_jsx(_components.code,{children:`offerId`}),` are mutually exclusive; sending both returns `,_jsx(_components.code,{children:`400 mutually_exclusive`}),`.`]})}),`\n`,_jsx(ParamField,{body:`listId`,type:`integer`,id:`param-list-id`,children:_jsxs(_components.p,{children:[`Sending list ID — determines which shortener domain to use. `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`phoneNumber`}),` is provided.`]})}),`\n`,_jsx(ParamField,{body:`phoneNumber`,type:`string`,id:`param-phone-number`,children:_jsxs(_components.p,{children:[`Sending list phone number in E.164 format (e.g. `,_jsx(_components.code,{children:`+18005551234`}),`). Alternative to `,_jsx(_components.code,{children:`listId`}),`. `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`listId`}),` is provided.`]})}),`\n`,_jsxs(ParamField,{body:`contactPhone`,type:`string`,id:`param-contact-phone`,children:[_jsx(_components.p,{children:`Contact phone number in E.164 format. Fills these macros in the offer’s URL. Optional.`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Macro`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{{phone}}`}),` or `,_jsx(_components.code,{children:`{{phone_number}}`})]}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`contactPhone`}),` value`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{{contactId}}`}),` or `,_jsx(_components.code,{children:`{{contact_id}}`})]}),_jsx(_components.td,{children:`The contact’s Trackly ID`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{{listContactId}}`}),` or `,_jsx(_components.code,{children:`{{list_contact_id}}`})]}),_jsx(_components.td,{children:`The ID of the contact’s subscription to the sending list`})]})]})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`{{contactId}}`}),` and `,_jsx(_components.code,{children:`{{listContactId}}`}),` resolve to an empty string when `,_jsx(_components.code,{children:`contactPhone`}),` is omitted or the contact is not on the sending list.`]})]}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Key-value pairs stored on the short link for attribution. For example, `,_jsx(_components.code,{children:`{\"source\": \"ai_agent\", \"conversation_id\": \"abc123\"}`}),`. Optional. Constraints: at most 10 keys; keys must be strings and cannot start with `,_jsx(_components.code,{children:`$`}),`; values are coerced to strings and cannot exceed 500 characters. Violations return `,_jsx(_components.code,{children:`400 invalid_metadata`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response-fields`,children:`Response Fields`}),`\n`,_jsx(ResponseField,{name:`shortUrl`,type:`string`,id:`param-short-url`,children:_jsx(_components.p,{children:`Full short URL to include in your SMS message body. Uses the list’s configured link shortener domain.`})}),`\n`,_jsx(ResponseField,{name:`linkId`,type:`string`,id:`param-link-id`,children:_jsxs(_components.p,{children:[`Unique short link ID. Appended to the domain to form the `,_jsx(_components.code,{children:`shortUrl`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`destinationUrl`,type:`string`,id:`param-destination-url`,children:_jsx(_components.p,{children:`The final destination URL that the recipient lands on after redirect.`})}),`\n`,_jsx(ResponseField,{name:`domain`,type:`string`,id:`param-domain`,children:_jsx(_components.p,{children:`The link shortener domain used for this short link.`})}),`\n`,_jsx(ResponseField,{name:`offerId`,type:`string`,id:`param-offer-id-1`,children:_jsx(_components.p,{children:`The SMS offer ID the link is associated with, if an offer was used.`})}),`\n`,_jsx(ResponseField,{name:`filterBots`,type:`boolean`,id:`param-filter-bots`,children:_jsxs(_components.p,{children:[`Whether bot filtering is enabled for this link. Inherited from the offer’s `,_jsx(_components.code,{children:`filter_bots`}),` setting when `,_jsx(_components.code,{children:`offerId`}),` is provided.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`shorten-a-raw-url`,children:`Shorten a raw URL`}),`\n`,`\n`,_jsx(Heading,{level:`3`,id:`shorten-an-offer-link-with-metadata`,children:`Shorten an offer link with metadata`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -X POST https://api.tracklysms.com/api/v2/links/shorten \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-Api-Key: trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"offerId\": \"6651a3ef1234567890abcdef\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"phoneNumber\": \"+18005551234\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"contactPhone\": \"+15551234567\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source\": \"ai_agent\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversation_id\": \"conv_abc123\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.tracklysms.com/api/v2/links/shorten\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers={`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Api-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json={`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"offerId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6651a3ef1234567890abcdef\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"phoneNumber\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+18005551234\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"contactPhone\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+15551234567\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ai_agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversation_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"conv_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`19`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.tracklysms.com/api/v2/links/shorten\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` method: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Api-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body: JSON.stringify({`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` offerId: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6651a3ef1234567890abcdef\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` phoneNumber: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+18005551234\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contactPhone: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+15551234567\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` metadata: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` source: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ai_agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` conversation_id: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"conv_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`console.log(data.shortUrl);`})}),`\n`]})})})]}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`error-codes`,children:`Error Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP Status`}),_jsx(_components.th,{children:`Error Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_url_or_offer`})}),_jsxs(_components.td,{children:[`Neither `,_jsx(_components.code,{children:`url`}),` nor `,_jsx(_components.code,{children:`offerId`}),` was provided.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`mutually_exclusive`})}),_jsxs(_components.td,{children:[`Both `,_jsx(_components.code,{children:`url`}),` and `,_jsx(_components.code,{children:`offerId`}),` were provided; supply exactly one.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_list_identifier`})}),_jsxs(_components.td,{children:[`Neither `,_jsx(_components.code,{children:`listId`}),` nor `,_jsx(_components.code,{children:`phoneNumber`}),` was provided.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_url_scheme`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`url`}),` does not use `,_jsx(_components.code,{children:`http`}),` or `,_jsx(_components.code,{children:`https`}),` scheme.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_metadata`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`metadata`}),` object violates a constraint (not an object, >10 keys, non-string key, key starting with `,_jsx(_components.code,{children:`$`}),`, or value >500 chars).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`unsafe_url`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`url`}),` is blocked by safety checks — for example it uses `,_jsx(_components.code,{children:`http`}),` instead of `,_jsx(_components.code,{children:`https`}),`, or it resolves to a private or non-public IP address.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_phone`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`phoneNumber`}),` is not a valid E.164 phone number.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`product_not_enabled`})}),_jsx(_components.td,{children:`Your account does not have the SMS product enabled.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`offer_not_found`})}),_jsxs(_components.td,{children:[`No active offer found matching the provided `,_jsx(_components.code,{children:`offerId`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`list_not_found`})}),_jsx(_components.td,{children:`The sending list was not found or does not belong to your account.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`no_domain_configured`})}),_jsx(_components.td,{children:`The sending list does not have a link shortener domain configured.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`id_collision`})}),_jsx(_components.td,{children:`Failed to generate a unique link ID after multiple attempts. Retry the request.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`notes`,children:`Notes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.code,{children:`metadata`}),` field is stored with the short link for attribution tracking.`]}),`\n`,_jsxs(_components.li,{children:[`When `,_jsx(_components.code,{children:`offerId`}),` is provided, the offer’s `,_jsx(_components.code,{children:`filter_bots`}),` setting is inherited by the short link. The link tracking service handles bot filtering on click.`]}),`\n`,_jsx(_components.li,{children:`Each call creates a new unique short link. There is no deduplication.`}),`\n`,_jsxs(_components.li,{children:[`This endpoint is separate from `,_jsx(_components.code,{children:`POST /v2/links`}),`, which continues to serve partnership offers only.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Create Link (Offers)`,icon:`tag`,href:`/api-reference/v2/links/create-link`,children:_jsx(_components.p,{children:`Create links for partnership offers`})}),_jsx(Card,{title:`Link Tracking`,icon:`link`,href:`/guides/link-tracking/overview`,children:_jsx(_components.p,{children:`Track clicks and attribute conversions`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Shorten Link","api":"POST /v2/links/shorten","description":"Create a trackable short link for any URL or offer.","href":"/api-reference/v2/links/shorten-link"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Create a trackable short link for any URL or an offer from your catalog. Unlike `,_jsx(_components.code,{children:`POST /v2/links`}),` (which requires Offer Management and only supports partnership offers), this endpoint works with any URL and with SMS Offers.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Requires SMS product.`}),` This endpoint is available to any account with the SMS product enabled. Returns `,_jsx(_components.code,{children:`403 product_not_enabled`}),` otherwise.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How It Works`}),`\n`,_jsx(_components.p,{children:`There are two modes:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`URL mode`}),` — provide a raw `,_jsx(_components.code,{children:`url`}),` and get a short link pointing directly at it. No affiliate tracking.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Offer mode`}),` — provide an `,_jsx(_components.code,{children:`offerId`}),` (from your SMS Offers, not partnership offers) and the endpoint resolves the offer’s tracking URL with proper TUNE/Everflow parameters, preserving affiliate attribution.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`When a recipient clicks the short link:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Short link (list domain) -> Link tracking service -> Destination URL`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsx(ParamField,{body:`url`,type:`string`,id:`param-url`,children:_jsxs(_components.p,{children:[`Raw destination URL to shorten. Only `,_jsx(_components.code,{children:`https`}),` URLs are accepted; `,_jsx(_components.code,{children:`http`}),` URLs are rejected with `,_jsx(_components.code,{children:`400 unsafe_url`}),`. `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`offerId`}),` is provided.`]})}),`\n`,_jsx(ParamField,{body:`offerId`,type:`string`,id:`param-offer-id`,children:_jsxs(_components.p,{children:[`ID of an SMS offer in your catalog (see `,_jsx(_components.a,{href:`/api-reference/v2/offers/list-offers`,children:`List Offers`}),`). `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`url`}),` is provided — `,_jsx(_components.code,{children:`url`}),` and `,_jsx(_components.code,{children:`offerId`}),` are mutually exclusive; sending both returns `,_jsx(_components.code,{children:`400 mutually_exclusive`}),`.`]})}),`\n`,_jsx(ParamField,{body:`listId`,type:`integer`,id:`param-list-id`,children:_jsxs(_components.p,{children:[`Sending list ID — determines which shortener domain to use. `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`phoneNumber`}),` is provided.`]})}),`\n`,_jsx(ParamField,{body:`phoneNumber`,type:`string`,id:`param-phone-number`,children:_jsxs(_components.p,{children:[`Sending list phone number in E.164 format (e.g. `,_jsx(_components.code,{children:`+18005551234`}),`). Alternative to `,_jsx(_components.code,{children:`listId`}),`. `,_jsx(_components.strong,{children:`Required`}),` unless `,_jsx(_components.code,{children:`listId`}),` is provided.`]})}),`\n`,_jsxs(ParamField,{body:`contactPhone`,type:`string`,id:`param-contact-phone`,children:[_jsx(_components.p,{children:`Contact phone number in E.164 format. Fills these macros in the offer’s URL. Optional.`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Macro`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{{phone}}`}),` or `,_jsx(_components.code,{children:`{{phone_number}}`})]}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`contactPhone`}),` value`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{{contactId}}`}),` or `,_jsx(_components.code,{children:`{{contact_id}}`})]}),_jsx(_components.td,{children:`The contact’s Trackly ID`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{{listContactId}}`}),` or `,_jsx(_components.code,{children:`{{list_contact_id}}`})]}),_jsx(_components.td,{children:`The ID of the contact’s subscription to the sending list`})]})]})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`{{contactId}}`}),` and `,_jsx(_components.code,{children:`{{listContactId}}`}),` resolve to an empty string when `,_jsx(_components.code,{children:`contactPhone`}),` is omitted or the contact is not on the sending list.`]})]}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Key-value pairs stored on the short link for attribution. For example, `,_jsx(_components.code,{children:`{\"source\": \"ai_agent\", \"conversation_id\": \"abc123\"}`}),`. Optional. Constraints: at most 10 keys; keys must be strings and cannot start with `,_jsx(_components.code,{children:`$`}),`; values are coerced to strings and cannot exceed 500 characters. Violations return `,_jsx(_components.code,{children:`400 invalid_metadata`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response-fields`,children:`Response Fields`}),`\n`,_jsx(ResponseField,{name:`shortUrl`,type:`string`,id:`param-short-url`,children:_jsx(_components.p,{children:`Full short URL to include in your SMS message body. Uses the list’s configured link shortener domain.`})}),`\n`,_jsx(ResponseField,{name:`linkId`,type:`string`,id:`param-link-id`,children:_jsxs(_components.p,{children:[`Unique short link ID. Appended to the domain to form the `,_jsx(_components.code,{children:`shortUrl`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`destinationUrl`,type:`string`,id:`param-destination-url`,children:_jsx(_components.p,{children:`The final destination URL that the recipient lands on after redirect.`})}),`\n`,_jsx(ResponseField,{name:`domain`,type:`string`,id:`param-domain`,children:_jsx(_components.p,{children:`The link shortener domain used for this short link.`})}),`\n`,_jsx(ResponseField,{name:`offerId`,type:`string`,id:`param-offer-id-1`,children:_jsx(_components.p,{children:`The SMS offer ID the link is associated with, if an offer was used.`})}),`\n`,_jsx(ResponseField,{name:`filterBots`,type:`boolean`,id:`param-filter-bots`,children:_jsxs(_components.p,{children:[`Whether bot filtering is enabled for this link. Inherited from the offer’s `,_jsx(_components.code,{children:`filter_bots`}),` setting when `,_jsx(_components.code,{children:`offerId`}),` is provided.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`shorten-a-raw-url`,children:`Shorten a raw URL`}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -X POST https://api.tracklysms.com/api/v2/links/shorten \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-Api-Key: trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"url\": \"https://example.com/landing-page\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"listId\": 42`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.tracklysms.com/api/v2/links/shorten\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers={`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Api-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json={`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/landing-page\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"listId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: 42,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data = response.json()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`print(data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"shortUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# e.g. https://yourdomain.com/Ab3kX9q`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`14`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.tracklysms.com/api/v2/links/shorten\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` method: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Api-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body: JSON.stringify({`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` url: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/landing-page\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` listId: 42,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`console.log(data.shortUrl);`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`shorten-an-offer-link-with-metadata`,children:`Shorten an offer link with metadata`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -X POST https://api.tracklysms.com/api/v2/links/shorten \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-Api-Key: trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"offerId\": \"6651a3ef1234567890abcdef\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"phoneNumber\": \"+18005551234\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"contactPhone\": \"+15551234567\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source\": \"ai_agent\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversation_id\": \"conv_abc123\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.tracklysms.com/api/v2/links/shorten\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers={`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Api-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json={`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"offerId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6651a3ef1234567890abcdef\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"phoneNumber\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+18005551234\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"contactPhone\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+15551234567\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ai_agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversation_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"conv_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`19`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.tracklysms.com/api/v2/links/shorten\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` method: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Api-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trk_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body: JSON.stringify({`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` offerId: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6651a3ef1234567890abcdef\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` phoneNumber: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+18005551234\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contactPhone: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+15551234567\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` metadata: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` source: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ai_agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` conversation_id: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"conv_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`console.log(data.shortUrl);`})}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Success (201)`,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"shortUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://yourdomain.com/Ab3kX9q\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"linkId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Ab3kX9q\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destinationUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/offer?aff_sub=12345\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"domain\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://yourdomain.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"offerId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6651a3ef1234567890abcdef\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"filterBots\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error - Missing URL or Offer (400)`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"url or offerId is required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"missing_url_or_offer\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error - Invalid URL Scheme (400)`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"URL must use http or https scheme\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_url_scheme\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error - Invalid Metadata (400)`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"metadata cannot exceed 10 keys\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_metadata\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error - Unsafe URL (400)`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Blocked URL: URL must use HTTPS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"unsafe_url\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error - Offer Not Found (404)`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Offer not found\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"offer_not_found\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error - No Domain Configured (409)`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"No link domain configured for this list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"no_domain_configured\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`error-codes`,children:`Error Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP Status`}),_jsx(_components.th,{children:`Error Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_url_or_offer`})}),_jsxs(_components.td,{children:[`Neither `,_jsx(_components.code,{children:`url`}),` nor `,_jsx(_components.code,{children:`offerId`}),` was provided.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`mutually_exclusive`})}),_jsxs(_components.td,{children:[`Both `,_jsx(_components.code,{children:`url`}),` and `,_jsx(_components.code,{children:`offerId`}),` were provided; supply exactly one.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_list_identifier`})}),_jsxs(_components.td,{children:[`Neither `,_jsx(_components.code,{children:`listId`}),` nor `,_jsx(_components.code,{children:`phoneNumber`}),` was provided.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_url_scheme`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`url`}),` does not use `,_jsx(_components.code,{children:`http`}),` or `,_jsx(_components.code,{children:`https`}),` scheme.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_metadata`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`metadata`}),` object violates a constraint (not an object, >10 keys, non-string key, key starting with `,_jsx(_components.code,{children:`$`}),`, or value >500 chars).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`unsafe_url`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`url`}),` is blocked by safety checks — for example it uses `,_jsx(_components.code,{children:`http`}),` instead of `,_jsx(_components.code,{children:`https`}),`, or it resolves to a private or non-public IP address.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_phone`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`phoneNumber`}),` is not a valid E.164 phone number.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`product_not_enabled`})}),_jsx(_components.td,{children:`Your account does not have the SMS product enabled.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`offer_not_found`})}),_jsxs(_components.td,{children:[`No active offer found matching the provided `,_jsx(_components.code,{children:`offerId`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`list_not_found`})}),_jsx(_components.td,{children:`The sending list was not found or does not belong to your account.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`no_domain_configured`})}),_jsx(_components.td,{children:`The sending list does not have a link shortener domain configured.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`id_collision`})}),_jsx(_components.td,{children:`Failed to generate a unique link ID after multiple attempts. Retry the request.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`notes`,children:`Notes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.code,{children:`metadata`}),` field is stored with the short link for attribution tracking.`]}),`\n`,_jsxs(_components.li,{children:[`When `,_jsx(_components.code,{children:`offerId`}),` is provided, the offer’s `,_jsx(_components.code,{children:`filter_bots`}),` setting is inherited by the short link. The link tracking service handles bot filtering on click.`]}),`\n`,_jsx(_components.li,{children:`Each call creates a new unique short link. There is no deduplication.`}),`\n`,_jsxs(_components.li,{children:[`This endpoint is separate from `,_jsx(_components.code,{children:`POST /v2/links`}),`, which continues to serve partnership offers only.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Create Link (Offers)`,icon:`tag`,href:`/api-reference/v2/links/create-link`,children:_jsx(_components.p,{children:`Create links for partnership offers`})}),_jsx(Card,{title:`Link Tracking`,icon:`link`,href:`/guides/link-tracking/overview`,children:_jsx(_components.p,{children:`Track clicks and attribute conversions`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Shorten Link","api":"POST /v2/links/shorten","description":"Create a trackable short link for any URL or offer.","href":"/api-reference/v2/links/shorten-link"}}}},"mdxExtracts":{"tableOfContents":[{"title":"How It Works","slug":"how-it-works","depth":2,"children":[]},{"title":"Body Parameters","slug":"body-parameters","depth":2,"children":[]},{"title":"Response Fields","slug":"response-fields","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Shorten a raw URL","slug":"shorten-a-raw-url","depth":3,"children":[]},{"title":"Shorten an offer link with metadata","slug":"shorten-an-offer-link-with-metadata","depth":3,"children":[]}]},{"title":"Error Codes","slug":"error-codes","depth":2,"children":[]},{"title":"Notes","slug":"notes","depth":2,"children":[]},{"title":"Next Steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> -X POST https://api.tracklysms.com/api/v2/links/shorten \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> -H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"X-Api-Key: trk_your_api_key_here\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> -H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> -d \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"url\": \"https://example.com/landing-page\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"listId\": 42\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response = requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.tracklysms.com/api/v2/links/shorten\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> headers={\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"X-Api-Key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"trk_your_api_key_here\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> json={\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"url\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://example.com/landing-page\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"listId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: 42,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">data = response.json()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">print(data[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"shortUrl\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">]) \u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"># e.g. https://yourdomain.com/Ab3kX9q\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Node.js","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"14\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response = \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> fetch(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api.tracklysms.com/api/v2/links/shorten\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> method: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"POST\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> headers: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"X-Api-Key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"trk_your_api_key_here\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> body: JSON.stringify({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> url: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://example.com/landing-page\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> listId: 42,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }),\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> data = \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response.json();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">console.log(data.shortUrl);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Success (201)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"8\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"shortUrl\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://yourdomain.com/Ab3kX9q\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"linkId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Ab3kX9q\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"destinationUrl\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://example.com/offer?aff_sub=12345\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"domain\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://yourdomain.com\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"offerId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"6651a3ef1234567890abcdef\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"filterBots\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error - Missing URL or Offer (400)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"url or offerId is required\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"missing_url_or_offer\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error - Invalid URL Scheme (400)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"URL must use http or https scheme\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"invalid_url_scheme\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error - Invalid Metadata (400)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"metadata cannot exceed 10 keys\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"invalid_metadata\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error - Unsafe URL (400)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Blocked URL: URL must use HTTPS\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"unsafe_url\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error - Offer Not Found (404)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Offer not found\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"offer_not_found\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error - No Domain Configured (409)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"No link domain configured for this list\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"no_domain_configured\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Shorten Link","path":"/v2/links/shorten","servers":[{"url":"https://api.tracklysms.com/api"}],"method":"post","request":{"security":[{"title":"API Key Auth","parameters":{"header":{"X-Api-Key":{"type":"apiKey"}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"url":[{"type":"string","description":"Raw destination URL to shorten. Only `https` URLs are accepted; `http` URLs are rejected with `400 unsafe_url` . Required unless `offerId` is provided."}],"offerId":[{"type":"string","description":"ID of an SMS offer in your catalog (see List Offers ). Required unless `url` is provided — `url` and `offerId` are mutually exclusive; sending both returns `400 mutually_exclusive` ."}],"listId":[{"type":"integer","description":"Sending list ID — determines which shortener domain to use. Required unless `phoneNumber` is provided."}],"phoneNumber":[{"type":"string","description":"Sending list phone number in E.164 format (e.g. `+18005551234` ). Alternative to `listId` . Required unless `listId` is provided."}],"contactPhone":[{"type":"string","description":"Contact phone number in E.164 format. Fills these macros in the offer’s URL. Optional. Macro Value `{{phone}}` or `{{phone_number}}` The `contactPhone` value `{{contactId}}` or `{{contact_id}}` The contact’s Trackly ID `{{listContactId}}` or `{{list_contact_id}}` The ID of the contact’s subscription to the sending list `{{contactId}}` and `{{listContactId}}` resolve to an empty string when `contactPhone` is omitted or the contact is not on the sending list."}],"metadata":[{"type":"object","properties":{},"description":"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` ."}]}}],"examples":{"example":{"value":{"url":"\u003cstring>","offerId":"\u003cstring>","listId":123,"phoneNumber":"\u003cstring>","contactPhone":"\u003cstring>","metadata":{}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"shortUrl":[{"type":"string","description":"Full short URL to include in your SMS message body. Uses the list’s configured link shortener domain."}],"linkId":[{"type":"string","description":"Unique short link ID. Appended to the domain to form the `shortUrl` ."}],"destinationUrl":[{"type":"string","description":"The final destination URL that the recipient lands on after redirect."}],"domain":[{"type":"string","description":"The link shortener domain used for this short link."}],"offerId":[{"type":"string","description":"The SMS offer ID the link is associated with, if an offer was used."}],"filterBots":[{"type":"boolean","description":"Whether bot filtering is enabled for this link. Inherited from the offer’s `filter_bots` setting when `offerId` is provided."}]}}],"examples":{"example":{"value":{"shortUrl":"\u003cstring>","linkId":"\u003cstring>","destinationUrl":"\u003cstring>","domain":"\u003cstring>","offerId":"\u003cstring>","filterBots":true}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"trackly","siteName":"Trackly SMS","title":"Shorten Link - Trackly SMS","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-15T23:46:07.983Z","originalFileLocation":"api-reference/v2/links/shorten-link.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a trackable short link for any URL or offer.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Trackly SMS\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Shorten Link - Trackly SMS\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a trackable short link for any URL or offer.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Trackly SMS\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://trackly.mintlify.site/_mintlify/api/og/v2?division=Links+%28v2%29\u0026amp;title=Shorten+Link\u0026amp;description=Create+a+trackable+short+link+for+any+URL+or+offer.\u0026amp;theme=bb44b2f671ef6b99ad7abecb\u0026amp;signature=89678c3881ae5af9c656c0a31940c6876a1d205bc6674f7b732a5bcffe15f58c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Shorten Link - Trackly SMS\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a trackable short link for any URL or offer.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://trackly.mintlify.site/_mintlify/api/og/v2?division=Links+%28v2%29\u0026amp;title=Shorten+Link\u0026amp;description=Create+a+trackable+short+link+for+any+URL+or+offer.\u0026amp;theme=bb44b2f671ef6b99ad7abecb\u0026amp;signature=89678c3881ae5af9c656c0a31940c6876a1d205bc6674f7b732a5bcffe15f58c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/trackly/c-1xunGpYsfIbfFy/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Trackly SMS\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#84DE4D\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/v2/links/shorten-link.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tracklysms.com/#organization\",\"name\":\"Trackly SMS\",\"url\":\"https://docs.tracklysms.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/trackly/m198FBazwIseN-2r/images/logo-light.svg?fit=max\u0026auto=format\u0026n=m198FBazwIseN-2r\u0026q=85\u0026s=675b2c397e9309f5fea1d36c1f87c412\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tracklysms.com#website\",\"name\":\"Trackly SMS\",\"url\":\"https://docs.tracklysms.com\",\"publisher\":{\"@id\":\"https://docs.tracklysms.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link#webpage\",\"url\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link\",\"name\":\"Shorten Link\",\"description\":\"Create a trackable short link for any URL or offer.\",\"dateModified\":\"2026-11-15T23:46:07.983Z\",\"isPartOf\":{\"@id\":\"https://docs.tracklysms.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Links (v2)\",\"item\":\"https://docs.tracklysms.com/api-reference/v2/links/create-link\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shorten Link\",\"item\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link#apireference\",\"headline\":\"Shorten Link\",\"name\":\"Shorten Link\",\"description\":\"Create a trackable short link for any URL or offer.\",\"url\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tracklysms.com/api-reference/v2/links/shorten-link#webpage\"},\"dateModified\":\"2026-11-15T23:46:07.983Z\",\"publisher\":{\"@id\":\"https://docs.tracklysms.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tracklysms.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Trackly SMS\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Trackly SMS\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/v2/links/shorten-link.md","siteName":"Trackly SMS","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"API Overview","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"}]},{"group":"V2 API Reference","pages":[{"title":"V2 API Overview","href":"/api-reference/v2/overview"},{"title":"Partner API Overview","href":"/api-reference/v2/partner-api-overview"},{"title":"Error Codes","href":"/api-reference/v2/error-codes"},{"title":"API Limits \u0026 Best Practices","href":"/api-reference/v2/rate-limiting"},{"title":"Idempotency","href":"/api-reference/v2/idempotency"},{"title":"Sandbox \u0026 Testing","href":"/api-reference/v2/sandbox"},{"title":"Who Am I","api":"GET /v2/auth/whoami","href":"/api-reference/v2/auth/whoami"},{"title":"Agent Setup Status","api":"GET /v2/agent/setup","href":"/api-reference/v2/auth/agent-setup"},{"title":"Delegated OAuth for REST Agents","href":"/api-reference/v2/auth/delegated-oauth"},{"title":"Pause Own Key","api":"POST /v2/auth/api-keys/self/pause","href":"/api-reference/v2/auth/pause"},{"title":"V1 to V2 Migration Guide","href":"/api-reference/v2/migration-guide"}]},{"group":"Agent Account Setup (v2)","pages":[{"title":"Start Agent Account Setup","api":"POST /v2/agent-onboarding","href":"/api-reference/v2/agent-onboarding/create"},{"title":"Get Agent Setup Status","api":"GET /v2/agent-onboarding/{intent_id}","href":"/api-reference/v2/agent-onboarding/get"}]},{"group":"Agent Number Registration (v2)","pages":[{"title":"Prepare SMS Number Registration","api":"POST /v2/agent/number-requests","href":"/api-reference/v2/agent-number-requests/create"},{"title":"Read SMS Number Registration","api":"GET /v2/agent/number-requests/{request_id}","href":"/api-reference/v2/agent-number-requests/get"},{"title":"Update SMS Number Registration","api":"PATCH /v2/agent/number-requests/{request_id}","href":"/api-reference/v2/agent-number-requests/update"},{"title":"Generate Private SMS Registration Preview","api":"POST /v2/agent/number-requests/{request_id}/preview","href":"/api-reference/v2/agent-number-requests/preview"}]},{"group":"Pending Sends (v2)","pages":[{"title":"Hold a Send for Approval","api":"POST /v2/pending-sends","href":"/api-reference/v2/pending-sends/create"},{"title":"List Pending Sends","api":"GET /v2/pending-sends","href":"/api-reference/v2/pending-sends/list"},{"title":"Get a Pending Send","api":"GET /v2/pending-sends/{id}","href":"/api-reference/v2/pending-sends/get"},{"title":"Cancel a Pending Send","api":"DELETE /v2/pending-sends/{id}","href":"/api-reference/v2/pending-sends/cancel"},{"title":"Send an Approved Send","api":"POST /v2/pending-sends/{id}/send","href":"/api-reference/v2/pending-sends/send"}]},{"group":"Partner Accounts (v2)","pages":[{"title":"Accounts \u0026 Hierarchy","href":"/api-reference/v2/accounts/overview"},{"title":"Create Child Account","api":"POST /v2/accounts/children","href":"/api-reference/v2/accounts/create-child"},{"title":"List Child Accounts","api":"GET /v2/accounts/children","href":"/api-reference/v2/accounts/list-children"},{"title":"Get Child Account","api":"GET /v2/accounts/children/{child_id}","href":"/api-reference/v2/accounts/get-child"},{"title":"Update Child Account","api":"PATCH /v2/accounts/children/{child_id}","href":"/api-reference/v2/accounts/update-child"},{"title":"Suspend Child Account","api":"POST /v2/accounts/children/{child_id}/suspend","href":"/api-reference/v2/accounts/suspend-child"},{"title":"Reactivate Child Account","api":"POST /v2/accounts/children/{child_id}/reactivate","href":"/api-reference/v2/accounts/reactivate-child"},{"title":"Create API Key","api":"POST /v2/accounts/children/{child_id}/api-keys","href":"/api-reference/v2/accounts/create-api-key"},{"title":"List API Keys","api":"GET /v2/accounts/children/{child_id}/api-keys","href":"/api-reference/v2/accounts/list-api-keys"},{"title":"Rotate API Key","api":"POST /v2/accounts/children/{child_id}/api-keys/{key_id}/rotate","href":"/api-reference/v2/accounts/rotate-api-key"},{"title":"Revoke API Key","api":"POST /v2/accounts/children/{child_id}/api-keys/{key_id}/revoke","href":"/api-reference/v2/accounts/revoke-api-key"}]},{"group":"Trial SMS (v2)","pages":[{"title":"Trial Status","api":"GET /v2/trial","href":"/api-reference/v2/trial/status"},{"title":"Trial Testing Groups","href":"/api-reference/v2/trial/groups"}]},{"group":"Messages (v2)","pages":[{"title":"Send Single Message","api":"POST /v2/send","href":"/api-reference/v2/messages/send-single"},{"title":"Send Bulk Messages","api":"POST /v2/send/bulk","href":"/api-reference/v2/messages/send-bulk"},{"title":"Send Raw Single Message","api":"POST /v2/send-raw","href":"/api-reference/v2/messages/send-raw-single"},{"title":"Send Raw Bulk Messages","api":"POST /v2/send-raw/bulk","href":"/api-reference/v2/messages/send-raw-bulk"},{"title":"Preflight a Send","api":"POST /v2/messages/preflight","href":"/api-reference/v2/messages/preflight"},{"title":"List Messages","api":"GET /v2/messages","href":"/api-reference/v2/messages/list-messages"},{"title":"Get Message","api":"GET /v2/messages/{messageId}","href":"/api-reference/v2/messages/get-message"},{"title":"Reconciliation","href":"/api-reference/v2/messages/reconciliation"}]},{"group":"Contacts (v2)","pages":[{"title":"List Contacts","api":"GET /v2/contacts","href":"/api-reference/v2/contacts/list-contacts"},{"title":"Create Contact","api":"POST /v2/contacts","href":"/api-reference/v2/contacts/create-contact"},{"title":"Update Contact","api":"PUT /v2/contacts","href":"/api-reference/v2/contacts/update-contact"},{"title":"Bulk Create Contacts","api":"POST /v2/contacts/bulk","href":"/api-reference/v2/contacts/bulk-create"},{"title":"Get Contact","api":"GET /v2/contacts/{phone_number}","href":"/api-reference/v2/contacts/get-contact"},{"title":"Delete Contact","api":"DELETE /v2/contacts","href":"/api-reference/v2/contacts/delete-contact"},{"title":"Resubscribe Contact","api":"POST /v2/contacts/resubscribe","href":"/api-reference/v2/contacts/resubscribe"}]},{"group":"Lists (v2)","pages":[{"title":"List All Sending Lists","api":"GET /v2/lists","href":"/api-reference/v2/lists/list-all"},{"title":"Get a Sending List","api":"GET /v2/lists/{list_id}","href":"/api-reference/v2/lists/get-list"},{"title":"Check RCS Reachability","api":"POST /v2/lists/{list_id}/rcs-capability-check","href":"/api-reference/v2/lists/rcs-capability-check"}]},{"group":"Number Requests (v2)","pages":[{"title":"List Number Requests","api":"GET /v2/number-requests","href":"/api-reference/v2/number-requests/list-all"},{"title":"Create Number Draft","api":"POST /v2/number-requests/drafts","href":"/api-reference/v2/number-requests/create-draft"},{"title":"Confirm Business for Number Request","api":"PUT /v2/number-requests/{request_id}/business","href":"/api-reference/v2/number-requests/confirm-business"},{"title":"Submit Number Draft","api":"POST /v2/number-requests/{request_id}/submit","href":"/api-reference/v2/number-requests/submit-draft"},{"title":"Create Number Request","api":"POST /v2/number-requests","href":"/api-reference/v2/number-requests/create-request"},{"title":"Get Number Request","api":"GET /v2/number-requests/{request_id}","href":"/api-reference/v2/number-requests/get-request"},{"title":"Get Registration Readiness","api":"GET /v2/number-requests/{request_id}/readiness","href":"/api-reference/v2/number-requests/get-readiness"},{"title":"Recheck Registration Readiness","api":"POST /v2/number-requests/{request_id}/readiness","href":"/api-reference/v2/number-requests/recheck-readiness"},{"title":"Get Registration Attempt History","api":"GET /v2/number-requests/{request_id}/readiness/history","href":"/api-reference/v2/number-requests/readiness-history"},{"title":"Update Number Request","api":"PATCH /v2/number-requests/{request_id}","href":"/api-reference/v2/number-requests/update-request"},{"title":"Look Up International Requirements","api":"GET /v2/number-requests/international-requirements","href":"/api-reference/v2/number-requests/lookup-requirements"},{"title":"Get International Requirements","api":"GET /v2/number-requests/{request_id}/international-requirements","href":"/api-reference/v2/number-requests/get-requirements"},{"title":"Update International Requirements","api":"PATCH /v2/number-requests/{request_id}/international-requirements","href":"/api-reference/v2/number-requests/update-requirements"},{"title":"Correct Resource Request","api":"POST /v2/number-requests/{request_id}/correction","href":"/api-reference/v2/number-requests/correct-request"}]},{"group":"Business Verification (v2)","pages":[{"title":"Business Verification in Number Requests","href":"/api-reference/v2/business-profiles/lifecycle"},{"title":"List Business Profiles","api":"GET /v2/business-profiles","href":"/api-reference/v2/business-profiles/list-all"},{"title":"Get Business Profile","api":"GET /v2/business-profiles/{profile_id}","href":"/api-reference/v2/business-profiles/get-profile"},{"title":"Create Business Profile","api":"POST /v2/business-profiles","href":"/api-reference/v2/business-profiles/create-profile"},{"title":"Validate Business Profile","api":"POST /v2/business-profiles/validate","href":"/api-reference/v2/business-profiles/validate-profile"},{"title":"Update Business Profile","api":"PATCH /v2/business-profiles/{profile_id}","href":"/api-reference/v2/business-profiles/update-profile"},{"title":"Dispute Suggested Business Name","api":"POST /v2/business-profiles/{profile_id}/dispute","href":"/api-reference/v2/business-profiles/dispute-profile"},{"title":"Renew Business Verification","api":"POST /v2/business-profiles/{profile_id}/verification","href":"/api-reference/v2/business-profiles/renew-verification"},{"title":"List Verification Submissions","api":"GET /v2/business-profiles/{profile_id}/submissions","href":"/api-reference/v2/business-profiles/list-submissions"},{"title":"Upload Supporting Document","api":"POST /v2/business-profiles/{profile_id}/documents","href":"/api-reference/v2/business-profiles/upload-document"},{"title":"List Supporting Documents","api":"GET /v2/business-profiles/{profile_id}/documents","href":"/api-reference/v2/business-profiles/list-documents"},{"title":"Download Supporting Document","api":"GET /v2/business-profiles/{profile_id}/documents/{doc_id}","href":"/api-reference/v2/business-profiles/download-document"},{"title":"Delete Supporting Document","api":"DELETE /v2/business-profiles/{profile_id}/documents/{doc_id}","href":"/api-reference/v2/business-profiles/delete-document"}]},{"group":"Creatives (v2)","pages":[{"title":"List All Creatives","api":"GET /v2/creatives","href":"/api-reference/v2/creatives/list-creatives"},{"title":"Create a Creative","api":"POST /v2/creatives","href":"/api-reference/v2/creatives/create-creative"},{"title":"Get a Creative","api":"GET /v2/creatives/{id}","href":"/api-reference/v2/creatives/get-creative"},{"title":"Update a Creative","api":"PUT /v2/creatives/{id}","href":"/api-reference/v2/creatives/update-creative"},{"title":"Delete a Creative","api":"DELETE /v2/creatives/{id}","href":"/api-reference/v2/creatives/delete-creative"}]},{"group":"Audiences (v2)","pages":[{"title":"List Audiences","api":"GET /v2/audiences","href":"/api-reference/v2/audiences/list-audiences"},{"title":"Create Audience","api":"POST /v2/audiences","href":"/api-reference/v2/audiences/create-audience"},{"title":"Get Audience","api":"GET /v2/audiences/{id}","href":"/api-reference/v2/audiences/get-audience"},{"title":"Update Audience","api":"PUT /v2/audiences/{id}","href":"/api-reference/v2/audiences/update-audience"},{"title":"Delete Audience","api":"DELETE /v2/audiences/{id}","href":"/api-reference/v2/audiences/delete-audience"},{"title":"Get Audience Size","api":"GET /v2/audiences/{id}/size","href":"/api-reference/v2/audiences/get-audience-size"},{"title":"Audience Filter DSL","href":"/api-reference/v2/audience-filter-dsl"}]},{"group":"Offers (v2)","pages":[{"title":"List Offers","api":"GET /v2/offers","href":"/api-reference/v2/offers/list-offers"},{"title":"Create Offer","api":"POST /v2/offers","href":"/api-reference/v2/offers/create-offer"},{"title":"Get Offer","api":"GET /v2/offers/{id}","href":"/api-reference/v2/offers/get-offer"},{"title":"Update Offer","api":"PUT /v2/offers/{id}","href":"/api-reference/v2/offers/update-offer"},{"title":"Delete Offer","api":"DELETE /v2/offers/{id}","href":"/api-reference/v2/offers/delete-offer"}]},{"group":"Schedules (v2)","pages":[{"title":"List Schedules","api":"GET /v2/schedules","href":"/api-reference/v2/schedules/list-schedules"},{"title":"Create Schedule or Blast","api":"POST /v2/schedules","href":"/api-reference/v2/schedules/create-schedule"},{"title":"Get Schedule","api":"GET /v2/schedules/{id}","href":"/api-reference/v2/schedules/get-schedule"},{"title":"Update Schedule","api":"PUT /v2/schedules/{id}","href":"/api-reference/v2/schedules/update-schedule"},{"title":"Delete Schedule","api":"DELETE /v2/schedules/{id}","href":"/api-reference/v2/schedules/delete-schedule"}]},{"group":"Journeys (v2)","pages":[{"title":"List Journeys","api":"GET /v2/journeys","href":"/api-reference/v2/journeys/list-journeys"},{"title":"Create Journey","api":"POST /v2/journeys","href":"/api-reference/v2/journeys/create-journey"},{"title":"Get Journey","api":"GET /v2/journeys/{journey_id}","href":"/api-reference/v2/journeys/get-journey"},{"title":"Update Journey","api":"PUT /v2/journeys/{journey_id}","href":"/api-reference/v2/journeys/update-journey"},{"title":"Archive Journey","api":"DELETE /v2/journeys/{journey_id}","href":"/api-reference/v2/journeys/delete-journey"},{"title":"Update Journey Status","api":"PUT /v2/journeys/{journey_id}/status","href":"/api-reference/v2/journeys/update-journey-status"},{"title":"Duplicate Journey","api":"POST /v2/journeys/{journey_id}/duplicate","href":"/api-reference/v2/journeys/duplicate-journey"},{"title":"Get Journey Options","api":"GET /v2/journeys/options","href":"/api-reference/v2/journeys/get-journey-options"},{"title":"Refresh Custom Fields","api":"POST /v2/journeys/refresh-custom-fields","href":"/api-reference/v2/journeys/refresh-custom-fields"},{"title":"Get Journey Statistics","api":"GET /v2/journeys/{journey_id}/stats","href":"/api-reference/v2/journeys/get-journey-stats"}]},{"group":"Revenue (v2)","pages":[{"title":"Record Revenue","api":"POST /v2/revenue","href":"/api-reference/v2/revenue/record-revenue"},{"title":"Bulk Record Revenue","api":"POST /v2/revenue/bulk","href":"/api-reference/v2/revenue/bulk-revenue"}]},{"group":"Usage \u0026 Billing (v2)","pages":[{"title":"Get Current Balance","api":"GET /v2/billing/balance","href":"/api-reference/v2/usage/billing-balance"},{"title":"Usage Summary","api":"GET /v2/usage/summary","href":"/api-reference/v2/usage/usage-summary"},{"title":"List Billing Records","api":"GET /v2/billing/records","href":"/api-reference/v2/usage/billing-records"},{"title":"Get Billing Statement","api":"GET /v2/billing/statements/{period}","href":"/api-reference/v2/usage/billing-statements"}]},{"group":"Data Import (v2)","pages":[{"title":"Import Send History","api":"POST /v2/history/sends","href":"/api-reference/v2/history/import-sends"},{"title":"Import Click History","api":"POST /v2/history/clicks","href":"/api-reference/v2/history/import-clicks"},{"title":"Import Revenue History","api":"POST /v2/history/revenue","href":"/api-reference/v2/history/import-revenue"},{"title":"Clear History","api":"DELETE /v2/history/clear","href":"/api-reference/v2/history/clear-history"}]},{"group":"Links (v2)","pages":[{"title":"Create Link","api":"POST /v2/links","description":"Create a trackable short link for an offer.","href":"/api-reference/v2/links/create-link"},{"title":"Shorten Link","api":"POST /v2/links/shorten","href":"/api-reference/v2/links/shorten-link"}]},{"group":"Clicks (v2)","pages":[{"title":"List Click Evidence","api":"GET /v2/clicks","description":"Retrieve recorded SMS click requests for one recipient and sending list.","href":"/api-reference/v2/clicks/list-clicks"}]},{"group":"Webhooks (v2)","pages":[{"title":"Webhook Events","href":"/api-reference/v2/webhooks/events"},{"title":"Webhook Signing \u0026 Verification","href":"/api-reference/v2/webhooks/signing"},{"title":"Create Webhook Endpoint","api":"POST /v2/webhooks","href":"/api-reference/v2/webhooks/create-endpoint"},{"title":"List Webhook Endpoints","api":"GET /v2/webhooks","href":"/api-reference/v2/webhooks/list-endpoints"},{"title":"Get Webhook Endpoint","api":"GET /v2/webhooks/{endpoint_id}","href":"/api-reference/v2/webhooks/get-endpoint"},{"title":"Update Webhook Endpoint","api":"PATCH /v2/webhooks/{endpoint_id}","href":"/api-reference/v2/webhooks/update-endpoint"},{"title":"Delete Webhook Endpoint","api":"DELETE /v2/webhooks/{endpoint_id}","href":"/api-reference/v2/webhooks/delete-endpoint"},{"title":"Rotate Signing Secret","api":"POST /v2/webhooks/{endpoint_id}/rotate-secret","href":"/api-reference/v2/webhooks/rotate-secret"},{"title":"List Deliveries","api":"GET /v2/webhooks/{endpoint_id}/deliveries","href":"/api-reference/v2/webhooks/list-deliveries"},{"title":"Replay a Delivery","api":"POST /v2/webhooks/deliveries/{delivery_id}/replay","href":"/api-reference/v2/webhooks/replay-delivery"},{"title":"Bulk Replay Deliveries","api":"POST /v2/webhooks/deliveries/replay","href":"/api-reference/v2/webhooks/bulk-replay"}]},{"group":"Phone Validation (v1)","pages":[{"title":"Validate Phone Number","api":"POST /v1/phone/validate","href":"/api-reference/phone/validate"},{"title":"Validate Phone Numbers (Batch)","api":"POST /v1/phone/validate/batch","href":"/api-reference/phone/batch-validate"}]},{"group":"Voice Calls (v1)","pages":[{"title":"Start calling with Trackly","href":"/api-reference/voice/get-started"},{"title":"Connect Your Salesforce Dialer","href":"/api-reference/voice/salesforce"},{"title":"Salesforce Integration Reference","href":"/api-reference/voice/salesforce-configuration"},{"title":"Voice Calls API Overview","href":"/api-reference/voice/overview"},{"title":"Queue Webhooks","href":"/api-reference/voice/webhooks"},{"title":"List Calling Numbers","api":"GET /v1/voice/calling-numbers","href":"/api-reference/voice/numbers/list-calling-numbers"},{"title":"Search Calling Numbers","api":"POST /v1/voice/calling-numbers/search","href":"/api-reference/voice/numbers/search-calling-numbers"},{"title":"Quote a Calling Number","api":"POST /v1/voice/calling-numbers/quote","href":"/api-reference/voice/numbers/quote-calling-number"},{"title":"Acquire a Calling Number","api":"POST /v1/voice/number-acquisitions","href":"/api-reference/voice/numbers/acquire-calling-number"},{"title":"Get a Number Acquisition","api":"GET /v1/voice/number-acquisitions/{operationId}","href":"/api-reference/voice/numbers/get-number-acquisition"},{"title":"Record a Voice Opt-Out","api":"POST /v1/voice/opt-outs","href":"/api-reference/voice/record-opt-out"},{"title":"Screen a Calling Recipient","api":"POST /v1/voice/recipient-screenings","href":"/api-reference/voice/recipient-screening"},{"title":"Place a Call","api":"POST /v1/voice/calls","href":"/api-reference/voice/calls/place-call"},{"title":"List Calls","api":"GET /v1/voice/calls","href":"/api-reference/voice/calls/list-calls"},{"title":"Get a Call","api":"GET /v1/voice/calls/{callId}","href":"/api-reference/voice/calls/get-call"},{"title":"Answer a Call","api":"POST /v1/voice/calls/{callId}/answer","href":"/api-reference/voice/calls/answer-call"},{"title":"Hang Up a Call","api":"POST /v1/voice/calls/{callId}/hangup","href":"/api-reference/voice/calls/hangup-call"},{"title":"Monitor a Call","api":"POST /v1/voice/calls/{callId}/monitor","href":"/api-reference/voice/calls/monitor-call"},{"title":"Browser Sessions","href":"/api-reference/voice/calls/browser-sessions"},{"title":"Browser Calls","href":"/api-reference/voice/calls/browser-calls"},{"title":"Listen to a Call in the Browser","href":"/api-reference/voice/calls/browser-monitor"},{"title":"Hold, Resume, and Transfer a Browser Call","href":"/api-reference/voice/calls/browser-call-controls"},{"title":"Choose Call Listeners","href":"/api-reference/voice/monitor-grants"},{"title":"Start Recording","api":"POST /v1/voice/calls/{callId}/recording/start","href":"/api-reference/voice/calls/start-recording"},{"title":"Stop Recording","api":"POST /v1/voice/calls/{callId}/recording/stop","href":"/api-reference/voice/calls/stop-recording"},{"title":"List Recordings","api":"GET /v1/voice/calls/{callId}/recording","href":"/api-reference/voice/calls/list-recordings"},{"title":"Download a Recording File","api":"GET /v1/voice/calls/{callId}/recording/files/{fileId}","href":"/api-reference/voice/calls/download-recording"},{"title":"Create a Queue","api":"POST /v1/voice/queues","href":"/api-reference/voice/queues/create-queue"},{"title":"List Queues","api":"GET /v1/voice/queues","href":"/api-reference/voice/queues/list-queues"},{"title":"Get a Queue","api":"GET /v1/voice/queues/{queueId}","href":"/api-reference/voice/queues/get-queue"},{"title":"Dequeue a Call","api":"POST /v1/voice/queues/{queueId}/dequeue","href":"/api-reference/voice/queues/dequeue"},{"title":"Create an Agent","api":"POST /v1/voice/agents","href":"/api-reference/voice/agents/create-agent"},{"title":"List Agents","api":"GET /v1/voice/agents","href":"/api-reference/voice/agents/list-agents"}]},{"group":"API Reference (v1 - Deprecated)","pages":[{"title":"Send Single Message","api":"POST /v1/messages","href":"/api-reference/messages/send-single"},{"title":"Send Bulk Messages","api":"POST /v1/messages/bulk","href":"/api-reference/messages/send-bulk"},{"title":"List Contacts","api":"GET /v1/contacts","href":"/api-reference/contacts/list-contacts"},{"title":"Create Contact","api":"POST /v1/contacts","href":"/api-reference/contacts/create-contact"},{"title":"Get Contact","api":"GET /v1/contacts/{msisdn}","href":"/api-reference/contacts/get-contact"},{"title":"Delete Contact","api":"DELETE /v1/contacts/{msisdn}","href":"/api-reference/contacts/delete-contact"},{"title":"Error Codes","href":"/api-reference/errors"}]}]}]},{"anchor":"API Status","href":"https://status.tracklysms.com","icon":"signal"},{"anchor":"Discord","href":"https://discord.gg/trackly","icon":"discord"},{"anchor":"Changelog","icon":"list","pages":[{"title":"Changelog","href":"/resources/changelog"}]}]},"basePath":"","title":"Shorten Link - Trackly SMS","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js"]}