Messages
Messages
The Messages API provides access to message data and the ability to cancel the sending of a message.
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 a GET
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 a paging
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 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.