lnkz.tr API

The API is not publicly open. To use it you need an account, an API key generated from the dashboard, and credits on your balance.

Authentication

Send the API username and password generated in your dashboard using HTTP Basic Auth. The password is shown only once, at creation time.

curl -u "lk_9f3c2a71b0e84d55:sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  https://lnkz.tr/api/v1/me

Alternative headers:

X-Api-Key-Id: lk_9f3c2a71b0e84d55
X-Api-Key-Secret: sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXX

# veya
Authorization: Bearer lk_9f3c2a71b0e84d55.sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXX

Create a short link

POST /api/v1/links

Each successful request costs 1 credit. Credits are refunded on validation errors.

curl -u "$KEY_ID:$KEY_SECRET" \
  -H "Content-Type: application/json" \
  -X POST https://lnkz.tr/api/v1/links \
  -d '{
    "url": "https://randevu.selfklinik.com/?GUID=a8faa905-477a-11f0-89df-52e18006e243",
    "title": "Randevu bağlantısı",
    "tags": ["klinik", "randevu"],
    "expires_at": "2026-12-31 23:59:00",
    "max_clicks": 5000
  }'

Response:

{
  "ok": true,
  "link": {
    "id": 1042,
    "code": "REQSHUW1",
    "short_url": "https://lnkz.tr/REQSHUW1",
    "target_url": "https://randevu.selfklinik.com/?GUID=a8faa905-477a-11f0-89df-52e18006e243",
    "title": "Randevu bağlantısı",
    "tags": ["klinik", "randevu"],
    "clicks": 0,
    "max_clicks": 5000,
    "expires_at": "2026-12-31 23:59:00",
    "is_active": true,
    "protected": false,
    "qr_url": "https://api.qrserver.com/v1/create-qr-code/?...",
    "created_at": "2026-07-28 10:15:00"
  },
  "credits_charged": 1,
  "credits_balance": 999
}
Field Type Description
urlstringRequired. The http/https destination.
codestringOptional custom code (3–32 characters).
titlestringTitle shown in the dashboard.
tagsarray|stringTags.
expires_atstringExpiry timestamp as Y-m-d H:i:s.
max_clicksintThe link stops working after this many clicks.
passwordstringPassword gate for the link.

List links

GET /api/v1/links/list?limit=25&offset=0

Listing does not consume credits.

Link detail and delete

GET /api/v1/links/{id|code}

DELETE /api/v1/links/{id|code}

curl -u "$KEY_ID:$KEY_SECRET" https://lnkz.tr/api/v1/links/REQSHUW1
curl -u "$KEY_ID:$KEY_SECRET" -X DELETE https://lnkz.tr/api/v1/links/REQSHUW1

AI suggestions

POST /api/v1/ai/suggest

The task field accepts slug, meta or social. Credit costs are listed on the pricing page.

curl -u "$KEY_ID:$KEY_SECRET" \
  -H "Content-Type: application/json" \
  -X POST https://lnkz.tr/api/v1/ai/suggest \
  -d '{
    "task": "slug",
    "url": "https://ornek.com/kampanyalar/yaz-indirimi-2026",
    "context": "Summer campaign landing page, to be shared on social media"
  }'
{
  "ok": true,
  "task": "slug",
  "result": {
    "suggestions": [
      { "code": "yaz-indirimi", "reason": "The campaign name is directly recognisable" },
      { "code": "yaz26-firsat", "reason": "Also states the period" }
    ]
  },
  "credits_charged": 5,
  "credits_balance": 994
}

Account info

GET /api/v1/me

Returns balance, total links and clicks, plus the current credit costs.

Errors and limits

HTTPtypeMeaning
401unauthorizedThe key is invalid or revoked.
402insufficient_creditsNot enough credits.
404not_foundLink not found.
422invalid_requestInvalid field or code already taken.
429rate_limitedLimit of 120 requests per minute per key.

Error responses always take the form { "ok": false, "error": { "type": ..., "message": ... } }.