Get WhatsApp campaign statistics
GET/api/partner-gateway/campaigns/stats
Returns delivery statistics for a date range, grouped by time bucket, newest bucket first.
- Required:
startDateandendDate(yyyy-MM-dd) andaggregateOn(hour,day,weekormonth, case-insensitive).endDatecannot be beforestartDate, and the window cannot exceed 1 year. - Campaign rows (
isHttpStatfalse): each one adds up the campaigns of one time bucket,sendingModeanddestinationType, placed by the date they started sending. - API rows (
isHttpStattrue): the messages you sent through the API, outside any campaign, one row per time bucket and channel. Leave them out when you need campaign figures only. - Drafts:
isDraftdefaults to false, which counts confirmed campaigns.isDraft=truecounts only the campaigns not yet confirmed, which have usually sent nothing. API rows are included either way. - Keys scoped by channel: a key without
CAMPAIGNSmust send asendingModewhose channels it holds (RCS_SMSneedsRCSandSMS). - Pagination is optional: without
pageandlimitevery row comes back in one page.pageis 0-based,limitsets the page size (default 10, at most 1000), and alimitwithoutpagereturns the first page.directionis currently ignored.
With sendingMode=WHATSAPP the rows count the WHATSAPP, WHATSAPP_SMS and WHATSAPP_RCS_SMS campaigns and the WhatsApp messages sent through the API. RCS_WHATSAPP_SMS campaigns are counted only when sendingMode is omitted, together with every other channel.
GET /campaigns/stats is one endpoint for SMS, RCS and WhatsApp: this page describes it for WhatsApp. See it for SMS or RCS.
Request
Responses
- 200
- 400
- 401
The statistics rows of the date range.
startDate, endDate or aggregateOn is missing or invalid, the date window is reversed or longer than 1 year, or a key without CAMPAIGNS sends no sendingMode.
The API key is missing or invalid, or holds neither CAMPAIGNS nor the operation of every channel of the campaign's sendingMode.