Introduction
Courier’s /messages endpoint is designed to retrieve logs related to your message activity. This feature allows developers to track and analyze events, such as message deliveries or errors, across multiple notification channels.Key Features
- Filter Options: You can filter logs by event type (e.g., delivery status), channel (email, SMS, etc.), or specific recipient.
- Pagination: Results are paginated, enabling you to retrieve logs in manageable chunks.
- Event Metadata: Logs include timestamps, event IDs, and detailed information about the status of each notification.
Usage Example
To query logs, send aGET request to the /messages endpoint with optional query parameters like event, messageId, recipient, or status. An example of a query might include:
Message Response
The response from the API will return apaging object if there are more than 10 results. Users can use the cursor in subsequent query calls to paginate over the results. Only 10 can be fetched at a time.
Message History Retention
Dependant on your workspace tier, Courier customers have the following retention policies for their logs: Free and Pro- 30 day log retention
- 30 day
/messages/historyretention - 30 day
/messages/outputretention
- 1 year log retention
- 90 day
/messages/historyretention - 90 day
/messages/outputretention
Courier’s message UI logs share the same data that can be found in the
/messages/history response. This includes steps like queued, sent, delivered, opened, etc. After the retention period has passed, this information will no longer be available.Message Latency
The latency for retreiving message queries can range between a few seconds to a couple minutes in some exceptional cases. We recommend you implement message query fetching with a delay to avoid retreiving empty content.