Webhook endpoints
Get delivery counters
GET
/v1/webhooks/{endpoint_id}/statsDelivered and failed totals per event type over the window. Counters are kept about 90 days; the window defaults to the last 7 days.
Required scope
read:webhooksRate limit60 requests per minute
curl 'https://api.fansquare.so/v1/webhooks/67a55c69-e54b-4b90-a9f9-e000f12eb3fd/stats' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste"{
"data": [
{
"event_type": "order.created",
"delivered_count": 128,
"failed_count": 2
}
]
}Parameters
Headers
Fansquare-VersionstringrequiredAPI version to pin. Accepts the mineral name or the release date of a version.
Path
endpoint_idstringrequiredWebhook endpoint id (the
idfield of endpoint items).format uuid
Query
startstringWindow start (ISO 8601, inclusive). Default: 7 days ago.
format date-timeendstringWindow end (ISO 8601, exclusive). Default: now.
format date-time
Response
OK, application/json
dataarray of objectsrequiredevent_typestringrequiredEvent type the counters are for.
Valuesorder.createdorder.refundedassignment.updatedconversation.ai_control_requestedpingdelivered_countintegerrequiredDeliveries acknowledged by the endpoint (any 2xx) in the window.
failed_countintegerrequiredDeliveries that exhausted their retries in the window.
curl 'https://api.fansquare.so/v1/webhooks/67a55c69-e54b-4b90-a9f9-e000f12eb3fd/stats' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste"{
"data": [
{
"event_type": "order.created",
"delivered_count": 128,
"failed_count": 2
}
]
}