SMS statistics and reports through the API: totals by status, credits spent and days

WhatsApp & APIs·· 19 views· 3 min read

The short answer: GET /v1/sms/stats gives you, for a period, how many messages and parts went out, the credits spent, totals by status and one line for each day with messages. Without dates it covers the last 30 days; the longest period is 366. That is enough for a monthly report without adding up message by message.

The request and the answer

curl "https://api.interweb.co.mz/v1/sms/stats?from=2026-10-01&to=2026-10-31" \
-H "Authorization: Bearer prod_..."

Field What it tells you
from, to The period counted, YYYY-MM-DD to YYYY-MM-DD.
messages How many messages there were in the period.
parts How many parts they added up to.
credits_spent Credits spent. Failed, cancelled and simulated messages do not count, nor do scheduled ones not yet charged.
by_status Totals by status: scheduled, queued, sending, sent, simulated, failed, cancelled.
by_day One line per day with messages: date, messages, sent, failed and credits.

What the numbers tell you

Sign What it means What to do
Far more parts than messages Long texts, or accents that switch them to Unicode. Shorten the texts: see writing transactional SMS.
Failures going up Wrong numbers in your database, or a send that went wrong. Check the failure reasons and clean the numbers: cleaning the numbers.
A day at twice the usual volume A repeated notice, or a campaign. Make sure your system is not sending the same event twice.
Credits spent rising month after month The business grew, or there are too many notices. Review your purchase tiers: credits and price tiers.

An automatic monthly report

1 Create a read-only key, with the sms:read permission and nothing else.
2 On the first day of each month, a scheduled job calls GET /v1/sms/stats with the previous month in from and to.
3 It adds GET /v1/sms/balance, which gives the balance in credits, the daily limit, what has gone out today and the scheduled credits not yet charged.
4 It e-mails the summary to whoever decides on credit purchases.
Rather look than program? The SMS Center History has Messages, Campaigns and Balance tabs, with filters by status and date. See SMS history and scheduling.

Want to keep an eye on what your notices cost and deliver? See Transactional SMS.

See Transactional SMS

SEE ALSO

SMS history and scheduling: statuses, filters and what happens when a message fails

Tracking each transactional SMS: the message id, masked numbers, statuses and charged

SMS credits and price tiers: how buying works and how to pay less per message

Cleaning the phone numbers in your customer database before sending transactional SMS

Writing transactional SMS: the key fact first, references and amounts, and one part only

How many credits an SMS uses: 160, 153, 70 and 67 characters explained

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $5.36/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.