Lookup messages sent to a customer
Returns information about the deliveries sent to a person. Provide query parameters to refine the data 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 6 months, we'll return 6 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: stringcustomer
_id requiredThe ID of the customer you want to perform an operation against.
- Type: stringenumid
_type The type of
customer_idyou want to use to reference a person. If you don't provide this parameter, we assume that thecustomer_idin your request is a person'sid. You can useemailandphoneonly if they're enabled as identifiers in your workspace settings; otherwise the request returns400. Referencephonevalues in E.164 format, like+14155552671, and URL-encode the leading+as%2B.values- id
- email
- phone
- cio
_id
- 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: integerFormat: unix timestampstart
_ts The beginning timestamp for your query.
- Type: integerFormat: unix timestampend
_ts The ending timestamp for your query.
- application/json
- 404
The
customer_iddoes not exist. - 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/customers/12345/messages?id_type=id&start=&limit=50&start_ts=1&end_ts=1' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"messages": [
{
"id": "string",
"deduplicate_id": "string",
"customer_id": "string",
"campaign_id": 1,
"action_id": 1,
"recipient": "string",
"subject": "string",
"metrics": {
"delivered": 1,
"sent": 1
},
"created": 1,
"failure_message": null,
"newsletter_id": null,
"content_id": null,
"broadcast_id": null,
"type": "email",
"forgotten": true
}
]
}Returns an array of message objects. Each object represents a message that you sent a customer.