Get campaign message metadata
Returns information about the deliveries (instances of messages sent to individual people) sent from a campaign. Provide query parameters to refine the metrics you want to return.
Use the start_ts and end_ts to find messages within a time range. If your request doesn't include start_ts and end_ts parameters, we'll return the most recent 6 months of messages. If your start_ts and end_ts range is more than 12 months, we'll return 12 months of data from the most recent timestamp in your request. Timestamps reflect when deliveries were created in our system, not when they were actually sent to recipients. There may be a delay between creation and sending.
- Type: integercampaign
_id requiredThe ID of the campaign that you want to trigger or return information about.
- Type: stringstart
The token for the page of results you want to return. Responses contain a
nextproperty. Use this property as thestartvalue to return the next page of results. - Type: integerlimitmax:1000
The maximum number of results you want to retrieve per page.
- Type: stringenumtype
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
- Type: stringenummetric
Determines the metric(s) you want to return.
values- attempted
- sent
- delivered
- opened
- clicked
- Type: booleandrafts
If true, your request returns drafts rather than active/sent messages.
- Type: integerFormat: unix timestampstart
_ts The beginning timestamp for your query.
- Type: integerFormat: unix timestampend
_ts The ending timestamp for your query.
- Type: booleanget
_tracked _responses If true, the response includes
tracked_responsesfor each message—an object containing tracked response option names for in-app survey responses.
- application/json
- 400
The
campaignIDoractionIDis invalid. - 404
The campaign and/or action do not exist.
- 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/campaigns/3/messages?start=&limit=50&type=email&metric=attempted&drafts=true&start_ts=1&end_ts=1&get_tracked_responses=false' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"messages": [
{
"id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=",
"deduplicate_id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=:1609957872",
"msg_template_id": 0,
"action_id": 196,
"customer_id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
"customer_identifiers": {
"id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
"email": "person@example.com",
"cio_id": 3000001
},
"recipient": "person@email.com",
"subject": "Did you get that thing I sent you?",
"metrics": {
"delivered": 1609957872,
"sent": 1609957832
},
"created": 1609957805,
"failure_message": null,
"newsletter_id": null,
"content_id": null,
"campaign_id": 89,
"broadcast_id": null,
"type": "email",
"forgotten": false
}
]
}Returns an array of messages. Each object represents a different message in your campaign.