Get email statistics

Get email statistics. View request and response details for this Samva email API endpoint.

GET
/v1/email/stats

Returns aggregate email statistics — sent, delivered, bounced, and complained counts with their rates — optionally scoped to messages created from after (inclusive) to before (exclusive).

Authorization

apiKey
headerx-api-key<token>

Query Parameters

after?string
before?string

Response Body

Success

application/json
  1. response
totalSent*integer
Range0 <= value <= 9007199254740991
totalDelivered*integer
Range0 <= value <= 9007199254740991
totalBounced*integer
Range0 <= value <= 9007199254740991
totalComplained*integer
Range0 <= value <= 9007199254740991
deliveryRate*number
bounceRate*number
complaintRate*number
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.email.getStats({});
Example Response
{  "totalSent": 0,  "totalDelivered": 0,  "totalBounced": 0,  "totalComplained": 0,  "deliveryRate": 0,  "bounceRate": 0,  "complaintRate": 0}

Related documentation