Get message volume analytics
Returns outbound message counts over the half-open selected instant range, grouped by organization-local calendar day, week, or month.
GET
Returns outbound message counts over the half-open selected instant range, grouped by organization-local calendar day, week, or month. A range with traffic returns every bucket in it, including the ones that saw none; a range with no outbound traffic at all returns no buckets. A range with no before runs through the current instant, so its quiet trailing buckets are reported as zero.
apiKeyheader
x-api-key<token>namespaceId?stringMatch
^ns_[0-9a-hjkmnp-tv-z]{16,24}$after?stringbefore?stringgroupBy?stringValue in
"day""week""month"channel?stringValue in
"sms""whatsapp""email"Success
application/json- response
volumeHistory*array<>import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.analytics.getStats({});Example Response
{
"volumeHistory": [
{
"date": "string",
"email": 0,
"whatsapp": 0,
"sms": 0
}
]
}