Developer docs

API keys and REST API

Linkube API keys authenticate server-to-server calls for the workspace that created the key. The current public REST surface supports short-link creation through the links endpoint.

Authentication

Create keys in the workspace dashboard under Settings, API Keys. Send the token as a Bearer credential. Linkube stores hashed keys and only shows the full token once when it is created or rotated.

  • Missing, invalid, inactive, or revoked keys return 401 with a Bearer challenge.
  • Link creation is rate-limited per workspace in one-minute buckets and returns 429 when the plan limit is exceeded.
  • Use example tokens such as lk_live_example_api_key in docs and tests. Do not publish real keys.

Create a short link

POST to /api/v1/links. The destination URL is required. A custom slug must be 3 to 30 characters when provided. UTM fields and a password are optional.

bashRequest
curl -X POST https://linkube.io/api/v1/links \
  -H "Authorization: Bearer lk_live_example_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "destination_url": "https://example.com/pricing",
    "custom_slug": "summer-sale",
    "utm_source": "newsletter",
    "utm_medium": "email",
    "utm_campaign": "summer_sale"
  }'
json201 response
{
  "id": "lnk_abc123xyz789",
  "short_code": "summer-sale",
  "short_url": "https://likb.ir/summer-sale",
  "destination_url": "https://example.com/pricing",
  "workspace_id": "ws_example123",
  "created": true
}

Request body

FieldRequiredNotes
destination_urlYesAbsolute HTTP or HTTPS URL.
custom_slugNo3 to 30 characters. Duplicate slugs return 400.
utm_source, utm_medium, utm_campaign, utm_term, utm_contentNoStored with the link for campaign reporting.
passwordNoStored as a bcrypt hash and redirects visitors through the secure page.