Quick start
Add a customer, make their link and read their clicks, with a partner key. It takes three calls and about five minutes.
Before you start#
- Finish Bunny setup in the dashboard.
- Make a partner key under Settings > Developers.
- Find your API address on the same page.
The three calls#
BASE=https://api.yourbrand.com/api
KEY=nl_pk_…
# 1. A client for your customer
curl -X POST $BASE/partner/clients -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{"name":"Blue Cafe","email":"hello@bluecafe.com","external_id":"user_42","link_limit":500}'
# 2. A link for them
curl -X POST $BASE/links -H "Authorization: Bearer $KEY" -H 'X-NL-Client: ext:user_42' \
-H 'Content-Type: application/json' -d '{"destination_url":"https://bluecafe.com/menu","slug":"menu"}'
# 3. Their clicks, last 30 days
curl "$BASE/partner/clients/ext:user_42/stats?days=30" -H "Authorization: Bearer $KEY" The first call answers:
{ "data": { "id": 2, "external_id": "user_42", "name": "Blue Cafe", "email": "hello@bluecafe.com", "plan": "starter", "is_active": true, "link_limit": 500, "click_limit": 50000, "domain_limit": 3, "metadata": {}, "created_at": 1795348904, "updated_at": 1795348904 } } What just happened#
- A client was made for your customer.
external_idis your own ID for them, so you never need to store Nahnu Links’ id. Anywhere a client is referenced,ext:user_42works. - A link was made for that client.
X-NL-Clientmade the partner key act as that client, so the link belongs to them and their limits apply. With no domain given, the link uses the default short domain. - Stats came back for the client: clicks from people, by day, with top links and countries.
The same in JavaScript#
const BASE = 'https://api.yourbrand.com/api';
const H = { Authorization: `Bearer ${process.env.NL_PARTNER_KEY}`, 'Content-Type': 'application/json' };
await fetch(`${BASE}/partner/clients`, { method: 'POST', headers: H,
body: JSON.stringify({ name: 'Blue Cafe', email: 'hello@bluecafe.com', external_id: 'user_42' }) });
const link = await fetch(`${BASE}/links`, { method: 'POST', headers: { ...H, 'X-NL-Client': 'ext:user_42' },
body: JSON.stringify({ destination_url: 'https://bluecafe.com/menu', slug: 'menu' }) }).then(r => r.json());
console.log(link.data.short_url); Next#
- Give the customer their own domain: Domains over the API.
- Get told about clicks: Add a webhook.
- Every link field: Links.


