SmsGetStats¶
GET sms/stats
Aggregated report over a date range: how many messages, how many segments, what it cost, and what share was delivered.
Segments and price are the point. "We sent 10 000 messages" says nothing about the invoice; "12 400 segments at 0.0032" does.
Access Control¶
Allowed roles: admin, leader. Scoped to the brand of the caller.
Request¶
GET request
GET https://{broker_domain}/sms/stats?from=2026-08-01&to=2026-08-24&groupBy=day
Authorization: <JWT_TOKEN>
{
"command": "SmsGetStats",
"extID": "1",
"data": {
"from": "2026-08-01",
"to": "2026-08-24",
"groupBy": "day"
}
}
const res = await platform.SmsGetStats({
from: "2026-08-01",
to: "2026-08-24",
groupBy: "day"
});
Request Data¶
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | No | YYYY-MM-DD, defaults to 7 days ago |
to |
string | No | YYYY-MM-DD, defaults to today |
groupBy |
enum | No | day (default), profile, status, kind, country, or campaign |
profileId |
int | No | Restrict to one provider profile |
campaignId |
string | No | Restrict to one campaign |
Behavior¶
- The delivery rate is computed over messages with a known outcome, so messages still in flight do not drag the number down.
- Grouping by
campaigngives the per-campaign cost, which is what a marketing report actually needs.
Response Data¶
deliveryRate is null while no message in the range has a final status yet — that is different from a zero rate.
{
"groupBy": "day",
"rows": [
{
"key": "2026-08-24",
"messages": 420,
"parts": 468,
"spend": 1.4976,
"delivered": 401,
"undelivered": 12,
"failed": 3
}
],
"totals": {
"messages": 8420,
"parts": 9312,
"spend": 29.7984,
"delivered": 8102,
"undelivered": 210,
"failed": 41
},
"deliveryRate": 0.9701
}
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
VALIDATION_ERROR |
Unparsable date, or from later than to |