#Reports
Daily numbers for one account: texts sent, segments, delivered, replies and what was charged. An agency can pull them for each client account it manages.
Details
For a client, call with your own key and add X-Sub-Account-Id: <client id> (Acting as a client). List client ids with GET /v1/sub-accounts. For a nightly job, ask for yesterday in each client's timezone.
#Daily report
GET
/v1/reports/dailyOne row per calendar day in the account's timezone (Pacific if none is set), oldest first. Days with no activity are included with zeros.
Query parameters
fromstringOptional- First day,
YYYY-MM-DD. Send withto. tostringOptional- Last day,
YYYY-MM-DD, included. Today at the latest. daysintegerOptionalDefault30Max93- The last N days, today included. Use
daysorfromandto, not both. A range is at most 93 days.
Returns
account_idinteger- The account the report is for.
timezonestring- The timezone the days are counted in. Changing the account's timezone regroups past days too.
from,to,generated_atstring- The days covered, and when the report was read.
data[]object[]date;complete(falsefor today);sms_sent(texts handed to the carrier, MMS not included);sms_segments_sent;sms_delivered(of those, delivered so far);replies(inbound messages, opt-outs not included);positive_replies;sms_cost_usdandtotal_usage_cost_usd(decimal strings, before refunds).limitationsstring[]- What the costs leave out, in plain words. Number and registration fees are never in either cost.
Delivery receipts and reply tags can still change a past day, so fetch a day again if you need it final.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_report_range | An unknown parameter, a bad or future date, from without to, days with dates, or more than 93 days. |
| 403 | permission_denied | The key lacks reports access, or team management when X-Sub-Account-Id is sent. |
| 403 | report_scope_forbidden | The key's user only sees contacts assigned to them. |
| 429 | report_busy | Two reports for your account are already running. Wait for Retry-After seconds. |
| 503 | report_unavailable | The report could not be read. Retry; do not record zeros. |