API ReferenceLinks API
Campaigns
Group short links into campaigns - /v1/campaigns.
Campaigns group related short links so you can report on them together. Assign a
link to a campaign with the campaign_id field when you create a link.
Base URL: https://links.esmsafrica.io. Auth: Authorization: Bearer esms_l_....
List campaigns
GET /v1/campaigns[
{
"id": "b6f1...",
"name": "Summer promo",
"color": "#ff6a1a",
"links": 12,
"clicks": 3480,
"created_at": "2026-08-01T09:00:00Z"
}
]Each campaign includes its link and total click counts.
Create a campaign
POST /v1/campaignsRequires the links:write scope.
{
"name": "Summer promo",
"color": "#ff6a1a"
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Campaign name (max 120 chars). |
color | string | No | Hex color for the dashboard label (max 16 chars). |
Returns { "id", "name", "color" }.
Delete a campaign
DELETE /v1/campaigns/{id}Requires the links:write scope. Returns 204 No Content. Links previously in
the campaign are kept; their campaign_id is cleared.
Example
curl -X POST https://links.esmsafrica.io/v1/campaigns \
-H "Authorization: Bearer esms_l_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "name": "Summer promo", "color": "#ff6a1a" }'