Accessing Email Analytics via API
In addition to the dashboard, Notify provides comprehensive email tracking and logging via API to help you monitor the delivery and engagement of your emails no matter what you're building.
What Can You Access via API?
Everything you can do via the dashboard, you can do via API. Here's how to do it programmatically:
curl -X GET https://notify.cx/api/public/v1/email_logs \
-H "x-api-key: your_api_key"
Filtering and Pagination
Now, you can filter this data by various parameters:
curl -X GET "https://notify.cx/api/public/v1/email_logs?eventType=Delivery&from=2025-04-01T00:00:00Z&to=2025-04-10T23:59:59Z&page=2&limit=50" \
-H "x-api-key: your_api_key"
Parameter | Description | Example |
---|---|---|
eventType | Filter by specific event type | Delivery , Open , Click , etc. |
templateId | Filter by template ID (UUID format) | 456e7890-e12d-34f5-a678-901234567890 |
from | Start date (ISO format) | 2025-04-01T00:00:00Z |
to | End date (ISO format) | 2025-04-10T23:59:59Z |
page | Page number (pagination) | 1 , 2 , etc. |
limit | Results per page (max 100) | 50 |
Response
The API returns a structured response with email logs and their associated events:
{
"success": true,
"data": [
{
"messageId": "SOME-MESSAGE-ID",
"sentAt": "2025-04-10T12:00:00Z",
"templateId": "456e7890-e12d-34f5-a678-901234567890",
"events": [
{
"eventType": "Click",
"timestamp": "2025-04-10T12:05:00Z",
"source": "SOME-MESSAGE-ID",
"destination": "recipient@example.com",
"processingTimeMillis": 1234,
"clickLink": "https://example.com/click"
},
{
"eventType": "Open",
"timestamp": "2025-04-10T12:03:00Z",
"source": "SOME-MESSAGE-ID",
"destination": "recipient@example.com",
"processingTimeMillis": 987,
"openTimestamp": "2025-04-10T12:03:00Z"
}
]
}
],
"pagination": {
"page": 1,
"limit": 20,
"totalItems": 45,
"totalPages": 3
}
}
Error Responses
The API may return the following error responses:
Error Code | Description |
---|---|
API_KEY_MISSING | API key was not provided in the request header |
INVALID_API_KEY | The provided API key is invalid or expired |
INVALID_REQUEST_DATA | The request parameters are invalid |
INTERNAL_SERVER_ERROR | An unexpected server error occurred |
Email Event Types
As a recap, each email in your logs will have one of these detailed events that are tracked for each email:
Event Type | Description |
---|---|
Send | Email has been sent from our servers |
Delivery | Email has been successfully delivered to the recipient's mail server |
Open | Recipient has opened the email |
Click | Recipient has clicked a link in the email |
Bounce | Email could not be delivered to the recipient's mail server |
Complaint | Recipient marked the email as spam |
DeliveryDelay | Email delivery to the recipient's mail server has been delayed |
Analyzing Email Performance
Track these key metrics to evaluate your email performance:
- Delivery Rate: Percentage of emails successfully delivered
- Open Rate: Percentage of delivered emails that were opened
- Click Rate: Percentage of opened emails that had links clicked
- Bounce Rate: Percentage of emails that couldn't be delivered
- Complaint Rate: Percentage of recipients who marked emails as spam
Data Retention
Email logs are retained for a year by default. For longer retention periods, please contact our support team.
Troubleshooting Delivery Issues
If you see bounces or delivery failures:
- Check the recipient email address for typos
- Verify your domain is properly configured
- Review bounce details for specific errors
- Ensure your content doesn't trigger spam filters
- Remove recipients who consistently bounce from your lists