| title |
Get Campaign (Analytics) |
| api |
GET /analytics/campaigns/{campaignId} |
| description |
Get analytics metrics for a single campaign |
| authMethod |
key |
The get campaign endpoint returns aggregated analytics (messages, cost, revenue, orders, conversion rate, ROAS) for a single campaign by ID. If the campaign ID is invalid or no message events exist for it, the API returns null.
This endpoint requires a valid JWT token in the x-auth-token header. You can find your token in the Developers section:
x-auth-token: your_jwt_token
The unique identifier of the campaign (MongoDB ObjectId). Supports both classic campaigns and outbound automations/flows.
The response is a single campaign analytics object, or null if the campaign is not found or has no message events.
Campaign (asset) ID
Campaign document (name, createdAt, etc.)
Total messages sent for this campaign in the default date range
Total cost in cents
Attributed revenue
Number of attributed orders
Conversion rate (orders / messages) as a percentage
Average order value (revenue / orders)
Return on ad spend (revenue / cost)
Asset type: `campaigns` or `outbound-automations`
```json 200
{
"_id": "507f1f77bcf86cd799439011",
"campaign": {
"_id": "507f1f77bcf86cd799439011",
"name": "Summer Sale",
"createdAt": "2024-01-10T08:00:00.000Z"
},
"total_messages": 5000,
"cost": 25000,
"revenue": 125000,
"orders_number": 120,
"campaign_conversion_rate": 2.4,
"average_cart": 1041.67,
"roas": 5,
"campaign_type": "campaigns"
}
```
{
"message": "Unauthorized"
}