Skip to content

Test and replay deliveries

sendTest (send_test) queues a signed webhook.test event for an endpoint, to check the receiver end to end:

const queued = await kindgi.webhookEndpoints.sendTest(endpointId);
console.log(queued.deliveryId, queued.event.type, queued.status);
// A few seconds later
await new Promise((resolve) => setTimeout(resolve, 5000));
const { data } = await kindgi.webhookEndpoints.listDeliveries(endpointId, { limit: 1 });
console.log(data[0]?.status, data[0]?.attempts, data[0]?.lastResponseStatus);
a0e05ab7-6cff-440b-b291-d03c0f4443c0 webhook.test pending
delivered 1 204

The test event is signed like any other:

{
"id": "c1214e78-694f-401d-8b92-e374f0846a88",
"type": "webhook.test",
"createdAt": "2026-10-03T20:16:35.159Z",
"data": {
"endpointId": "9c0b9504-c5a6-439f-a5f9-e755f1c5e6e9"
}
}

Each event sent to an endpoint is a delivery. listDeliveries (list_deliveries) shows them, newest first, with how the endpoint answered:

{
"deliveryId": "6ca19f2b-0c57-481e-a768-ef06283898c0",
"endpointId": "9c0b9504-c5a6-439f-a5f9-e755f1c5e6e9",
"event": { "id": "f2b45827-da3c-4f4e-95ff-9422f0de0e13", "type": "run.finished", … },
"status": "delivered",
"attempts": 1,
"nextAttemptAt": null,
"lastAttemptAt": "2026-10-03T20:15:32.194Z",
"lastResponseStatus": 204,
"lastError": null,
"createdAt": "2026-10-03T20:15:32.095Z",
"deliveredAt": "2026-10-03T20:15:32.194Z"
}
  • status: pending (waiting for its next attempt), delivered (the endpoint answered 2xx) or failed (every attempt failed).
  • lastResponseStatus and lastError say what went wrong: connection-refused when nothing listened at the URL, for example.
  • nextAttemptAt is when a pending delivery is tried again.

Pass status: 'failed' (status="failed") to list only the ones that gave up.

When an endpoint's URL is wrong, its deliveries stay pending: the first attempt's lastError is connection-refused when nothing listens there, and nextAttemptAt is a minute later. Fix the URL and send the delivery again, now:

// Point the endpoint at the right URL
await kindgi.webhookEndpoints.update(endpointId, { url: 'http://localhost:8787/hooks/kindgi' });
// Send a delivery again now, instead of at its next attempt
const again = await kindgi.webhookEndpoints.redeliver(endpointId, deliveryId);
console.log(again.status);
pending

A few seconds later, the delivery is delivered. update also changes an endpoint's events, filter, secretRef and description.

unregister stops the endpoint. Its deliveries that were still pending fail, and it no longer appears in list.

The webhook endpoints reference lists every operation.