Skip to Content

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
/v1/analytics/stats

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.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

namespaceId?string
Match^ns_[0-9a-hjkmnp-tv-z]{16,24}$
after?string
before?string
groupBy?string
Value in"day""week""month"
channel?string
Value in"sms""whatsapp""email"

Response Body

Success

application/json
  1. response
volumeHistory*array<>
Example Request
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
    }
  ]
}

Related documentation