Skip to main content

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​

FieldTypeDescription
idstringUnique id. Set it as campaign_id on a link.
namestring1–80 characters, unique in your workspace.
descriptionstring | nullFree text.
colorstring | nullDisplay color in the app.
owner_idstringThe user who made it.
created_atstringISO 8601.
link_countintegerLinks in the campaign.
total_clicksintegerLifetime clicks across those links.

List campaigns​

GET/api/campaigns
Auth
API key or session · links:read
Plan
All plans

Returns up to 200 campaigns, newest first.

curl https://api.linklane.io/api/campaigns \
-H "Authorization: Bearer $LINKLANE_API_KEY"
Response · 200 OK
[
{
"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.

POST/api/campaigns
Auth
Dashboard session only
Plan
Pro and above

Creates a campaign. Body: name (required), description, color. A name already used in your workspace returns 409.

GET/api/campaigns/{campaign_id}
Auth
Dashboard session only
Plan
All plans

Returns { "campaign": {…}, "links": [ … ] } with up to 500 of its links.

PATCH/api/campaigns/{campaign_id}
Auth
Dashboard session only
Plan
Pro and above

Changes name, description or color.

DELETE/api/campaigns/{campaign_id}
Auth
Dashboard session only
Plan
Pro and above

Deletes the campaign. Its links stay; they just leave the campaign.

GET/api/campaigns/{campaign_id}/analytics
Auth
Dashboard session only
Plan
All plans

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.