Guides

Event log & replay

Every event a workspace produces is recorded once, whether or not a webhook was listening, with the same id and body a webhook would have received. Poll it, catch up from it, replay it.

Why poll

behind a firewall
An integration that cannot accept an inbound request can still consume the feed on its own clock.
after an outage
One that was down catches up from the last event it handled, not from whatever its endpoint happened to catch.
long after
An event can be replayed to a webhook after its delivery record is gone.

Consuming the feed

Read forward: take a page, handle it, keep nextCursor, and ask for what comes after it with after. since is only for a first poll that has no cursor yet. Filter with type (repeatable), queueId or documentId.

curl "https://docuflow.pendral.io/api/v2/events/log?after=18452&limit=100" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
200 OK
{
"events": [
{
"id": "evt_5f0c2a9b7d1e4c3a8b6f2d10",
"type": "document.approved",
"createdAt": "2026-10-01T12:00:00.000Z",
"cursor": "18453",
"documentId": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0003qh8zq7n2v4kx",
"data": { "document": { … }, "fields": { … }, "links": { … } }
}
],
"nextCursor": "18453",
"hasMore": false
}
nextCursor
Where to resume. Returned even on an empty page, so a caught-up poller keeps its place.
hasMore
True when more events were already waiting: poll again at once rather than sleeping.
id
The same evt_… id the webhook delivery carried. Delivery is at least once on both halves, so deduplicate on it.
30 days
Events are kept for 30 days. A consumer offline longer than that reconciles from the documents themselves.

GET /api/v2/events/log/{id} returns one event with its envelope: the exact body a webhook was sent.

Replaying to webhooks

Replay re-sends the stored envelope verbatim, so what arrives is what the endpoint missed rather than what the document looks like now. Without webhookId it goes to every enabled webhook subscribed to the event type; with one it goes to that webhook regardless of its subscription. The answer is 202: deliveries are queued and signed like any other.

curl -X POST "https://docuflow.pendral.io/api/v2/events/log/evt_5f0c2a9b7d1e4c3a8b6f2d10/replay" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "webhookId": "clx9k2m4p0004qh8zw3b6e9ty" }'

The live stream

GET /api/v2/events is a text/event-stream of what is happening now: each data: line is one JSON event, document.created, document.updated or document.deleted with the document's status, stage and progress. Comment lines (: ping) keep the connection open every 25 seconds. Reconnect when it closes.

curl -N "https://docuflow.pendral.io/api/v2/events" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"

Live, not durable

The stream is for progress bars and dashboards: nothing is kept for a client that was not connected. For anything that must not be missed, use webhooks or the log above. The stream cannot be batched.