Links
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.
| Method | Path | Does |
|---|---|---|
GET | /api/links | The client’s links, newest first. ?domain_id=, ?limit= (default 50), ?offset=. |
POST | /api/links | Make 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. |
Link fields#
| Field | Type | Notes |
|---|---|---|
destination_url | string | Required to make a link. A full http:// or https:// address. |
slug | string | The ending. Letters, numbers, - and _. Left out: one is made for you. |
domain_id | integer | One of the client’s domains (GET /api/domains). Left out: the default short domain. |
title | string | Only the owner sees it. |
redirect_type | 301 or 302 | Default 301, as in the dashboard. |
starts_at, expires_at | integer | Unix seconds. Before / after them, visitors see the not-live-yet / expired page. |
click_limit | integer | People only. |
password | string | Stored hashed; answers show has_password instead. "" removes it. |
cloak | 0 or 1 | Show the destination under the short link (not for websites that forbid it). |
og_title, og_description, og_image_url | string | The social preview. |
pixels | object | { "meta": "123…", "google": "G-…", "tiktok": "C…" } |
open_app, app_id, app_path, app_fallback | mixed | Deep link: -1 off, 0 automatic, 1 the app in app_id. |
webhook_url | string | Called on each click and conversion. |
rules | array | Routing rules: [{ "rule_type": "geo", "condition_value": "US,CA", "destination_url": "…", "weight": 100 }]. Types: geo, os, device, deeplink, ab. Sending rules replaces them all. |
is_active | 0 or 1 | Turn the link off without deleting it. |
Make a link#
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": {} } Change a link and its rules#
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 a link#
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_atmust be beforeexpires_at. rulesis all or nothing: send the full list each time. Send"rules": []to remove every rule.- Fields a plan doesn’t include (like
passwordorcloak) answer403with the feature named inerror.


