Campaign detail
Retrieve, update, or permanently delete a single campaign. GET returns full detail including UTM links, KPIs, and channel breakdown. PATCH accepts partial updates. DELETE takes no body and returns 200 with { ok: true }.
GET
/api/v1/sites/:siteId/campaigns/:campaignIdCampaign detail
Returns full detail for a single campaign including all UTM links, aggregate KPIs (clicks, sessions, engagement rate, conversions), and a per-channel breakdown.
Request
bash
curl -X GET \
'https://letoseo.com/api/v1/sites/:siteId/campaigns/:campaignId' \
-H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'Path parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
siteId | uuid | required | The site UUID. | — |
campaignId | uuid | required | The campaign UUID. | — |
Responses
200Campaign detail with links, KPIs, and channel breakdown.
json
{
"data": {
"campaign": {
"id": "00000000-0000-0000-0000-000000000010",
"site_id": "00000000-0000-0000-0000-000000000001",
"name": "Acme Q1 Launch",
"slug": "acme-q1-launch",
"status": "active",
"destination_url": "https://acme-demo.example/launch",
"starts_at": "2025-01-06T00:00:00.000Z",
"ends_at": "2025-03-31T23:59:59.000Z",
"created_at": "2025-01-05T12:00:00.000Z"
},
"links": [
{
"id": "00000000-0000-0000-0000-000000000060",
"campaign_id": "00000000-0000-0000-0000-000000000010",
"channel": "email",
"utm_source": "email",
"utm_medium": "email",
"short_code": "abc123",
"clicks": 98,
"destination_url": "https://acme-demo.example/launch?utm_source=email&utm_medium=email&utm_campaign=acme-q1-launch",
"created_at": "2025-01-05T12:00:00.000Z"
}
],
"kpis": {
"clicks": 342,
"sessions": 187,
"engagement_rate": 0.61,
"conversions": 14
},
"channel_breakdown": [
{
"channel": "email",
"sessions": 112,
"clicks": 98
},
{
"channel": "social",
"sessions": 75,
"clicks": 244
}
]
},
"_meta": {
"generated_at": "2025-01-15T10:30:00.000Z",
"site_id": "00000000-0000-0000-0000-000000000001"
}
}404Campaign not found.
json
{
"error": "Campaign not found"
}PATCH
/api/v1/sites/:siteId/campaigns/:campaignIdUpdate a campaign
Partially updates a campaign. Only the fields you include are changed. Accepted fields: name, description, status, starts_at, ends_at, destination_url.
Request
bash
curl -X PATCH \
'https://letoseo.com/api/v1/sites/:siteId/campaigns/:campaignId' \
-H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"status": "paused",
"ends_at": "2025-02-28T23:59:59.000Z"
}'Path parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
siteId | uuid | required | The site UUID. | — |
campaignId | uuid | required | The campaign UUID. | — |
Request body (application/json)
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
name | string | optional | Updated campaign name. | — |
description | string | null | optional | Updated description. Pass null to clear. | — |
status | "draft" | "active" | "paused" | "completed" | optional | Updated campaign status. | — |
starts_at | string (ISO 8601) | null | optional | Updated start date. | — |
ends_at | string (ISO 8601) | null | optional | Updated end date. | — |
destination_url | string (URL) | optional | Updated destination URL. | — |
Example
json
{
"status": "paused",
"ends_at": "2025-02-28T23:59:59.000Z"
}Responses
200Updated campaign row.
json
{
"data": {
"id": "00000000-0000-0000-0000-000000000010",
"site_id": "00000000-0000-0000-0000-000000000001",
"name": "Acme Q1 Launch",
"slug": "acme-q1-launch",
"status": "paused",
"destination_url": "https://acme-demo.example/launch",
"starts_at": "2025-01-06T00:00:00.000Z",
"ends_at": "2025-02-28T23:59:59.000Z",
"updated_at": "2025-01-15T11:00:00.000Z"
},
"_meta": {
"generated_at": "2025-01-15T10:30:00.000Z",
"site_id": "00000000-0000-0000-0000-000000000001"
}
}404Site or campaign not found.
json
{
"error": "Site not found"
}DELETE
/api/v1/sites/:siteId/campaigns/:campaignIdDelete a campaign
Permanently deletes a campaign. This endpoint takes no request body. Returns 200 with { ok: true } on success — not 204.
Request
bash
curl -X DELETE \
'https://letoseo.com/api/v1/sites/:siteId/campaigns/:campaignId' \
-H 'Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'Path parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
siteId | uuid | required | The site UUID. | — |
campaignId | uuid | required | The campaign UUID. | — |
Responses
200Campaign deleted.
json
{
"ok": true
}404Site not found.
json
{
"error": "Site not found"
}