Links API
Create, update, list, and archive parent links and sublinks.
Parent links own the canonical destination and social metadata. Sublinks model
individual placements and add their own slug, context, and UTM values.
notes is an optional internal description of what the link is for. It is
not the social-card description and never appears on the redirect.
Create a parent link
curl -X POST https://kliq.sh/api/v1/links \
-H "Authorization: Bearer $KLIQ_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"domainId": "DOMAIN_ID",
"slug": "summer-launch",
"name": "Summer launch",
"destinationUrl": "https://example.com/launch",
"title": "Summer launch",
"description": "See what is new",
"notes": "Homepage launch CTA for August",
"idempotencyKey": "summer-launch-parent-v1"
}'New links redirect as soon as their domain is verified. There is no separate activation step.
List parents
curl "https://kliq.sh/api/v1/links?limit=50" \
-H "Authorization: Bearer $KLIQ_API_KEY"Create a sublink
curl -X POST https://kliq.sh/api/v1/links/PARENT_ID/sublinks \
-H "Authorization: Bearer $KLIQ_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"slug": "youtube-summer-launch",
"name": "YouTube description",
"context": "Launch video description",
"notes": "Pinned comment CTA for the launch video",
"utmSource": "youtube",
"utmMedium": "video",
"utmCampaign": "summer-launch",
"idempotencyKey": "summer-launch-youtube-v1"
}'Update a link
PATCH /links/{linkId} accepts only the values to change. A parent can change
its destination and metadata. A sublink cannot set destinationUrl because it
inherits that value.
curl -X PATCH https://kliq.sh/api/v1/links/LINK_ID \
-H "Authorization: Bearer $KLIQ_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name":"YouTube pinned comment","utmContent":"pinned-comment"}'Archive a link
curl -X DELETE https://kliq.sh/api/v1/links/LINK_ID \
-H "Authorization: Bearer $KLIQ_API_KEY"Archival is the only link lifecycle action. It stops the URL from redirecting without physically deleting the link or its historical analytics.