Waitlist open: get early access

API reference: Statistics

4 endpoints of the Statistics group.

List API requests of the account

GET/v1/logs

Every authenticated API request with status, duration, the key prefix and the error code, newest first. Kept as long as the plan's metadata retention. before (a log id) is deprecated, use cursor.

Parameters

NameInTypeDescription
statusqueryenum: 2xx | 4xx | 5xxStatus class
qquerystringPart of the path
limitqueryintegerPage size. The default and the maximum depend on the endpoint (emails 50 up to 500, received mail 50 up to 200, audit up to 200, the others 100 up to 500 or 1000). Default: 100
cursorquerystringThe next_cursor of the previous page. Opaque; pass it unchanged to the same endpoint with the same filters.
beforedeprecatedqueryinteger

Example

curl "https://api.sendtide.ch/v1/logs" \
  -H "Authorization: Bearer sk_test_…"

Responses

StatusDescription
200 Requests
Response fields
dataarray<object>
data[].idinteger
data[].request_idstring
data[].methodstring
data[].pathstring
data[].statusinteger
data[].duration_msinteger
data[].key_prefixstring | null
data[].viastringkey, session or smtp
data[].error_codestring | null
data[].created_atstring (date-time)
next_cursorstring | null

Mail per day with rates

GET/v1/stats

Rates in percent with two decimals, defined as in POST /v1/analytics/metrics (bounces and complaints over sent, opens and clicks over delivered).

Parameters

NameInTypeDescription
daysqueryintegerDefault: 30
streamquerystringOnly mail of this stream
tenantquerystringSlug of a sub-account to act for.

Example

curl "https://api.sendtide.ch/v1/stats" \
  -H "Authorization: Bearer sk_test_…"

Responses

StatusDescription
200 Statistics
Response fields
daysarray<object>
days[].daystring (date)
days[].sentinteger
days[].deliveredinteger
days[].openedintegerOpened by a person
days[].machine_openedintegerOnly a privacy proxy or scanner fetched the tracking pixel
days[].clickedinteger
days[].bouncedinteger
days[].complainedinteger
totalsobject

Metrics per time bucket and dimension

POST/v1/analytics/metrics

Counts of the mail events of the account, split by time and other dimensions, from a rollup that is at most a minute behind. Read scope. All numbers are the same everywhere (dashboard, CSV, SDKs, MCP).

Unit and time. Everything counts recipients (To, Cc and Bcc), the unit billing counts, by the time of the event, in UTC. start and end (RFC 3339 or YYYY-MM-DD, end exclusive) are widened to whole buckets. Resolution hour allows 31 days (hourly buckets are kept 35 days), day 366 days, month 36 months; the start may not be older than the metadata retention of the plan. The key's environment (live or test) decides what is counted.

Counters. - accepted: recipients accepted for sending (mail that is queued; suppressed recipients are suppressed). - sent: recipients of mail handed to the provider. - delivered: recipients the receiving server accepted. - delayed: delivery delays, per recipient. - opened: opens by a person (every open event). machine_opened: opens by privacy proxies and security scanners, counted apart and never in opened. - unique_opened: mail opened by a person, once per mail and recipient (a mail to several recipients, whose opens the provider cannot attribute, counts once for the mail). - clicked: every click. unique_clicked: mail clicked, once per mail and recipient. - bounced: bounces per recipient; hard_bounced permanent ones, soft_bounced transient ones. - complained: spam complaints. unsubscribed: unsubscribes (suppressions with the reason unsubscribe, with the recipient domain as the only dimension). - failed: recipients of mail that failed or was rejected by the provider. suppressed: recipients not sent to because they are on the suppression list.

Rates are percent with two decimals, 0 when the denominator is 0: delivered_rate = delivered / sent, open_rate = unique_opened / delivered, click_rate = unique_clicked / delivered, bounce_rate = bounced / sent, complaint_rate = complained / sent (as the reputation pause counts it), unsubscribe_rate = unsubscribed / delivered. GET /v1/stats uses the same definitions.

Dimensions. time (bucket start, by resolution), tag (a mail with several tags is counted under each; untagged mail is not listed), domain (sending domain), recipient_domain (e.g. gmail.com; for opens and clicks the domain of the first recipient the event names), stream, template (alias), tenant (slug of a sub-account), ip_pool (shared or dedicated, as of when the event was counted). An empty value (no template, no tag, the account itself as tenant) is null. At most 3 dimensions. Without dimensions the answer has one row with the totals.

Filters AND together over dimensions; include matches any of its values, exclude none of them; "" stands for no value. A tag filter looks at all tags of a mail. Rows are ordered by time, then by the first metric, largest first, and paged with limit and cursor. total always covers all matching mail, not only the page, and counts each recipient once even when tag is a dimension.

Request body application/json

FieldTypeDescription
startstringRFC 3339 or YYYY-MM-DD, default 7 days before end
endstringExclusive, default now
resolutionenum: hour | day | monthDefault: "day"
metricsarray<enum: accepted | delivered | delivered_rate | sent | opened | unique_opened | machine_opened | open_rate | clicked | unique_clicked | click_rate | bounced | hard_bounced | soft_bounced | bounce_rate | complained | complaint_rate | unsubscribed | unsubscribe_rate | failed | delayed | suppressed>Default accepted, delivered, opened, clicked, bounced, complained
dimensionsarray<enum: time | tag | domain | recipient_domain | stream | template | tenant | ip_pool>
filtersobjectKeyed by dimension (not time)
include_subaccountsbooleanA main account also counts its sub-accounts Default: false
limitintegerDefault: 100
cursorstring

Example

curl -X POST "https://api.sendtide.ch/v1/analytics/metrics" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{}'

Responses

StatusDescription
200 Rows and totals
Response fields
startstring (date-time)As widened to whole buckets
endstring (date-time)
resolutionstring
metricsarray<string>
dimensionsarray<string>
dataarray<object>
data[].dimensionsobject
data[].metricsobject
next_cursorstring | null
rowsintegerNumber of groups over all pages
totalobject
total.metricsobject
422 Invalid request (unknown metric or dimension, range too long or before the retention)

Accepted and billed mail per day or month

GET/v1/analytics/usage

For main accounts. accepted counts the live recipients accepted for sending, sub-accounts included. billed is the usage the invoice sums (usage_daily of the billing account); it is lower than accepted where accepted mail was canceled. UTC days and calendar months; end is exclusive (default tomorrow), start defaults to 30 days before end.

Parameters

NameInTypeDescription
startquerystring
endquerystring
resolutionqueryenum: day | monthDefault: day

Example

curl "https://api.sendtide.ch/v1/analytics/usage" \
  -H "Authorization: Bearer sk_test_…"

Responses

StatusDescription
200 Usage
Response fields
startstring (date-time)
endstring (date-time)
resolutionstring
dataarray<object>
data[].periodstring (date)
data[].acceptedinteger
data[].billedinteger
next_cursorstring | null
totalobject
total.acceptedinteger
total.billedinteger
403 A sub-account is billed through its main account