SMS delivery stats

SMS delivery stats

GET/api/v1/sms/stats

GET /sms/stats
curl -X GET 'https://www.unitpost.com/api/v1/sms/stats' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "sms_stats",
  "window_days": 0,
  "clamped_to_retention_days": 0,
  "totals": {
    "queued": 0,
    "sent": 0,
    "delivered": 0,
    "failed": 0,
    "suppressed": 0,
    "canceled": 0,
    "inbound": 0,
    "segments": 0
  },
  "rates": {
    "delivery": 0,
    "failure": 0,
    "suppression": 0
  }
}

Retrieve aggregate SMS delivery metrics for your workspace over a rolling window: how many texts were queued, sent, delivered, failed, suppressed (skipped on purpose: no consent, opted out, no sender that reaches the country) or canceled, how many replies came in, and how many segments were billed, with delivery, failure and suppression rates. There are no open or click numbers: carriers report sent, delivered and failed only. Control the window with days (1–365, default 30). For the messages behind these numbers, see List SMS messages. Requires the sms:read capability.

Parameters1 field
FieldTypeDescription
daysinteger · queryWindow size in days (1–365). Defaults to 30; values above 365 are rejected.
Response · 200 fields5 fields
FieldTypeDescription
objectrequiredenumsms_stats—
window_daysrequiredintegerThe rolling window, in days.
clamped_to_retention_daysrequiredintegerNon-null when the requested window exceeded the plan's log retention and was clamped to this many days.
totalsrequiredobject—
ratesrequiredobjectPercentages (one decimal). delivery and failure are vs sent + delivered + failed; suppression is vs those plus suppressed.
200401403404422

Search docs and guides

Search the docs and product guides.