Statistics & Analytics¶
Retrieve delivery statistics, engagement metrics, and email tracking data.
The analytics endpoints proxy to an internal analytics service. All data is scoped by domain.
Dashboard Data¶
Get a summary of analytics data for a domain, suitable for dashboards.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
domain | string | Domain name (e.g., acme.com) |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
start_date | string | Start date (YYYY-MM-DD) |
end_date | string | End date (YYYY-MM-DD) |
period | string | Aggregation period (hourly, daily, weekly, monthly) |
Example Request
curl -H "X-API-Key: YOUR_KEY" \
"http://your-server:5000/api/v1/analytics/dashboard/acme.com?start_date=2025-03-01&end_date=2025-03-25"
Email Volume¶
Get email volume statistics (sent, received, bounced) for a domain.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
start_date | string | Start date |
end_date | string | End date |
period | string | Aggregation period |
Example Request
curl -H "X-API-Key: YOUR_KEY" \
"http://your-server:5000/api/v1/analytics/email-volume/acme.com?period=daily&start_date=2025-03-01&end_date=2025-03-25"
Example Response
{
"domain": "acme.com",
"period": "daily",
"data": [
{
"date": "2025-03-25",
"sent": 245,
"received": 1032,
"bounced": 3,
"rejected": 12
}
]
}
Engagement Metrics¶
Get open and click rates for a domain.
Example Request
curl -H "X-API-Key: YOUR_KEY" \
"http://your-server:5000/api/v1/analytics/engagement/acme.com?start_date=2025-03-01&end_date=2025-03-25"
Example Response
{
"domain": "acme.com",
"data": {
"total_sent": 5000,
"total_opened": 3200,
"total_clicked": 800,
"open_rate": 64.0,
"click_rate": 16.0,
"click_to_open_rate": 25.0
}
}
Deliverability Metrics¶
Get deliverability statistics (bounce rates, spam complaints) for a domain.
Example Request
curl -H "X-API-Key: YOUR_KEY" \
"http://your-server:5000/api/v1/analytics/deliverability/acme.com"
Example Response
{
"domain": "acme.com",
"data": {
"delivery_rate": 98.5,
"bounce_rate": 1.2,
"hard_bounce_rate": 0.3,
"soft_bounce_rate": 0.9,
"spam_complaint_rate": 0.01,
"total_delivered": 4925,
"total_bounced": 60
}
}
Domain Metrics¶
Get general metrics for a domain.
Example Request
Tracking Statistics¶
Domain Tracking Stats¶
Get email tracking statistics (opens, clicks) for a domain.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
start_date | string | Start date |
end_date | string | End date |
Example Request
curl -H "X-API-Key: YOUR_KEY" \
"http://your-server:5000/api/v1/stats/domain/acme.com?start_date=2025-03-01&end_date=2025-03-25"
Single Email Tracking¶
Get tracking data for a specific email by its tracking ID.
Example Request
Reports¶
Generate Report¶
Create a new analytics report.
Request Body
{
"domain": "acme.com",
"report_type": "deliverability",
"start_date": "2025-03-01",
"end_date": "2025-03-25",
"format": "json"
}
Example Request
curl -X POST -H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "acme.com",
"report_type": "deliverability",
"start_date": "2025-03-01",
"end_date": "2025-03-25"
}' \
http://your-server:5000/api/v1/reports/generate
Get Report¶
Retrieve a previously generated report.
Scheduled Reports¶
List and create scheduled reports.
Request Body for Creating a Schedule
{
"domain": "acme.com",
"report_type": "engagement",
"frequency": "weekly",
"recipients": ["admin@acme.com"],
"format": "pdf"
}
Suppression List¶
Add to Suppression List¶
Add an email address to the suppression list (no more tracking events for this address).
Request Body
Example Request
curl -X POST -H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "unsubscribed@example.com", "reason": "user_request"}' \
http://your-server:5000/api/v1/tracking/suppress
Remove from Suppression List¶
Remove an email address from the suppression list.
Example Request
curl -X DELETE -H "X-API-Key: YOUR_KEY" \
http://your-server:5000/api/v1/tracking/suppress/unsubscribed@example.com
Analytics Health¶
Check the health status of the analytics service.
Example Request