Skip to Content

Get webhook delivery statistics

Get webhook delivery statistics. Request: GET /v1/webhooks/{id}/stats. Scope: webhooks:read.

GET
/v1/webhooks/{id}/stats

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^wep_[0-9a-hjkmnp-tv-z]{16,24}$

Query Parameters

after?string
before?string

Response Body

WebhookStatsResponse

application/json
  1. response
total*integer
Range0 <= value <= 9007199254740991
pending*integer
Range0 <= value <= 9007199254740991
delivered*integer
Range0 <= value <= 9007199254740991
exhausted*integer
Range0 <= value <= 9007199254740991
cancelled*integer
Range0 <= value <= 9007199254740991
daily*array<>
latestAttempt*|null
Example Request
import { 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"
  }
}

Related documentation