Analytics
Query campaign performance, cohort analysis, revenue attribution, and export reports.
Analytics
Base: https://api.misar.io/mail/v1/analytics
Required scope: analytics
Overview metrics
GET /v1/analytics
Query params: startDate, endDate (ISO 8601), campaignId, granularity (day|week|month).
{
"success": true,
"data": {
"sent": 48210,
"delivered": 47891,
"opened": 19234,
"clicked": 4120,
"bounced": 319,
"unsubscribed": 82,
"complained": 11,
"deliveryRate": 0.9934,
"openRate": 0.4016,
"clickRate": 0.0861,
"unsubscribeRate": 0.0017
}
}
Time-series data
Include granularity to get per-period breakdown:
{
"series": [
{ "date": "2025-06-01", "sent": 1200, "opened": 480, "clicked": 96 },
{ "date": "2025-06-02", "sent": 980, "opened": 392, "clicked": 78 }
]
}
Industry benchmarks
Compare your metrics against industry averages:
GET /v1/analytics/benchmark
{
"industry": "SaaS",
"benchmarks": {
"openRate": 0.32,
"clickRate": 0.045,
"bounceRate": 0.008
},
"yours": {
"openRate": 0.40,
"clickRate": 0.086
},
"status": "above_average"
}
Cohort analysis
Track retention curves by signup cohort:
GET /v1/analytics/cohorts?startDate=2025-01-01&endDate=2025-06-01
Churn risk
Contacts predicted to disengage soon:
GET /v1/analytics/churn-risk
Returns a paginated list of contacts with churn probability score and recommended action.
AI insights
Natural-language summary of your recent performance:
GET /v1/analytics/insights
{
"summary": "Your open rate increased 8% this week, driven by the Tuesday send at 9am. Click-to-open rate dropped slightly — consider testing shorter CTAs.",
"recommendations": [
"Schedule sends Tuesday–Thursday between 8–10am",
"A/B test subject lines with urgency words"
]
}
Reports
Generate report
POST /v1/analytics/reports
{
"type": "campaign_performance",
"startDate": "2025-05-01",
"endDate": "2025-05-31",
"format": "json"
}
Report types:
| Type | Description |
|------|-------------|
| campaign_performance | Per-campaign stats table |
| engagement_funnel | Sent → delivered → opened → clicked funnel |
| cohort_analysis | Retention by signup cohort |
| send_time_heatmap | Open rates by day/hour |
List reports
GET /v1/analytics/reports
Revenue analytics
Track email-attributed revenue (requires ecommerce tracking):
GET /v1/analytics/revenue?startDate=2025-06-01&endDate=2025-06-30
{
"attributed": 12480.50,
"currency": "USD",
"topCampaigns": [
{ "id": "camp_01ABC", "name": "Summer Sale", "revenue": 8200.00 }
]
}
Export
Export raw analytics data as CSV:
GET /v1/analytics/export?startDate=2025-06-01&endDate=2025-06-30&format=csv
Returns a CSV file download.
Optimal send time
AI-predicted best time to send for maximum opens:
GET /v1/analytics/send-time
{
"bestDay": "Tuesday",
"bestHour": 9,
"timezone": "America/New_York",
"confidence": 0.84
}