Analytics

Get message delivery metrics

Get message delivery metrics. View request and response details for this Samva email API endpoint.

GET
/v1/analytics/delivery-metrics

Returns delivered, failed, and pending rates plus average delivery time for the outbound messages accepted in the selected date range, optionally filtered by channel. Every accepted message falls into exactly one of the three, so they always sum to 100%: a complaint counts as delivered because the message arrived, a bounce counts as failed, and anything the provider has not resolved yet counts as pending. Mail your organization received is not rated here.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

after?string
before?string
channel?string
Value in"sms""whatsapp""email"

Response Body

Success

application/json
  1. response
deliveredRate*number
failedRate*number
pendingRate*number
avgDeliveryTimeMs*number
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.analytics.getDeliveryMetrics({});
Example Response
{  "deliveredRate": 0,  "failedRate": 0,  "pendingRate": 0,  "avgDeliveryTimeMs": 0}

Related documentation