Retrieve a campaign's metrics over timeMenu

Retrieve a campaign's metrics over time

GET/v1/campaigns/{id}/series

Requires an API key with the campaigns:read scope. About keys and scopes

Works with integration, agent and partner keys.

Returns how a campaign's metrics built up over time: for each hour or day, how many messages were sent, delivered, opened, clicked, bounced and so on, with email and push counted apart. Use it to chart a send, for example to see that most opens came in the first six hours.

Each point counts what happened in that hour or day: an open at 10:05 counts in the 10:00 hour, whenever the email was sent. Opens and clicks count the first per message, as in the campaign's metrics. Because a point counts events, not the people sent to in that hour, don't divide one point by another to get an open rate; divide running totals.

The series starts at the campaign's first send and runs, with no gaps, to now, in the workspace's timezone (timezone). With interval=hour it covers at most 72 hours; with interval=day, at most 366 days. from and to narrow it (from inclusive, to exclusive, from before to); a date means the start of that day in the workspace's timezone. A campaign that has not sent yet, or a window ending before its first send, returns no points.

Path parameters

idstringrequired

The campaign's id.

uuid

Query parameters

intervalstringrequired

The bucket size.

one of hour, day

fromstringoptional

Inclusive: start the series at the bucket holding this time instead of the first send. A date-time, or a date meaning the start of that day in the workspace timezone.

tostringoptional

Exclusive: end the series with the bucket holding the moment before this time instead of now, in the same forms. A date ends the series with the day before it.

Header parameters

Kirora-Workspacestringoptional

Partner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.

pattern ^[A-Za-z0-9._:-]{1,128}$

Returns

Returns 200 OK with a CampaignSeries in data. Otherwise returns an error; Errors lists every code and which to retry.

campaignIdstringrequired

uuid

intervalstringrequired

The bucket size.

one of hour, day

timezonestringrequired

The workspace's timezone, which every hour and day follows.

pointsobject[]required

One point per hour or day, from the first send to now, with no gaps.

at most 366 items

3 child attributes
startsAtstringrequired

When this hour or day starts in timezone, given as an instant.

date-time

emailobjectoptional

Email events in this hour or day; absent when the campaign sends no email.

7 child attributes
sentintegerrequired

min 0

deliveredintegerrequired

min 0

openedintegerrequired

min 0

clickedintegerrequired

min 0

bouncedintegerrequired

min 0

complainedintegerrequired

min 0

unsubscribedintegerrequired

min 0

pushobjectoptional

Push events in this hour or day; absent when the campaign sends no push.

4 child attributes
sentintegerrequired

min 0

failedintegerrequired

min 0

openedintegerrequired

min 0

clickedintegerrequired

min 0