Skip to content

Links API

POST /v1/links

Create a trackable short link with an optional deep link payload.

{
"deepLinkPath": "/product/123",
"deepLinkParams": {"color": "blue"},
"campaignId": "summer_sale",
"iosDestination": "https://apps.apple.com/app/myapp/id123456",
"androidDestination": "https://play.google.com/store/apps/details?id=com.example",
"fallbackUrl": "https://myapp.com/product/123",
"metadata": {"created_by": "api"},
"expiresInDays": 30,
"sandbox": false
}
FieldTypeRequiredDescription
deepLinkPathstringyesPath delivered to the app (e.g. /product/123)
deepLinkParamsobjectnoKey-value pairs delivered alongside the path
campaignIdstringnoCampaign identifier for attribution grouping
iosDestinationstringnoApp Store URL for iOS users
androidDestinationstringnoPlay Store URL for Android users
fallbackUrlstringnoURL for users on unsupported platforms
metadataobjectnoArbitrary key-value metadata stored with the link
expiresInDaysintnoLink expires after this many days
sandboxbooleannoIf true, only debug builds can claim clicks from this link
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"shortCode": "abc123",
"shortUrl": "https://yourapp.traceclick.io/l/abc123",
"deepLinkPath": "/product/123",
"deepLinkParams": {"color": "blue"},
"campaignId": "summer_sale",
"iosDestination": "https://apps.apple.com/app/myapp/id123456",
"androidDestination": "https://play.google.com/store/apps/details?id=com.example",
"fallbackUrl": "https://myapp.com/product/123",
"metadata": {"created_by": "api"},
"sandbox": false,
"expiresAt": "2024-08-15T00:00:00Z",
"createdAt": "2024-07-15T12:00:00Z",
"updatedAt": "2024-07-15T12:00:00Z"
}
Terminal window
curl -X POST https://api.traceclick.io/v1/links \
-H "X-Api-Key: tr_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"deepLinkPath": "/invite/summer",
"campaignId": "summer_sale",
"fallbackUrl": "https://myapp.com"
}'

GET /v1/links

List all links for your app. Supports pagination and campaign filtering.

ParameterTypeDefaultDescription
campaignIdstringFilter by campaign ID
limitint50Max results (1-100)
offsetint0Pagination offset
[
{
"id": "...",
"shortCode": "abc123",
"shortUrl": "https://yourapp.traceclick.io/l/abc123",
"deepLinkPath": "/invite/summer",
"campaignId": "summer_sale",
"createdAt": "2024-07-15T12:00:00Z"
}
]
Terminal window
# List all links for a campaign
curl "https://api.traceclick.io/v1/links?campaignId=summer_sale&limit=10" \
-H "X-Api-Key: tr_live_xxxxxxxxxxxx"

GET /v1/links/{shortCode}

Retrieve details of a specific link by its short code.

Terminal window
curl https://api.traceclick.io/v1/links/abc123 \
-H "X-Api-Key: tr_live_xxxxxxxxxxxx"

PATCH /v1/links/{shortCode}

Update any field on an existing link. Only include the fields you want to change.

{
"deepLinkPath": "/product/456",
"campaignId": "winter_sale",
"expiresInDays": 60
}

All fields from the create request are accepted. The shortCode cannot be changed.

Terminal window
curl -X PATCH https://api.traceclick.io/v1/links/abc123 \
-H "X-Api-Key: tr_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"campaignId": "winter_sale"}'

DELETE /v1/links/{shortCode}

Soft-delete a link. The short code becomes inactive and stops redirecting.

Terminal window
curl -X DELETE https://api.traceclick.io/v1/links/abc123 \
-H "X-Api-Key: tr_live_xxxxxxxxxxxx"