Skip to content
Hermesmail
Docs pages

Get email metrics

GET /emails/metrics

Returns standard-traffic sending, delivery, bounce, and complaint totals for the authenticated team over a date range, optionally broken down by period or domain in an IANA time zone. Calling this endpoint requires a full-access API key.

Authentication

Send a full access API key as a bearer token in the Authorization header. A sending access key is refused.

Parameters

Query

Name Type Required Details
start_date string No At most 64 characters.
end_date string No At most 64 characters.
timezone string No At most 64 characters. Default UTC.
granularity string No One of hourly, daily, weekly, monthly. Default daily.
metrics array of string No One of received, delivered, complained, suppressed, bounced, bounced_transient, bounced_permanent, bounced_undetermined, opened, clicked, unsubscribed, delivery_delayed, failed, sent, unique_opened, unique_clicked, delivery_rate, open_rate, click_rate, bounce_rate, complaint_rate, unsubscribe_rate.
dimensions array of string No One of period, domain, email, broadcast.
domain_id array of string No At most 100 items. Format uuid. Matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$.
email_id array of string No At most 100 items. Format uuid. Matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$.
broadcast_id array of string No At most 100 items. Format uuid. Matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$.

Response

Status 200, a JSON object.

Field Type Details
object metrics
start_date string Format date-time. Matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d\.\d{3}(?:Z))$.
end_date string Format date-time. Matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d\.\d{3}(?:Z))$.
metrics array of string One of received, delivered, complained, suppressed, bounced, bounced_transient, bounced_permanent, bounced_undetermined, opened, clicked, unsubscribed, delivery_delayed, failed, sent, unique_opened, unique_clicked, delivery_rate, open_rate, click_rate, bounce_rate, complaint_rate, unsubscribe_rate.
dimensions array of string One of period, domain.
granularity string One of hourly, daily, weekly, monthly.
totals object
data array of object
data[].period string
data[].domain_id string Format uuid. Matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$.
data[].domain_name string

Headers: x-request-id, ratelimit-limit, ratelimit-remaining, ratelimit-reset.

Errors

Each error answers with the status below and a JSON body naming the error. Every error has its own entry.

Status Names
400 validation_error
401 missing_api_key, validation_error, restricted_api_key
403 validation_error, restricted_api_key, suspended_api_key, terms_acceptance_required
413 validation_error
415 validation_error
422 validation_error, invalid_parameter
429 rate_limit_exceeded

Error headers: x-request-id, ratelimit-limit, ratelimit-remaining, ratelimit-reset, retry-after.

Samples

cURL

curl -X GET 'https://api.hermesmail.app/emails/metrics' \
  -H "Authorization: Bearer $HERMESMAIL_API_KEY"