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"
ParameterDescriptionExample
eventTypeFilter by specific event typeDelivery, Open, Click, etc.
templateIdFilter by template ID (UUID format)456e7890-e12d-34f5-a678-901234567890
fromStart date (ISO format)2025-04-01T00:00:00Z
toEnd date (ISO format)2025-04-10T23:59:59Z
pagePage number (pagination)1, 2, etc.
limitResults 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 CodeDescription
API_KEY_MISSINGAPI key was not provided in the request header
INVALID_API_KEYThe provided API key is invalid or expired
INVALID_REQUEST_DATAThe request parameters are invalid
INTERNAL_SERVER_ERRORAn 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 TypeDescription
SendEmail has been sent from our servers
DeliveryEmail has been successfully delivered to the recipient's mail server
OpenRecipient has opened the email
ClickRecipient has clicked a link in the email
BounceEmail could not be delivered to the recipient's mail server
ComplaintRecipient marked the email as spam
DeliveryDelayEmail delivery to the recipient's mail server has been delayed

Analyzing Email Performance


Track these key metrics to evaluate your email performance:

  1. Delivery Rate: Percentage of emails successfully delivered
  2. Open Rate: Percentage of delivered emails that were opened
  3. Click Rate: Percentage of opened emails that had links clicked
  4. Bounce Rate: Percentage of emails that couldn't be delivered
  5. 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:

  1. Check the recipient email address for typos
  2. Verify your domain is properly configured
  3. Review bounce details for specific errors
  4. Ensure your content doesn't trigger spam filters
  5. Remove recipients who consistently bounce from your lists