Developer

Krdcode API

A simple REST API to programmatically create and manage your short links. Authenticate with a personal API token and call HTTPS endpoints.

Authentication

Create a token from your dashboard (API tokens section). Tokens look like lk_live_… and are shown only once — store them somewhere safe.

Send the token as a bearer header on every request:

Authorization: Bearer lk_live_xxxxxxxxxxxxxxxxxxxxxxxx

Base URL

https://yourdomain/api/public/v1

Endpoints

GET/linksList your links (paginated)
POST/linksCreate a new link
GET/links/{id}Fetch a single link + click count
PATCH/links/{id}Update title, target, tags, archive
DELETE/links/{id}Delete a link

Create a link

curl -X POST https://yourdomain/api/public/v1/links \
  -H "Authorization: Bearer lk_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "target_url": "https://example.com/launch",
    "title": "Product launch",
    "tags": ["campaign", "q2"]
  }'

Optional fields: code (custom slug), expires_at (ISO 8601), click_limit, tags. If code is omitted, a random one is generated.

List links

curl https://yourdomain/api/public/v1/links?limit=50&offset=0&q=campaign \
  -H "Authorization: Bearer lk_live_xxxx"

Update a link

curl -X PATCH https://yourdomain/api/public/v1/links/{id} \
  -H "Authorization: Bearer lk_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{ "target_url": "https://example.com/new", "archived": false }'

Delete a link

curl -X DELETE https://yourdomain/api/public/v1/links/{id} \
  -H "Authorization: Bearer lk_live_xxxx"

Response shape

{
  "data": {
    "id": "uuid",
    "code": "abc1234",
    "short_url": "https://your-domain/abc1234",
    "title": "Product launch",
    "kind": "url",
    "target_url": "https://example.com/launch",
    "created_at": "2026-06-12T10:00:00Z",
    "expires_at": null,
    "click_limit": null,
    "tags": ["campaign", "q2"],
    "archived": false
  }
}

Errors

All errors use HTTP status codes and a consistent body:

{ "error": { "code": "invalid_input", "message": "..." } }
  • 401 unauthorized — missing or invalid bearer token
  • 400 invalid_input — body failed validation
  • 404 not_found — resource doesn't exist or isn't yours
  • 409 code_taken — that custom code is already in use