Campaigns
A campaign groups links so you can read their clicks and conversions together. With an API key you can list campaigns, to get the campaign_id you set on a link. Creating and changing campaigns happens in the app.
The campaign object
| Field | Type | Description |
|---|---|---|
id | string | Unique id. Set it as campaign_id on a link. |
name | string | 1–80 characters, unique in your workspace. |
description | string | null | Free text. |
color | string | null | Display color in the app. |
owner_id | string | The user who made it. |
created_at | string | ISO 8601. |
link_count | integer | Links in the campaign. |
total_clicks | integer | Lifetime clicks across those links. |
List campaigns
Returns up to 200 campaigns, newest first.
- cURL
- JavaScript
- Python
curl https://api.linklane.io/api/campaigns \
-H "Authorization: Bearer $LINKLANE_API_KEY"
const res = await fetch("https://api.linklane.io/api/campaigns", {
headers: { Authorization: `Bearer ${process.env.LINKLANE_API_KEY}` },
});
const campaigns = await res.json();
const spring = campaigns.find((c) => c.name === "Spring launch");
import os
import requests
res = requests.get(
"https://api.linklane.io/api/campaigns",
headers={"Authorization": f"Bearer {os.environ['LINKLANE_API_KEY']}"},
)
spring = next(c for c in res.json() if c["name"] == "Spring launch")
[
{
"id": "0b6d7a51-3f0e-4f7b-8f8e-3c2a1d9e5b44",
"name": "Spring launch",
"description": "Email + Instagram, March",
"color": "#8B5CF6",
"owner_id": "4e2f0c1a-9b7d-4d3e-a1f2-5c6b7a8d9e0f",
"created_at": "2026-11-01T08:00:00+00:00",
"link_count": 12,
"total_clicks": 5310
}
]
To put a link in this campaign, send "campaign_id": "0b6d7a51-…" when you create or update the link. That needs Pro or above.
Dashboard-only campaign endpoints
These need a dashboard session. An API key gets 401.
Creates a campaign. Body: name (required), description, color. A name already used in your workspace returns 409.
Returns { "campaign": {…}, "links": [ … ] } with up to 500 of its links.
Changes name, description or color.
Deletes the campaign. Its links stay; they just leave the campaign.
Combined analytics for every link in the campaign. Takes an optional days (1–3650). totals includes conversions, conversion_value and conversion_rate. It also returns a daily trend, top countries, devices, referrers, browsers and operating systems, and by_link with clicks per link.