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",
"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
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",
"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
trace links create --deep-link-path /invite/summer \
--campaign-id summer_sale \
--fallback-url https://myapp.com
# With metadata and expiration
trace links create --deep-link-path /product/123 \
--campaign-id summer_sale \
--metadata color=blue \
--metadata source=email \
--expires-in-days 30
# Get full JSON response
trace links create --deep-link-path /invite/summer --json

GET /v1/links

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

ParameterTypeDefaultDescription
campaignIdstringFilter by campaign ID
sandboxbooleanFilter by sandbox status
limitint50Max results (1-100)
offsetint0Pagination offset
{
"links": [
{
"id": "...",
"shortCode": "abc123",
"shortUrl": "https://yourapp.traceclick.io/l/abc123",
"deepLinkPath": "/invite/summer",
"campaignId": "summer_sale",
"createdAt": "2024-07-15T12:00:00Z"
}
],
"total": 42,
"offset": 0,
"limit": 50
}
Terminal window
# List all links
trace links list
# Filter by campaign with pagination
trace links list --campaign-id summer_sale --limit 10
# Show only sandbox links
trace links list --sandbox

GET /v1/links/{shortCode}

Retrieve details of a specific link by its short code.

Terminal window
trace links get abc123
# Full JSON output
trace links get abc123 --json

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
trace links update abc123 --fallback-url https://myapp.com/new
trace links update abc123 \
--campaign-id winter_sale \
--expires-in-days 90

DELETE /v1/links/{shortCode}

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

Terminal window
trace links delete abc123

GET /qr/{shortCode}

Returns a PNG image of a QR code that points to the link’s short URL. This is a public endpoint — no API key required.

ParameterTypeDefaultDescription
sizeint6Pixels per QR module (2–40). Higher = larger image
Terminal window
# Download QR code (compact, ~150px)
curl https://yourapp.traceclick.io/qr/abc123 -o qr.png
# Larger for print (~500px)
curl "https://yourapp.traceclick.io/qr/abc123?size=20" -o qr-large.png

The QR code URL is also returned in the qrCodeUrl field when you create a link.