Documentation
Sign inGet started

Bounces by SMTP error code

GET
/v1/email/stats/bounce-codes
curl -X GET "https://us1.platform.bird.com/v1/email/stats/bounce-codes" \
  -H "Authorization: Bearer $TOKEN" \
  --url-query "sort=bounced" \
  --url-query "limit=50"
Returns bounce counts grouped by the SMTP error code the receiving mail server returned, for the requested period -- the deliverability-debugging view that answers "which SMTP responses are driving my bounces". Each row reports the bounced recipients for one code plus the hard/soft/admin/block/undetermined split. This breakdown reports the failure side only: it has no delivered, open, click, or rate fields, because a bounce code is recorded only on bounce events. Rows are ranked by the sort metric (default bounced) 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.
Query Parameters
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 bounced. Only bounce counts are sortable; this breakdown has no rates.
limit
integer
Maximum number of bounce-code rows to return, ranked by the sort field descending.
Response Payload
period
object
required
Show child attributes
period.from
string
required
Inclusive start date the response covers (YYYY-MM-DD).
period.to
string
required
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
required
Bounce-code breakdown rows, ranked by the sort metric (default bounced) descending. Empty when no bounces occurred in the period.
Show child attributes
data.smtp_error_code
string
required
The SMTP error code the receiving mail server returned for these bounces, in the extended status-code form (for example 5.1.1 for an unknown recipient, 4.2.2 for a full mailbox). The set is open and server-specific.
data.bounced
integer
required
Distinct recipients whose delivery failed with this SMTP status code. Approximately the sum of the five bounces.* sub-counts; the totals are computed independently so they may differ slightly at the approximation error.
data.bounces
object
required
Show child attributes
data.bounces.hard
integer
required
Distinct recipients with a permanent delivery failure (invalid address or non-existent domain). The address is automatically added to the suppression list.
data.bounces.soft
integer
required
Distinct recipients with a transient delivery failure (mailbox full or server temporarily unavailable). Delivery was retried.
data.bounces.admin
integer
required
Distinct recipients bounced by an upstream policy block (relaying denied, blocklisted domain). Triage usually focuses on content or sender configuration rather than recipient cleanup.
data.bounces.block
integer
required
Distinct recipients bounced because the receiving mail server blocked the sending IP for reputation reasons (mail block, spam block, spam content). Triage usually focuses on IP reputation and sending volume.
data.bounces.undetermined
integer
required
Distinct recipients bounced where the receiving server's response did not allow precise classification.
total
integer
required
Total number of distinct SMTP error codes 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.