Webhooks
Signed JSON POSTs when documents change state. See the webhooks section for payloads.
curl -X GET "https://docuflow.pendral.io/api/v2/webhooks" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"webhooks": [{"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","url": "https://hooks.example.com/docuflow","events": ["document.approved","document.needs_review"],"queueId": "clx9k2m4p0001qh8z3v7d5f2a","enabled": true,"createdAt": "2026-10-01T12:00:00.000Z","updatedAt": "2026-10-01T12:00:00.000Z","createdById": "clx9k2m4p0001qh8z3v7d5f2a","queueName": "queueName","lastDelivery": {"status": "status","responseStatus": 1,"createdAt": "2026-10-01T12:00:00.000Z","eventType": "eventType"}}]}
Create a webhook#
events are event types or *. The signing secret is returned once.
/api/v2/webhooksRequires webhooks:manage.
Body
application/jsonnamestringrequiredurlstringrequiredeventsstring[]requiredqueueIdstring | nullenabledboolean
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/v2/webhooks" \-H "Authorization: Bearer $DOCUFLOW_API_KEY" \-H "Content-Type: application/json" \-d '{"name": "Invoices","url": "https://hooks.example.com/docuflow","events": ["document.approved","document.needs_review"],"enabled": true}'
{"webhook": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","url": "https://hooks.example.com/docuflow","events": ["document.approved","document.needs_review"],"queueId": "clx9k2m4p0001qh8z3v7d5f2a","enabled": true,"createdAt": "2026-10-01T12:00:00.000Z","updatedAt": "2026-10-01T12:00:00.000Z","createdById": "clx9k2m4p0001qh8z3v7d5f2a"},"secret": "whsec_9Jd2kVwQ4r8TnL3bX7mZpA0c"}
Get a webhook#
Get a webhook
/api/v2/webhooks/{id}Requires webhooks:read.
Path parameters
idstringrequired- Webhook id.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/v2/webhooks/{id}" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"webhook": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","url": "https://hooks.example.com/docuflow","events": ["document.approved","document.needs_review"],"queueId": "clx9k2m4p0001qh8z3v7d5f2a","enabled": true,"createdAt": "2026-10-01T12:00:00.000Z","updatedAt": "2026-10-01T12:00:00.000Z","createdById": "clx9k2m4p0001qh8z3v7d5f2a","stats": {"total": 1,"failed": 1}}}
Update a webhook#
Update a webhook
/api/v2/webhooks/{id}Requires webhooks:manage.
Path parameters
idstringrequired- Webhook id.
Body
application/jsonnamestringurlstringeventsstring[]queueIdstring | nullenabledboolean
Responses
OK
curl -X PATCH "https://docuflow.pendral.io/api/v2/webhooks/{id}" \-H "Authorization: Bearer $DOCUFLOW_API_KEY" \-H "Content-Type: application/json" \-d '{"name": "Invoices","url": "https://hooks.example.com/docuflow","events": ["document.approved","document.needs_review"],"enabled": true}'
{"webhook": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","url": "https://hooks.example.com/docuflow","events": ["document.approved","document.needs_review"],"queueId": "clx9k2m4p0001qh8z3v7d5f2a","enabled": true,"createdAt": "2026-10-01T12:00:00.000Z","updatedAt": "2026-10-01T12:00:00.000Z","createdById": "clx9k2m4p0001qh8z3v7d5f2a"}}
Delete a webhook#
Delete a webhook
/api/v2/webhooks/{id}Requires webhooks:manage.
Path parameters
idstringrequired- Webhook id.
Responses
OK
curl -X DELETE "https://docuflow.pendral.io/api/v2/webhooks/{id}" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"ok": true}
Send a test event#
Send a test event
/api/v2/webhooks/{id}/testRequires webhooks:manage.
Path parameters
idstringrequired- Webhook id.
Body
application/jsoneventTypestring- Default
"document.approved"
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/v2/webhooks/{id}/test" \-H "Authorization: Bearer $DOCUFLOW_API_KEY" \-H "Content-Type: application/json" \-d '{}'
{"delivery": {"id": "clx9k2m4p0001qh8z3v7d5f2a","webhookId": "clx9k2m4p0001qh8z3v7d5f2a","eventType": "eventType","eventId": "clx9k2m4p0001qh8z3v7d5f2a","payload": "payload","status": "pending","attempts": 1,"responseStatus": 1,"responseBody": "responseBody","error": null,"nextAttemptAt": "2026-10-01T12:00:00.000Z","deliveredAt": "2026-10-01T12:00:00.000Z","createdAt": "2026-10-01T12:00:00.000Z"}}
Rotate the signing secret#
The old secret stops working immediately.
/api/v2/webhooks/{id}/rotate-secretRequires webhooks:manage.
Path parameters
idstringrequired- Webhook id.
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/v2/webhooks/{id}/rotate-secret" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"secret": "whsec_9Jd2kVwQ4r8TnL3bX7mZpA0c"}
Delivery attempts#
Delivery attempts
/api/v2/webhooks/{id}/deliveriesRequires webhooks:read.cursor-paginated
Path parameters
idstringrequired- Webhook id.
Query parameters
cursorstringlimitnumber- Default
50 statusstring
Responses
OK. Cursor-paginated: pass nextCursor back as cursor; null means the last page.
curl -X GET "https://docuflow.pendral.io/api/v2/webhooks/{id}/deliveries" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"items": [{"id": "clx9k2m4p0001qh8z3v7d5f2a","webhookId": "clx9k2m4p0001qh8z3v7d5f2a","eventType": "eventType","eventId": "clx9k2m4p0001qh8z3v7d5f2a","payload": "payload","status": "pending","attempts": 1,"responseStatus": 1,"responseBody": "responseBody","error": null,"nextAttemptAt": "2026-10-01T12:00:00.000Z","deliveredAt": "2026-10-01T12:00:00.000Z","createdAt": "2026-10-01T12:00:00.000Z"}],"nextCursor": "clx9k2m4p0001qh8z3v7d5f2a"}
Get a delivery#
One attempt in full: the body sent, the response status and body, the error, attempts made and when the next retry is due.
/api/v2/webhooks/{id}/deliveries/{deliveryId}Requires webhooks:read.
Path parameters
idstringrequired- Webhook id.
deliveryIdstringrequired- Delivery id.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/v2/webhooks/{id}/deliveries/{deliveryId}" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"delivery": {"id": "clx9k2m4p0001qh8z3v7d5f2a","webhookId": "clx9k2m4p0001qh8z3v7d5f2a","eventType": "eventType","eventId": "clx9k2m4p0001qh8z3v7d5f2a","payload": "payload","status": "pending","attempts": 1,"responseStatus": 1,"responseBody": "responseBody","error": null,"nextAttemptAt": "2026-10-01T12:00:00.000Z","deliveredAt": "2026-10-01T12:00:00.000Z","createdAt": "2026-10-01T12:00:00.000Z","webhook": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","url": "https://hooks.example.com/docuflow"}}}
Redeliver#
Queues a new delivery with the same payload.
/api/v2/webhooks/{id}/deliveries/{deliveryId}/redeliverRequires webhooks:manage.
Path parameters
idstringrequired- Webhook id.
deliveryIdstringrequired- Delivery id.
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/v2/webhooks/{id}/deliveries/{deliveryId}/redeliver" \-H "Authorization: Bearer $DOCUFLOW_API_KEY"
{"delivery": {"id": "clx9k2m4p0001qh8z3v7d5f2a","webhookId": "clx9k2m4p0001qh8z3v7d5f2a","eventType": "eventType","eventId": "clx9k2m4p0001qh8z3v7d5f2a","payload": "payload","status": "pending","attempts": 1,"responseStatus": 1,"responseBody": "responseBody","error": null,"nextAttemptAt": "2026-10-01T12:00:00.000Z","deliveredAt": "2026-10-01T12:00:00.000Z","createdAt": "2026-10-01T12:00:00.000Z"}}