API/Links API

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.

curl -X POST https://linkquick.melvynx.dev/api/v1/links \
  -H "Authorization: Bearer $LINKQUICK_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",
    "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://linkquick.melvynx.dev/api/v1/links?limit=50" \
  -H "Authorization: Bearer $LINKQUICK_API_KEY"
curl -X POST https://linkquick.melvynx.dev/api/v1/links/PARENT_ID/sublinks \
  -H "Authorization: Bearer $LINKQUICK_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "slug": "youtube-summer-launch",
    "name": "YouTube description",
    "context": "Launch video description",
    "utmSource": "youtube",
    "utmMedium": "video",
    "utmCampaign": "summer-launch",
    "idempotencyKey": "summer-launch-youtube-v1"
  }'

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://linkquick.melvynx.dev/api/v1/links/LINK_ID \
  -H "Authorization: Bearer $LINKQUICK_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"name":"YouTube pinned comment","utmContent":"pinned-comment"}'
curl -X DELETE https://linkquick.melvynx.dev/api/v1/links/LINK_ID \
  -H "Authorization: Bearer $LINKQUICK_API_KEY"

Archival is the only link lifecycle action. It stops the URL from redirecting without physically deleting the link or its historical analytics.