Get email statistics
Get email statistics. Request: GET /v1/email/stats. Scope: email:read.
GET
Returns aggregate email statistics — sent, delivered, bounced, and complained counts with their rates — optionally scoped to messages created from after (inclusive) to before (exclusive).
apiKeyheader
x-api-key<token>after?stringbefore?stringSuccess
application/json- response
totalSent*integerRange
0 <= value <= 9007199254740991totalDelivered*integerRange
0 <= value <= 9007199254740991totalBounced*integerRange
0 <= value <= 9007199254740991totalComplained*integerRange
0 <= value <= 9007199254740991deliveryRate*numberbounceRate*numbercomplaintRate*numberimport { 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
}