Get broadcast action metrics
Returns a list of metrics for an individual action both in total and in steps (days, weeks, etc) over a period of time. Stepped series metrics return from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1 means two days - the 48 hours before the API request was made. ?period=days&steps=0 returns the same as the maximum of the period - ?period=days&steps=45. See the steps parameter below for the maximum count of each period.
Multi-language messages
If the action is a multi-language message, you can retrieve metrics for a single language variant or all language variants. To retrieve metrics for a single language variant, pass the id of the action. To retrieve aggregate metrics and a breakdown for each language variant, pass the multi_language_branch_action_id, which is the same for each variant of a message. You can get both ids from the List broadcast actions endpoint.
If you pass the multi_language_branch_action_id, then the metric object shows the total across every variant. The language_variants object shows a breakdown for each language variant.
If you want to get the sum of all metrics across all of a broadcast's actions, you can use each action id of a multi-language message, like you would for other types of actions.
- Type: integerbroadcast
_id requiredThe identifier of a broadcast.
- Type: integeraction
_id requiredThe action in the broadcast. If the action is a message with translations, you can pass the
idof the action to get metrics for a specific language variant or pass themulti_language_branch_action_idto get metrics for each language variant and total metrics across the variants.
- Type: string enumperiod
The unit of time for your report.
values- hours
- days
- weeks
- months
- Type: integersteps
The number of periods you want to return. Defaults to the maximum available, or
12if the period is inmonths. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST. Weeks start at 00:00 EST on Sunday. Months start at 00:00 EST on the 1st of the month. - Type: string enumtype
The type of item you want to return metrics for. When empty, the response contains metrics for all possible types.
values- email
- webhook
- twilio
- whatsapp
- slack
- push
- in
_app - live
_notification
- application/json
- 400
The
broadcastID,actionIDortriggerIDis invalid. - 404
The broadcast, action, and/or trigger do not exist.
- application/json
curl https://api.customer.io/v1/broadcasts/1/actions/1/metrics \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"language_variants": {
"additionalProperty": {
"default": false,
"language": "es",
"series": {
"attempted": [
1
],
"bounced": [
1
],
"clicked": [
1
],
"converted": [
1
],
"created": [
1
],
"deferred": [
1
],
"delivered": [
1
],
"drafted": [
1
],
"failed": [
1
],
"human_clicked": [
1
],
"human_opened": [
1
],
"link_untracked": [
1
],
"machine_clicked": [
1
],
"open_untracked": [
1
],
"opened": [
1
],
"prefetch_opened": [
1
],
"replied": [
1
],
"sent": [
1
],
"spammed": [
1
],
"suppressed": [
1
],
"topic_unsubscribed": [
1
],
"tracking_consent_denied": [
1
],
"tracking_consent_granted": [
1
],
"undeliverable": [
1
],
"unsubscribed": [
1
],
"untracked": [
1
]
}
}
},
"metric": {
"series": {
"attempted": [
1
],
"bounced": [
1
],
"clicked": [
1
],
"converted": [
1
],
"created": [
1
],
"deferred": [
1
],
"delivered": [
1
],
"drafted": [
1
],
"failed": [
1
],
"human_clicked": [
1
],
"human_opened": [
1
],
"link_untracked": [
1
],
"machine_clicked": [
1
],
"open_untracked": [
1
],
"opened": [
1
],
"prefetch_opened": [
1
],
"replied": [
1
],
"sent": [
1
],
"spammed": [
1
],
"suppressed": [
1
],
"topic_unsubscribed": [
1
],
"tracking_consent_denied": [
1
],
"tracking_consent_granted": [
1
],
"undeliverable": [
1
],
"unsubscribed": [
1
],
"untracked": [
1
]
}
}
}Returns action metrics by series (with increments are based on the period and step in your request) for the broadcast. For a multi-language message, also returns a per-variant breakdown in language_variants.