Campaigns group links together and attach UTM parameters to every attributed click. Once a link is assigned to a campaign, the campaign's UTM values are included in the DynalinkEvent emitted by the SDK and in the attribution API response.
All campaign endpoints require the x-project-key header.
POST https://dynalink.app/api/campaigns
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Campaign display name |
status |
string | No | draft (default), active, paused, archived |
description |
string | No | Internal notes |
utm_source |
string | No | UTM source (e.g. google, newsletter) |
utm_medium |
string | No | UTM medium (e.g. cpc, email) |
utm_campaign |
string | No | UTM campaign slug |
utm_term |
string | No | UTM term (paid search keywords) |
utm_content |
string | No | UTM content (A/B variant identifier) |
start_date |
string | No | ISO 8601 date (YYYY-MM-DD) |
end_date |
string | No | ISO 8601 date (YYYY-MM-DD) |
curl -X POST https://dynalink.app/api/campaigns \
-H "Content-Type: application/json" \
-H "x-project-key: YOUR_PROJECT_KEY" \
-d '{
"name": "Summer 2026",
"status": "active",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer_2026",
"start_date": "2026-06-01",
"end_date": "2026-08-31"
}'
Response
{
"id": 4,
"name": "Summer 2026",
"status": "active",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer_2026",
"utm_term": null,
"utm_content": null,
"start_date": "2026-06-01",
"end_date": "2026-08-31",
"project_id": "9dfbcaf4-052b-4093-92fb-5781a2baa243",
"created_at": "2026-05-21T10:00:00.000000Z",
"updated_at": "2026-05-21T10:00:00.000000Z"
}
GET https://dynalink.app/api/campaigns
| Query param | Description |
|---|---|
search |
Filter by name or utm_campaign |
status |
Filter by status (draft, active, paused, archived) |
per_page |
Items per page (default 15) |
page |
Page number |
GET https://dynalink.app/api/campaigns/{id}/stats?days=30
Returns click aggregates for the given period. days defaults to 30; maximum is 365.
{
"total_links": 5,
"total_clicks": 230,
"clicks_per_day": [
{ "date": "2026-05-01", "count": 12 },
{ "date": "2026-05-02", "count": 18 }
],
"top_links": [
{
"id": 42,
"code": "SUMR99",
"name": "Summer promo deep link",
"actual_url": "https://yourapp.io?screen=offer&id=99",
"clicked_count": 95
}
]
}
PUT https://dynalink.app/api/campaigns/{id}
DELETE https://dynalink.app/api/campaigns/{id}
PUT accepts the same body parameters as the create endpoint. DELETE returns HTTP 200 on success.