GET/api/v1/projects/{project_id}/campaigns/{campaign_id}/stats
get_campaign_stats
Reads where a campaign’s sending is: its status, how many recipients its launch wrote, and its deliveries by status (queued, deferred, sent, bounced, failed, suppressed, cancelled, and total), counted from the deliveries now, and its opens and clicks (total: every hit, unique: the distinct subscribers).
- Call it
- to follow a launched campaign or to see how it ended; a draft’s counts are zero.
- Needs
- the campaign’s id and an admin key with
project_id, or a project key with scoperead(its own project; the argument is ignored; another project’s campaign isnot_found). Changes nothing. - Returns
- the same as
GET /api/v1/projects/{project_id}/campaigns/{campaign_id}/stats.
Arguments
- object
-
campaign_idstring · uuidrequiredThe campaign’s id, as
create_campaignorlist_campaignsgave it. -
project_idstring · uuid | nullThe campaign’s project. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
campaign_idstring · uuid -
clicksCampaignEventCountsIts clicks: follows of its tracked links (
message.clicked).2 fields
- CampaignEventCounts object · all fields required
-
totalinteger · uint64Every event, repeats included.
≥ 0
-
uniqueinteger · uint64The distinct subscribers of those events.
≥ 0
-
deliveriesCampaignDeliveryCountsIts deliveries by status.
8 fields
- CampaignDeliveryCounts object · all fields required
-
bouncedinteger · uint64Refused for good at
RCPT(a hard bounce).≥ 0
-
cancelledinteger · uint64Not sent: the campaign was cancelled.
≥ 0
-
deferredinteger · uint64Refused for now; tried again later.
≥ 0
-
failedinteger · uint64Refused for good otherwise, out of attempts, or not made.
≥ 0
-
queuedinteger · uint64Waiting for their first attempt.
≥ 0
-
sentinteger · uint64Taken by the recipient’s server.
≥ 0
-
suppressedinteger · uint64Held back by a suppression or the subscriber’s status.
≥ 0
-
totalinteger · uint64Every delivery: the sum of the above.
≥ 0
-
opensCampaignEventCountsIts opens: loads of the open pixel (
message.opened).2 fields
- CampaignEventCounts object · all fields required
-
totalinteger · uint64Every event, repeats included.
≥ 0
-
uniqueinteger · uint64The distinct subscribers of those events.
≥ 0
-
statusstringThe campaign’s status now.
-
total_recipientsinteger · uint64 | nullHow many recipients its launch wrote;
nullbefore the launch.≥ 0
Definitions
CampaignDeliveryCounts
How many deliveries of a campaign are in each status; all zero before the launch.
- object · all fields required
-
bouncedinteger · uint64Refused for good at
RCPT(a hard bounce).≥ 0
-
cancelledinteger · uint64Not sent: the campaign was cancelled.
≥ 0
-
deferredinteger · uint64Refused for now; tried again later.
≥ 0
-
failedinteger · uint64Refused for good otherwise, out of attempts, or not made.
≥ 0
-
queuedinteger · uint64Waiting for their first attempt.
≥ 0
-
sentinteger · uint64Taken by the recipient’s server.
≥ 0
-
suppressedinteger · uint64Held back by a suppression or the subscriber’s status.
≥ 0
-
totalinteger · uint64Every delivery: the sum of the above.
≥ 0
CampaignEventCounts
How many events of a kind a campaign has: every one, and the distinct
subscribers among them (two opens by one subscriber: total 2,
unique 1).
- object · all fields required
-
totalinteger · uint64Every event, repeats included.
≥ 0
-
uniqueinteger · uint64The distinct subscribers of those events.
≥ 0
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: GET /api/v1/projects/{project_id}/campaigns/{campaign_id}/stats