Get API key send statistics
Get API key send statistics. Request: GET /v1/api-keys/{id}/stats. Scope: apiKeys:read.
GET
Returns aggregate send counts and daily volume attributed to an API key between after and before, a window of at most 90 days that defaults to the last 30 days.
apiKeyheader
x-api-key<token>id*stringMatch
^key_[0-9a-hjkmnp-tv-z]{16,24}$after?stringbefore?stringSuccess
application/json- response
totalRequests*integerRange
0 <= value <= 9007199254740991successfulRequests*integerRange
0 <= value <= 9007199254740991failedRequests*integerRange
0 <= value <= 9007199254740991dailyVolume*array<>import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.apiKeys.getStats({
"id": "example"
});Example Response
{
"totalRequests": 0,
"successfulRequests": 0,
"failedRequests": 0,
"dailyVolume": [
{
"date": "string",
"requests": 0
}
]
}