Webhooks

Signed JSON POSTs when documents change state. See the webhooks section for payloads.

List webhooks#

List webhooks

GET/api/v2/webhooks

Requires webhooks:read.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/webhooks" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"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.

POST/api/v2/webhooks

Requires webhooks:manage.

Body

application/json
namestringrequired
urlstringrequired
eventsstring[]required
queueIdstring | null
enabledboolean

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
}'
Response201
{
"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

GET/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"
Response200
{
"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

PATCH/api/v2/webhooks/{id}

Requires webhooks:manage.

Path parameters

idstringrequired
Webhook id.

Body

application/json
namestring
urlstring
eventsstring[]
queueIdstring | null
enabledboolean

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
}'
Response200
{
"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

DELETE/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"
Response200
{
"ok": true
}

Send a test event#

Send a test event

POST/api/v2/webhooks/{id}/test

Requires webhooks:manage.

Path parameters

idstringrequired
Webhook id.

Body

application/json
eventTypestring
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 '{}'
Response200
{
"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.

POST/api/v2/webhooks/{id}/rotate-secret

Requires 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"
Response200
{
"secret": "whsec_9Jd2kVwQ4r8TnL3bX7mZpA0c"
}

Delivery attempts#

Delivery attempts

GET/api/v2/webhooks/{id}/deliveries

Requires webhooks:read.cursor-paginated

Path parameters

idstringrequired
Webhook id.

Query parameters

cursorstring
limitnumber
Default50
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"
Response200
{
"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.

GET/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"
Response200
{
"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.

POST/api/v2/webhooks/{id}/deliveries/{deliveryId}/redeliver

Requires 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"
Response201
{
"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"
}
}