Campaigns API
Group dashboard links into campaigns from your server. Creating campaigns through the API requires a paid plan.
Authentication
Every Campaigns endpoint requires your app's private API key (
dln_priv_…) in the x-api-key header. Public SDK keys (dln_pub_…) are rejected with 401. Campaigns are created in the key's app, and campaigns of other apps return 404. See Authentication.Create a Campaign
Create a new campaign to group related deep links. Requires a paid plan.
POST /api/v1/campaigns
Headers:
x-api-key: dln_priv_your_private_key
Content-Type: application/json
Body:
{
"name": "Summer Sale 2024",
"description": "Campaign for summer promotional items", // Optional
"archived": false, // Optional (default: false)
"appId": "app-uuid" // Optional; must be the key's app (403 otherwise)
}
Response:
{
"id": "campaign-uuid",
"name": "Summer Sale 2024",
"description": "Campaign for summer promotional items",
"archived": false,
"app_id": "app-uuid",
"user_id": "user-uuid",
"created_at": "2024-01-01T00:00:00Z",
...
}List Campaigns
GET /api/v1/campaigns
Headers:
x-api-key: dln_priv_your_private_key
Query Parameters:
limit - Number of results (default: 50, max: 100)
offset - Pagination offset (default: 0)
archived - Optional: true = only archived, false = only active
Response:
[
{
"id": "campaign-uuid",
"name": "Summer Sale 2024",
"description": "Campaign for summer promotional items",
"archived": false,
"campaign_deeplinks": [
{
"deeplink": {
"id": "deeplink-uuid",
"url_path": "summer-promo",
...
}
}
],
...
}
]Get a Campaign
GET /api/v1/campaigns/{id}
Headers:
x-api-key: dln_priv_your_private_key
Response:
{
"id": "campaign-uuid",
"name": "Summer Sale 2024",
"description": "Campaign for summer promotional items",
"archived": false,
"campaign_deeplinks": [
{
"deeplink": {
"id": "deeplink-uuid",
"url_path": "summer-promo",
"target_url": "https://example.com/promo",
...
}
}
],
"stats": {
"links": 1, // member links
"clicks": 42, // sum of the members' clicks
"matches": 7 // sum of the members' matches
},
...
}Update a Campaign
PUT /api/v1/campaigns/{id}
Headers:
x-api-key: dln_priv_your_private_key
Content-Type: application/json
Body (all fields optional):
{
"name": "Updated Campaign Name",
"description": "New description",
"archived": true
}
Response:
{
"id": "campaign-uuid",
"name": "Updated Campaign Name",
...
}Add Deep Links to Campaign
POST /api/v1/campaigns/{id}
Headers:
x-api-key: dln_priv_your_private_key
Content-Type: application/json
Body:
{
"deeplink_ids": ["uuid1", "uuid2"] // links of this campaign's app
}
Response:
{ "success": true }
// 400 if any id is not a link of this campaign's app (nothing is added)Delete a Campaign
DELETE /api/v1/campaigns/{id}
Headers:
x-api-key: dln_priv_your_private_key
Response:
{ "success": true }
// The campaign's links are not deleted, only removed from the campaign.