Loading...
Skip to main content

GET /messages/:message_id/history

URL: https://api.courier.com/messages/:message_id/history

Method: GET

Path Parameters

message_idstringrequired
A unique identifier associated with the message you wish to retrieve (results from a send).

Query Parameters

typestring
A supported Message History type that will filter the events returned.

Responses

status: 200 OK

resultsarray
An array of events of a previously sent message

status: 400 Bad Request

messagestring
A message describing the error that occurred.
typestring
[invalid_request_error] The type of error that occurred.

status: 404 Message Not Found

messagestring
A message describing the error that occurred.
typestring
[invalid_request_error] The type of error that occurred.

Request Example

curl --request GET \
--url https://api.courier.com/messages/1-5e2b2615-05efbb3acab9172f88dd3f6f/history?type=DELIVERED \
--header 'Accept: application/json'

Responses Example

{
"results": [
{
"data": {
"name": "Courier"
},
"event": "<Event | Notification ID>",
"profile": {},
"recipient": "<Recipient ID>",
"ts": 1562611083411,
"type": "ENQUEUED"
},
{
"event_id": "<Event>",
"notification_id": "<Notification ID>",
"ts": 1562611083411,
"type": "MAPPED"
},
{
"merged_profile": {},
"received_profile": {},
"stored_profile": {},
"ts": 1562611083411,
"type": "PROFILE_LOADED"
},
{
"channel": {
"id": "5e95b992-3505-4f66-8808-f91d5d0fe8c9"
},
"integration": {
"id": "8431c89d-aff0-484c-914d-36a257ea371f",
"provider": "sendgrid"
},
"output": {},
"ts": 1562611083411,
"type": "RENDERED"
},
{
"channel": {
"id": "ae25b99c-3d05-4f26-8108-f91d5d0fe8c9"
},
"integration": {
"id": "8431c89d-aff0-484c-914d-36a257ea371f",
"provider": "sendgrid"
},
"ts": 1562611083411,
"type": "SENT"
},
{
"channel": {
"id": "5e95b992-3505-4f66-8808-f91d5d0fe8c9"
},
"integration": {
"id": "8431c89d-aff0-484c-914d-36a257ea371f",
"provider": "sendgrid"
},
"ts": 1562611083411,
"type": "DELIVERED"
},
{
"channel": {
"id": "ae25b99c-3d05-4f26-8108-f91d5d0fe8c9"
},
"integration": {
"id": "8431c89d-aff0-484c-914d-36a257ea371f",
"provider": "sendgrid"
},
"ts": 1562611083411,
"type": "UNDELIVERABLE"
},
{
"channel": {
"id": "ae25b99c-3d05-4f26-8108-f91d5d0fe8c9"
},
"ts": 1644482783377,
"type": "UNROUTABLE"
}
]
}
{
"message": "Error Message",
"type": "invalid_request_error"
}
{
"message": "Not Found",
"type": "invalid_request_error"
}