The Campaign Statistics API allows you to retrieve detailed statistics for multiple campaigns within Custobar. This data can be used to feed external tools such as PowerBI for in-depth analysis. The API is currently in active development and subject to change.
GET /api/beta/campaigns/
This API uses token-based authentication. For instructions on how to obtain a token, see the API Authentication documentation.
- headers:
- Authorization: Bearer <token>
sales_start
& sales_end
: dates for the start and end of sales statistics in the returned data, currently also controls the range of campaign statistics for automations.
yyyy-mm-dd
.limit
: how many campaigns in a response.
order
: ordering by date.
from
: paging control, you may use the value of the parameter `next` returned in any previous request to this endpoint.The response contains paging information and a list of campaign objects.
{
“order”: ”descending”
“limit”: ”30”
“campaigns”: [
{
“campaign_key”: “EMAIL-A-123”,
“kind”: “automated-email”,
“name”: “Welcome email”,
“state”: “active”,
“folder”: {
“id”: 123,
“name”: “Welcome emails”
},
“permissions”: {
“marketing_permission”: “push_marketing_permission”
},
“stats”: {
“date_range”: {
“start”: “2024-06-01”,
“end”: “2024-06-31”
},
“audience_size”: 123,
“audience_with_events”: 123,
“audience_with_sales”: 123,
“sales_for_conversion”: 123,
“events”: [
{ “name”: “sent”, “count”: 123 },
{ “name”: “delivered”, “count”: 123 },
{ “name”: “opens”, “count”: 123 },
{ “name”: “clicks”, “count”: 123 },
{ “name”: “unsubscribes”, “count”: 123 },
{ “name”: “spam_reports”, “count”: 123 },
{ “name”: “bounces”, “count”: 123 }
],
“sales”: {
“date_range”: {
“start”: “2024-06-01”,
“end”: “2024-06-31”
},
“total_sales”: 123,
“total_revenue”: 123,
“average_products_count”: 123,
“total_products_count”: 123,
“campaign_product_count”: 123,
“campaign_product_revenue”: 123,
“other_product_count”: 123,
“other_product_revenue”: 123,
“product_categories”: [
{
“discount”: 0,
“revenue”: 599.0,
“title”: “Category C”,
“units”: 5.0
}
]
},
“cache_modified_at”: “2024-06-31T12:00:00Z”
}
}
],
“next”: “i1976”
}
By default, the API returns a maximum of 30 campaigns per request, sorted by the most recent first. Use the limit
, order
, and from
query parameters to control paging.
EXT
and campaigns in draft
state will not include statistics.