Webhook endpoints
Manage where we send events, from code. The Console does the same; use whichever suits your deploys.
Endpoints belong to the key's environment: a test key manages test endpoints, which only receive test events.
Send your API key as Authorization: Bearer apk_test_… (sandbox) or apk_live_… (live). Each endpoint lists the scope the key needs. See API keys.
List endpoints
/api/v1/webhook-endpointswebhooks:writeYour endpoints in this environment, with their success rate over the last 7 days.
curl "https://api.autopayke.com/api/v1/webhook-endpoints" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY"{
"ok": true,
"data": {
"object": "list",
"data": [
{
"id": "1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73",
"url": "https://api.example.com/webhooks/autopayke",
"description": "Production listener",
"environment": "test",
"events": [
"payout.succeeded",
"payout.failed",
"payout.reversed"
],
"status": "enabled",
"disabledReason": null,
"failingSince": null,
"secretPrefix": "whsec_9xKq2LmZ",
"createdAt": "2026-11-03T09:10:00.000Z",
"successRate7d": 0.99,
"deliveries7d": 412
}
]
}
}Create an endpoint
/api/v1/webhook-endpointswebhooks:writeStart sending events to a URL. The response includes the signing secret, once.
urlstringrequiredAn https URL on the public internet, up to 2048 characters. Private, local and link-local addresses are refused.
eventsstring[]requiredThe event types to send, or ["*"] for all, including types we add later.
descriptionstringoptionalUp to 200 characters.
curl -X POST "https://api.autopayke.com/api/v1/webhook-endpoints" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.example.com/webhooks/autopayke",
"events": [
"payout.succeeded",
"payout.failed",
"payout.reversed"
],
"description": "Production listener"
}'{
"ok": true,
"data": {
"id": "1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73",
"url": "https://api.example.com/webhooks/autopayke",
"description": "Production listener",
"environment": "test",
"events": [
"payout.succeeded",
"payout.failed",
"payout.reversed"
],
"status": "enabled",
"disabledReason": null,
"failingSince": null,
"secretPrefix": "whsec_9xKq2LmZ",
"createdAt": "2026-11-03T09:10:00.000Z",
"secret": "whsec_9xKq2LmZp4Rt7Vb1Nc8Yw3Jd6Hf0Gs5A"
}
}- Store secret in your secret manager. You can roll it, but we won't show this one again through the API (the Console can reveal it after a PIN check).
Get an endpoint
/api/v1/webhook-endpoints/{id}webhooks:writeOne endpoint. failingSince is set while deliveries keep failing; after 3 days we disable it and set disabledReason.
idstringrequiredEndpoint id.
curl "https://api.autopayke.com/api/v1/webhook-endpoints/1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY"{
"ok": true,
"data": {
"id": "1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73",
"url": "https://api.example.com/webhooks/autopayke",
"description": "Production listener",
"environment": "test",
"events": [
"payout.succeeded",
"payout.failed",
"payout.reversed"
],
"status": "enabled",
"disabledReason": null,
"failingSince": null,
"secretPrefix": "whsec_9xKq2LmZ",
"createdAt": "2026-11-03T09:10:00.000Z"
}
}Update an endpoint
/api/v1/webhook-endpoints/{id}webhooks:writeChange the URL, the events or the description, or turn it off and on. Turning a disabled endpoint back on clears its failure state.
idstringrequiredEndpoint id.
urlstringoptionalNew https URL.
eventsstring[]optionalReplaces the list.
descriptionstringoptionalUp to 200 characters.
enabledbooleanoptionalfalse stops deliveries; true starts them again.
curl -X PATCH "https://api.autopayke.com/api/v1/webhook-endpoints/1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true
}'{
"ok": true,
"data": {
"id": "1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73",
"url": "https://api.example.com/webhooks/autopayke",
"description": "Production listener",
"environment": "test",
"events": [
"payout.succeeded",
"payout.failed",
"payout.reversed"
],
"status": "enabled",
"disabledReason": null,
"failingSince": null,
"secretPrefix": "whsec_9xKq2LmZ",
"createdAt": "2026-11-03T09:10:00.000Z"
}
}Delete an endpoint
/api/v1/webhook-endpoints/{id}webhooks:writeStop sending to this endpoint for good. Deliveries waiting for a retry are dropped; the events stay readable at GET /api/v1/events.
idstringrequiredEndpoint id.
curl -X DELETE "https://api.autopayke.com/api/v1/webhook-endpoints/1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY"{
"ok": true,
"data": {
"id": "1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73",
"deleted": true
}
}Roll the signing secret
/api/v1/webhook-endpoints/{id}/roll-secretwebhooks:writeIssue a new signing secret. The old one stops at once, so deploy code that accepts both before you roll, then remove the old one.
idstringrequiredEndpoint id.
curl -X POST "https://api.autopayke.com/api/v1/webhook-endpoints/1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73/roll-secret" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY"{
"ok": true,
"data": {
"secret": "whsec_Lm4Nx6Rt1Vb9Yc3Jk8Qw2Zp7Fq2mZx7L"
}
}List deliveries
/api/v1/webhook-endpoints/{id}/deliverieswebhooks:writeRecent delivery attempts to this endpoint: what we sent, what you answered and when we'll retry.
idstringrequiredEndpoint id.
curl "https://api.autopayke.com/api/v1/webhook-endpoints/1d7c3b5e-2a49-4f86-9a0e-6c2b8d4f1e73/deliveries" \
-H "Authorization: Bearer $AUTOPAYKE_API_KEY"{
"ok": true,
"data": {
"object": "list",
"data": [
{
"id": "8c1e5a2f-9b3d-4f7e-a6c0-2d8b4e1f7a93",
"eventId": "evt_3Jk8Qw2Zp7Lm4Nx6Rt1Vb9Yc",
"eventType": "payout.succeeded",
"attempt": 2,
"status": "failed",
"responseCode": 500,
"responseBody": "Internal Server Error",
"error": null,
"durationMs": 312,
"nextRetryAt": "2026-11-03T09:16:06.000Z",
"deliveredAt": null,
"createdAt": "2026-11-03T09:10:06.000Z"
}
]
}
}statusstringpending (queued), succeeded (you answered 2xx), failed (will retry), abandoned (we gave up after 3 days).
attemptinteger1 for the first try.
responseCodeinteger | nullYour HTTP status, or null when we couldn't connect.
responseBodystring | nullThe start of your response body, for debugging.
errorstring | nullWhy we couldn't deliver (timeout, DNS, TLS, refused URL).
nextRetryAtstring | nullWhen the next attempt is due.