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
| Name | In | Type | Description |
|---|---|---|---|
status | query | enum: 2xx | 4xx | 5xx | Status class |
q | query | string | Part of the path |
limit | query | integer | Page 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 |
cursor | query | string | The next_cursor of the previous page. Opaque; pass it unchanged to the same endpoint with the same filters. |
beforedeprecated | query | integer |
Example
curl "https://api.sendtide.ch/v1/logs" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Requests Response fields
|
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
| Name | In | Type | Description |
|---|---|---|---|
days | query | integer | Default: 30 |
stream | query | string | Only mail of this stream |
tenant | query | string | Slug of a sub-account to act for. |
Example
curl "https://api.sendtide.ch/v1/stats" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Statistics Response fields
|
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
| Field | Type | Description |
|---|---|---|
start | string | RFC 3339 or YYYY-MM-DD, default 7 days before end |
end | string | Exclusive, default now |
resolution | enum: hour | day | month | Default: "day" |
metrics | array<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 |
dimensions | array<enum: time | tag | domain | recipient_domain | stream | template | tenant | ip_pool> | |
filters | object | Keyed by dimension (not time) |
include_subaccounts | boolean | A main account also counts its sub-accounts Default: false |
limit | integer | Default: 100 |
cursor | string |
Example
curl -X POST "https://api.sendtide.ch/v1/analytics/metrics" \
-H "Authorization: Bearer sk_test_…" \
-H "Content-Type: application/json" \
-d '{}' Responses
| Status | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Rows and totals Response fields
| ||||||||||||||||||||||||||||||||||||
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
| Name | In | Type | Description |
|---|---|---|---|
start | query | string | |
end | query | string | |
resolution | query | enum: day | month | Default: day |
Example
curl "https://api.sendtide.ch/v1/analytics/usage" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Usage Response fields
| |||||||||||||||||||||||||||||||||
403 | A sub-account is billed through its main account |