List messages
Return a list of deliveries, including metrics for each delivery, for messages in your workspace. The request body contains filters determining the deliveries you want to return information about.
Use the start_ts and end_ts parameters to find messages within a time range. We limit your requests to 6 months. If your request doesn't include start_ts and end_ts parameters, we'll return the most recent 6 months of deliveries. If start_ts is greater than 6-months before end_ts, we only send back 6 months of data. If only end_ts is specified, we return 6 months of data before this timestamp. If only start_ts is specified, we then set the end_ts to the current time and deliver 6 months of data prior to this timestamp. 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: 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: integercampaign
_id The campaign you want to filter for.
- Type: integernewsletter
_id The newsletter you want to filter for.
- Type: integeraction
_id The action you want to filter for.
- 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 request was malformed.
- 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/messages?start=&limit=50&type=email&metric=attempted&drafts=true&campaign_id=1&newsletter_id=1&action_id=1&start_ts=1&end_ts=1&get_tracked_responses=false' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"messages": [
{
"id": "ag1q6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=",
"deduplicate_id": "ag1q6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=:1619137768",
"msg_template_id": 43,
"action_id": 215,
"parent_action_id": null,
"customer_id": null,
"recipient": "person@example.com",
"subject": "Did you get that thing I sent you?",
"metrics": {
"delivered": 1619137768,
"sent": 1619137768
},
"created": 1619137767,
"failure_message": null,
"newsletter_id": null,
"content_id": null,
"campaign_id": 23,
"broadcast_id": null,
"trigger_event_id": null,
"type": "email",
"forgotten": false
}
]
}Returns an array of message objects.