Documentation
Sign inGet started

Complaints by type

GET
/v1/email/stats/complaint-types
curl -X GET "https://us1.platform.bird.com/v1/email/stats/complaint-types" \
  -H "Authorization: Bearer $TOKEN" \
  --url-query "sort=complained" \
  --url-query "limit=50"
Returns spam-complaint counts grouped by the feedback-loop complaint type reported by the mailbox provider (for example abuse, fraud, virus), for the requested period. Use it to understand what kind of complaints your mail attracts. This breakdown reports the complaint side only: each row carries the complained count for one type and nothing else, because a complaint type is recorded only on spam-complaint events. Rows are ranked by complained descending and capped at the requested limit (default 50, hard maximum 200). Rows are computed against event time (not send time). The maximum window is 365 days; requesting a longer range returns 422.
Parametry zapytania
from
string
Start date (inclusive) in YYYY-MM-DD, interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to 30 days before to when omitted.
to
string
End date (inclusive) in YYYY-MM-DD, interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to today in that timezone when omitted. Window may not exceed 365 days.
timezone
string
IANA timezone identifier (for example Asia/Kathmandu or America/New_York) to report the statistics in. It is the single source of timezone: day and hour boundaries, and the relative window defaults used when from and to are omitted, are computed in this timezone instead of UTC, so a timezone with a sub-hour offset (such as India at +05:30 or Nepal at +05:45) still gets correct local-day and local-hour totals. When it is set, a from or to given as a calendar day names a local day in this timezone, and one given as an instant stays an absolute point in time but is rounded down to its hour and bucketed in this timezone (so the hour boundaries are local, not UTC). To avoid specifying the zone twice, a from or to that carries its own numeric UTC offset (for example +05:45) is rejected when timezone is set; use a calendar day or a Z (UTC) instant instead. Defaults to UTC.
category
string
Email statistics are aggregated across all categories. Per-category filtering is not yet available; supplying this parameter returns 422.
sort
string
Metric to rank rows by, applied descending. Defaults to complained, the only sortable metric for this breakdown.
limit
integer
Maximum number of complaint-type rows to return, ranked by complained descending.
Treść odpowiedzi
period
object
wymagane
Pokaż atrybuty podrzędne
period.from
string
wymagane
Inclusive start date the response covers (YYYY-MM-DD).
period.to
string
wymagane
Inclusive end date the response covers (YYYY-MM-DD).
period.data_as_of
nullable string
The instant the statistics in this response are current to: events recorded up to roughly this time are reflected, while more recent events may not be yet. Statistics are served from a rolling aggregation that refreshes every few seconds, so a response is near-real-time but not live; use this field to label data freshness (for example "as of 14:03") rather than assuming the numbers are to-the-second. Null when the freshness boundary is not being reported.
data
array of object
wymagane
Complaint-type breakdown rows, ranked by complained descending. Empty when no complaints occurred in the period.
Pokaż atrybuty podrzędne
data.feedback_type
string
wymagane
The complaint classification reported by the mailbox provider's feedback loop, in the abuse-reporting-format vocabulary (for example abuse, fraud, virus, other). The set is open.
data.complained
integer
wymagane
Distinct recipients who reported a message as spam with this complaint type, summed across the period.
total
integer
wymagane
Total number of distinct feedback types with activity in the period, regardless of limit. When it exceeds the number of rows returned, the ranking was capped; raise limit (up to 200) or narrow the window to see more.