Metrics & analytics

Time-bucketed delivery and engagement counters, gap-filled and timezone-aware.

Three endpoints cover analytics: this page’s time series (GET /v3/metrics), the summary (GET /v3/metrics/summary — lifecycle counts, bounce classes, unique opens/clicks, latency percentiles, previous-period comparison), and the breakdown (GET /v3/metrics/breakdown — ranked tables across nine dimensions such as mailbox provider, country and template).

Time-bucketed sending statistics for your account. Every bucket carries the full set of counters — sent, delivered, bounced, complained, opened, clicked, unsubscribed, delayed, rejected and failed — so one call powers a whole dashboard. For window totals with rates and latency percentiles use GET /v3/metrics/summary; for ranked tables per domain, tag, provider and more use GET /v3/metrics/breakdown.

GET /v3/metrics

Query parameters

ParameterTypeRequiredDescription
sinceISO-8601OptionalWindow start — ISO 8601 instant or calendar day (YYYY-MM-DD = that day’s 00:00 in timezone). Default: 30 days ago.
untilISO-8601OptionalWindow end — ISO 8601 instant or calendar day (YYYY-MM-DD = end of that day in timezone, inclusive). Default: now.
resolutionstringOptionalBucket size: hour, day, week or month. Default day. Window caps: 31 days at hour, 366 days at day.
timezonestringOptionalIANA timezone the buckets are computed in (e.g. Europe/Athens). Default UTC.
group_bystringOptionaldomain (sending domain) or status (event type). Adds a groups array of per-key bucket series alongside the overall totals.
domainstringOptionalOnly count events whose message was sent from this domain.
recipient_domainstringOptionalOnly count events for recipients at this mailbox domain.
tagstringOptionalOnly count events carrying this tag (event or parent message).
templatestringOptionalOnly count events whose message used this template ID.

Response

Returns { data, resolution, timezone, period: { since, until }, group_by, groups? } where data is an array of buckets: { timestamp, sent, delivered, bounced, complained, opened, clicked, unsubscribed, delayed, rejected, failed } and groups (present when group_by is set) contains { key, data } series per sending domain or event type. The main series is gap-filled — every bucket in the window is present, zeroed when idle — so it charts directly with no client-side filling. Group series are sparse.

Responses

StatusDescription
200OK. Gap-filled, time-bucketed counts with the resolution, timezone, period and any group_by.
400Invalid query parameters (unknown timezone, since after until, window too large for the resolution).
401Missing or invalid API key.

Code examples

cURL
curl https://api.wemail.io/v3/metrics \
  -H "Authorization: Bearer afn_live_…"
Node.js
const res = await fetch("https://api.wemail.io/v3/metrics", {
  headers: {
    Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.get(
    "https://api.wemail.io/v3/metrics",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
data = r.json()