Skip to main content
GET
AhaSend Go SDK
The AhaSend API returns the stored email counts of the account, or of each of its domains, for any period of the account’s history. Unlike the transactional reports, it is not limited to the account’s message metadata retention period. The counts cover transactional, campaign and inbound mail. A key with statistics:read:all can query every domain. A domain-scoped key reads only the domains in its scopes and must be able to read every comma-separated name supplied in sender_domain. Query Parameters:
  • from_time: Start of the range, included (RFC3339 format). Defaults to 30 days before to_time
  • to_time: End of the range, excluded (RFC3339 format). Defaults to now
  • group_by: Group by time period (hour, day, week, month). Defaults to day
  • sender_domain: Filter by sender domain (comma-separated, deleted domains included)
  • breakdown: domain returns the counts of each domain, paged by domain
  • limit and after: Page through the domains of a breakdown

Authorizations

Authorization
string
header
required

API key for authentication. Non-empty Security Requirement values are AhaSend API-key roles. Roles listed within one requirement object are jointly required; separate requirement objects are alternatives.

Scopes

statistics:read:all
statistics:read:{domain}

Path Parameters

account_id
string<uuid>
required

Account ID

Query Parameters

from_time
string<date-time>

Start of the range, included. It is rounded down to the start of its period. Defaults to 30 days before to_time. It cannot be before 2000-01-01.

to_time
string<date-time>

End of the range, excluded. It is rounded up to the start of the next period unless it is already at the start of a period. Defaults to now; a time after now is now.

group_by
enum<string>
default:day

Length of each period, in UTC. Weeks start on Monday. The range can be at most 31 days for hour, 366 days for day and week, and 5 calendar years for month.

Available options:
hour,
day,
week,
month
sender_domain
string

Comma-separated domain names of the account, at most 50, deleted domains included; the key must be able to read every name. Defaults to every domain the key can read.

breakdown
enum<string>

domain returns the rows of each domain, paged by domain. Without it, each row covers all the domains the request selects.

Available options:
domain
limit
integer
default:25

Maximum number of domains on a page of a breakdown (1-50). Only with breakdown=domain.

Required range: 1 <= x <= 50
after
string

Pagination cursor for the next page of a breakdown. Provide the value from next_cursor in the response. Only with breakdown=domain.

Response

Email statistics

object
enum<string>
required

Object type identifier

Available options:
email_statistics
from_time
string<date-time>
required

Start of the rounded range, included

to_time
string<date-time>
required

End of the rounded range, excluded

group_by
enum<string>
required

Length of each period

Available options:
hour,
day,
week,
month
breakdown
enum<string> | null
required

domain for a breakdown by domain. Null without a breakdown.

Available options:
domain,
null
totals
object
required

The counts of the whole request: the whole rounded range and every domain the request selects, on every page of a breakdown

data
object[]
required

Without a breakdown, one row for each period, in time order. With a breakdown, the rows of the domains of this page, by domain name, then by time.

pagination
object
required

Pages the domains of a breakdown. next_cursor is present when has_more is true; previous_cursor is never present. Without a breakdown, has_more is false.

Example: