N Docs
← Back to site

Links

3 min readUpdated November 23, 2026

The client API works with one client’s links. Use a client key (nl_live_…), or a partner key with X-NL-Client. Answers are { "data": …, "meta": … } unless noted.

MethodPathDoes
GET/api/linksThe client’s links, newest first. ?domain_id=, ?limit= (default 50), ?offset=.
POST/api/linksMake a link.
GET/api/links/{id}One link.
PUT/api/links/{id}Change a link. Send only the fields to change.
DELETE/api/links/{id}Delete a link.
FieldTypeNotes
destination_urlstringRequired to make a link. A full http:// or https:// address.
slugstringThe ending. Letters, numbers, - and _. Left out: one is made for you.
domain_idintegerOne of the client’s domains (GET /api/domains). Left out: the default short domain.
titlestringOnly the owner sees it.
redirect_type301 or 302Default 301, as in the dashboard.
starts_at, expires_atintegerUnix seconds. Before / after them, visitors see the not-live-yet / expired page.
click_limitintegerPeople only.
passwordstringStored hashed; answers show has_password instead. "" removes it.
cloak0 or 1Show the destination under the short link (not for websites that forbid it).
og_title, og_description, og_image_urlstringThe social preview.
pixelsobject{ "meta": "123…", "google": "G-…", "tiktok": "C…" }
open_app, app_id, app_path, app_fallbackmixedDeep link: -1 off, 0 automatic, 1 the app in app_id.
webhook_urlstringCalled on each click and conversion.
rulesarrayRouting rules: [{ "rule_type": "geo", "condition_value": "US,CA", "destination_url": "…", "weight": 100 }]. Types: geo, os, device, deeplink, ab. Sending rules replaces them all.
is_active0 or 1Turn the link off without deleting it.
curl -X POST https://api.yourbrand.com/api/links \
  -H 'Authorization: Bearer nl_live_…' -H 'Content-Type: application/json' \
  -d '{"destination_url":"https://acmebakery.example/spring","slug":"spring","domain_id":3,"title":"Spring menu"}'
{ "data": { "id": 22, "client_id": 1, "domain_id": 3, "slug": "spring", "destination_url": "https://acmebakery.example/spring", "redirect_type": 301, "title": "Spring menu", "og_title": null, …, "click_count": 0, "has_password": false, "cloak": 0, "is_active": 1, "pixels": null, "webhook_url": null, "created_at": 1795348890, "domain": "go.acmebakery.example" }, "meta": {} }
curl -X PUT https://api.yourbrand.com/api/links/22 -H 'Authorization: Bearer nl_live_…' -H 'Content-Type: application/json' \
  -d '{"destination_url":"https://acmebakery.example/spring-2","rules":[{"rule_type":"geo","condition_value":"AE","destination_url":"https://acmebakery.example/ae"}]}'

DELETE /api/links/21 answers { "data": { "deleted": true, "id": 21 }, "meta": {} }.

Notes#

An ending already used on that domain answers 409. Plan limits and features apply: a feature the client’s plan doesn’t include answers 403.

Each link also has short_url, the full short link (for example https://go.acmebakery.example/spring). A link without a domain gets the default short domain’s address. Errors always carry a code next to error: slug_taken for a used ending, and otherwise invalid, unauthorized, forbidden, not_found or rate_limited.

Recipes#

A link that opens the App Store on iPhones and Google Play on Android

{
  "destination_url": "https://acmebakery.com/app",
  "slug": "app",
  "rules": [
    { "rule_type": "os", "condition_value": "ios", "destination_url": "https://apps.apple.com/app/id1234567890" },
    { "rule_type": "os", "condition_value": "android", "destination_url": "https://play.google.com/store/apps/details?id=com.acme.bakery" }
  ]
}

A 50/50 A/B test

{
  "destination_url": "https://acmebakery.com/offer-a",
  "rules": [
    { "rule_type": "ab", "condition_value": "A", "destination_url": "https://acmebakery.com/offer-a", "weight": 50 },
    { "rule_type": "ab", "condition_value": "B", "destination_url": "https://acmebakery.com/offer-b", "weight": 50 }
  ]
}

A link for a one-week sale, stopping after 1,000 people

{ "destination_url": "https://acmebakery.com/sale", "slug": "sale", "starts_at": 1796083200, "expires_at": 1796688000, "click_limit": 1000 }

Pause and resume a link

curl -X PUT $BASE/api/links/22 -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"is_active":0}'
curl -X PUT $BASE/api/links/22 -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"is_active":1}'

Find a link by its ending

List links and match slug in your code, or filter by domain first with ?domain_id= to keep the list short.

Good to know#

  • Changes reach every Bunny location within about 30 seconds.
  • Times are Unix seconds (UTC). starts_at must be before expires_at.
  • rules is all or nothing: send the full list each time. Send "rules": [] to remove every rule.
  • Fields a plan doesn’t include (like password or cloak) answer 403 with the feature named in error.