Get webhook delivery statistics
Get webhook delivery statistics. Request: GET /v1/webhooks/{id}/stats. Scope: webhooks:read.
GET
Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint over its whole retained history, plus the same counts per organization-local calendar day between after and before, a window of at most 90 days that defaults to the last 30 days. Deliveries are retained for 90 days, so the longest window is the whole history.
apiKeyheader
x-api-key<token>id*stringMatch
^wep_[0-9a-hjkmnp-tv-z]{16,24}$after?stringbefore?stringWebhookStatsResponse
application/json- response
total*integerRange
0 <= value <= 9007199254740991pending*integerRange
0 <= value <= 9007199254740991delivered*integerRange
0 <= value <= 9007199254740991exhausted*integerRange
0 <= value <= 9007199254740991cancelled*integerRange
0 <= value <= 9007199254740991daily*array<>latestAttempt*|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.webhooks.getStats({
"id": "example"
});Example Response
{
"total": 0,
"pending": 0,
"delivered": 0,
"exhausted": 0,
"cancelled": 0,
"daily": [
{
"date": "string",
"pending": 0,
"delivered": 0,
"exhausted": 0,
"cancelled": 0
}
],
"latestAttempt": {
"errorCode": "string",
"completedAt": "string"
}
}