Sendr Docs
API Reference

Analytics

Query delivery stats, event logs, and cohort analysis via the API.

The analytics API provides delivery statistics, event logs, and cohort analysis for your email sends.


Get stats

GET /v1/analytics/stats

Requires read_only scope.

Query parameters

ParameterTypeRequiredDescription
fromstringYesStart date (ISO 8601), e.g., 2025-01-01.
tostringYesEnd date (ISO 8601), e.g., 2025-01-31.
granularitystringNoTime bucket: hour, day (default), week, month.
tagstringNoFilter by tag name.
domainstringNoFilter by sending domain.

Response

{
  "summary": {
    "sent": 15000,
    "delivered": 14700,
    "opened": 6174,
    "clicked": 1764,
    "bounced": 300,
    "complained": 15,
    "delivery_rate": 0.98,
    "open_rate": 0.42,
    "click_rate": 0.12,
    "bounce_rate": 0.02,
    "complaint_rate": 0.001
  },
  "timeseries": [
    {
      "date": "2025-01-01",
      "sent": 500,
      "delivered": 490,
      "opened": 205,
      "clicked": 60,
      "bounced": 10,
      "complained": 0
    }
  ]
}

Rates are decimal values between 0 and 1 (e.g., 0.42 = 42%).


Get event logs

GET /v1/analytics/logs

Requires read_only scope.

Query parameters

ParameterTypeDefaultDescription
email_idstringFilter by a specific email ID.
typestringFilter by event type: delivered, bounced, opened, clicked, complained.
tostringFilter by recipient email address.
from_datestringEvents from this date (ISO 8601).
to_datestringEvents until this date (ISO 8601).
limitnumber50Results per page (1–100).
cursorstringPagination cursor.

Response

{
  "data": [
    {
      "id": "evt_abc123",
      "email_id": "em_abc123",
      "type": "delivered",
      "recipient": "user@example.com",
      "metadata": null,
      "created_at": "2025-03-12T09:00:05Z"
    },
    {
      "id": "evt_abc124",
      "email_id": "em_abc123",
      "type": "opened",
      "recipient": "user@example.com",
      "metadata": {
        "user_agent": "Mozilla/5.0...",
        "ip": "1.2.3.4"
      },
      "created_at": "2025-03-12T09:15:30Z"
    }
  ],
  "has_more": true,
  "next_cursor": "evt_abc100"
}

Export logs

GET /v1/analytics/export

Requires read_only scope. Available on Pro and higher plans. Returns a CSV or JSON export of event logs for a date range.

Query parameters

Same as event logs, plus:

ParameterTypeDefaultDescription
formatstringcsvExport format: csv or json.

Analytics retention

Log retention varies by plan:

PlanLog retentionAnalytics retention
Free1 day7 days
Pro7 days90 days
Business30 days1 year
Enterprise90 daysUnlimited

Benchmarks

GET /v1/analytics/benchmarks

Requires read_only scope. Available on Pro and higher plans.

Returns anonymized cross-organization benchmark data to compare your delivery rates, open rates, and click rates against industry averages by domain category.


SDK example

const { summary, timeseries } = await sendr.analytics.stats({
  from: "2025-01-01",
  to: "2025-01-31",
  granularity: "week",
});

console.log(`Delivery rate: ${(summary.delivery_rate * 100).toFixed(1)}%`);
console.log(`Open rate: ${(summary.open_rate * 100).toFixed(1)}%`);

const logs = await sendr.analytics.logs({
  email_id: "em_abc123",
});

On this page