NorthRelayNorthRelay
API Reference

Analytics API

Retrieve email delivery metrics, engagement analytics, and geographic data via the NorthRelay API.

Analytics API

The Analytics API provides access to delivery metrics, engagement data, geographic breakdowns, and provider-level statistics. Use these endpoints to monitor your sending performance and optimize your email strategy.

Heatmap

Retrieve hourly engagement data across days of the week. Use this to identify the best times to send emails.

GET /analytics/heatmap

Query Parameters

ParameterTypeDefaultDescription
metricstringopensMetric to plot: opens, clicks, deliveries
fromstring30 days agoStart date (ISO 8601, e.g., 2026-03-01)
tostringtodayEnd date (ISO 8601)
timezonestringUTCTimezone for hour bucketing (e.g., America/Toronto)

Example Request

curl "https://app.northrelay.ca/api/v1/analytics/heatmap?metric=opens&from=2026-03-01&to=2026-03-19&timezone=America/Toronto" \
  -H "Authorization: Bearer nr_live_xxxxxxxxxxxx"

Example Response

{
  "metric": "opens",
  "from": "2026-03-01T00:00:00.000Z",
  "to": "2026-03-19T23:59:59.999Z",
  "timezone": "America/Toronto",
  "data": [
    { "day": 0, "hour": 9, "value": 142 },
    { "day": 0, "hour": 10, "value": 187 },
    { "day": 1, "hour": 9, "value": 156 },
    { "day": 1, "hour": 14, "value": 203 }
  ]
}

The day field is 0-indexed (0 = Sunday, 6 = Saturday). The hour field is 0--23 in the requested timezone.


Geographic

Retrieve engagement data broken down by country and optionally by region.

GET /analytics/geographic

Query Parameters

ParameterTypeDefaultDescription
metricstringopensMetric: opens, clicks, deliveries
fromstring30 days agoStart date (ISO 8601)
tostringtodayEnd date (ISO 8601)
countrystring--Filter by ISO 3166-1 alpha-2 country code (e.g., CA, US)

Example Request

curl "https://app.northrelay.ca/api/v1/analytics/geographic?metric=opens&from=2026-03-01" \
  -H "Authorization: Bearer nr_live_xxxxxxxxxxxx"

Example Response

{
  "metric": "opens",
  "from": "2026-03-01T00:00:00.000Z",
  "to": "2026-03-19T23:59:59.999Z",
  "data": [
    { "country": "CA", "countryName": "Canada", "value": 4521, "percentage": 42.3 },
    { "country": "US", "countryName": "United States", "value": 3890, "percentage": 36.4 },
    { "country": "GB", "countryName": "United Kingdom", "value": 891, "percentage": 8.3 },
    { "country": "DE", "countryName": "Germany", "value": 456, "percentage": 4.3 }
  ],
  "total": 10692
}

Providers

Retrieve delivery and engagement metrics broken down by email provider (Gmail, Outlook, Yahoo, etc.). Use this to identify deliverability issues with specific providers.

GET /analytics/providers

Query Parameters

ParameterTypeDefaultDescription
fromstring30 days agoStart date (ISO 8601)
tostringtodayEnd date (ISO 8601)
limitinteger10Number of top providers to return (max 50)

Example Request

curl "https://app.northrelay.ca/api/v1/analytics/providers?from=2026-03-01&limit=5" \
  -H "Authorization: Bearer nr_live_xxxxxxxxxxxx"

Example Response

{
  "from": "2026-03-01T00:00:00.000Z",
  "to": "2026-03-19T23:59:59.999Z",
  "data": [
    {
      "provider": "Gmail",
      "domain": "gmail.com",
      "sent": 5200,
      "delivered": 5180,
      "bounced": 12,
      "opened": 2340,
      "clicked": 890,
      "complained": 2,
      "deliveryRate": 99.6,
      "openRate": 45.2,
      "clickRate": 17.2
    },
    {
      "provider": "Outlook",
      "domain": "outlook.com",
      "sent": 3100,
      "delivered": 3050,
      "bounced": 35,
      "opened": 1220,
      "clicked": 410,
      "complained": 5,
      "deliveryRate": 98.4,
      "openRate": 40.0,
      "clickRate": 13.4
    }
  ],
  "total": {
    "sent": 10692,
    "delivered": 10590,
    "bounced": 72,
    "opened": 4580,
    "clicked": 1620,
    "complained": 8
  }
}

Export

Export raw analytics data as CSV or JSON for external analysis.

GET /analytics/export

Query Parameters

ParameterTypeDefaultDescription
fromstring30 days agoStart date (ISO 8601)
tostringtodayEnd date (ISO 8601)
formatstringjsonExport format: json or csv
metricsstringallComma-separated metrics: deliveries, bounces, opens, clicks, complaints
groupBystringdayAggregation period: hour, day, week, month
categoriesstring--Comma-separated categories to filter by

Example Request (JSON)

curl "https://app.northrelay.ca/api/v1/analytics/export?from=2026-03-01&to=2026-03-19&format=json&groupBy=day&metrics=deliveries,opens,clicks" \
  -H "Authorization: Bearer nr_live_xxxxxxxxxxxx"

Example Response (JSON)

{
  "from": "2026-03-01T00:00:00.000Z",
  "to": "2026-03-19T23:59:59.999Z",
  "groupBy": "day",
  "data": [
    {
      "date": "2026-03-01",
      "deliveries": 520,
      "opens": 234,
      "clicks": 89
    },
    {
      "date": "2026-03-02",
      "deliveries": 480,
      "opens": 201,
      "clicks": 76
    }
  ]
}

Example Request (CSV)

curl "https://app.northrelay.ca/api/v1/analytics/export?from=2026-03-01&format=csv&groupBy=day" \
  -H "Authorization: Bearer nr_live_xxxxxxxxxxxx" \
  -o analytics.csv

The CSV response includes a Content-Disposition: attachment; filename="analytics-export.csv" header. The first row contains column headers.


Summary

Get a high-level summary of your sending performance for a given period.

GET /analytics/summary

Query Parameters

ParameterTypeDefaultDescription
fromstring30 days agoStart date (ISO 8601)
tostringtodayEnd date (ISO 8601)

Example Request

curl "https://app.northrelay.ca/api/v1/analytics/summary?from=2026-03-01" \
  -H "Authorization: Bearer nr_live_xxxxxxxxxxxx"

Example Response

{
  "from": "2026-03-01T00:00:00.000Z",
  "to": "2026-03-19T23:59:59.999Z",
  "totals": {
    "sent": 10692,
    "delivered": 10590,
    "bounced": 72,
    "deferred": 30,
    "opened": 4580,
    "uniqueOpens": 3210,
    "clicked": 1620,
    "uniqueClicks": 1140,
    "complained": 8,
    "unsubscribed": 15
  },
  "rates": {
    "deliveryRate": 99.0,
    "bounceRate": 0.7,
    "openRate": 42.8,
    "clickRate": 15.2,
    "clickToOpenRate": 35.5,
    "complaintRate": 0.07,
    "unsubscribeRate": 0.14
  },
  "quotaUsed": 10692,
  "quotaLimit": 50000,
  "quotaPercentage": 21.4
}

The rates object contains percentages. clickToOpenRate is clicks divided by opens (not by sends).


Metric Definitions

MetricDefinition
sentTotal emails submitted to the delivery queue
deliveredEmails accepted by the recipient mail server (2xx SMTP response)
bouncedEmails permanently rejected (5xx SMTP response)
deferredEmails temporarily rejected; NorthRelay will retry automatically
openedTotal open events (includes repeat opens by the same recipient)
uniqueOpensDistinct recipients who opened at least once
clickedTotal click events (includes repeat clicks)
uniqueClicksDistinct recipients who clicked at least once
complainedRecipients who marked the email as spam
unsubscribedRecipients who clicked the unsubscribe link
deliveryRatedelivered / sent * 100
bounceRatebounced / sent * 100
openRateuniqueOpens / delivered * 100
clickRateuniqueClicks / delivered * 100
clickToOpenRateuniqueClicks / uniqueOpens * 100
complaintRatecomplained / delivered * 100
unsubscribeRateunsubscribed / delivered * 100

On this page