Documents

Stream events

GET https://api.129.212.147.181.sslip.io/v1/documents/{document}/stream

Server-sent events: document.status ({"status"}), document.delta ({"text"}, the document as it is written), then exactly one of document.ready (the Document) or document.failed ({"error"}). Each event has an id; reconnect with Last-Event-ID to resume. A generating status means the text starts from empty: it can come again if we restart a document whose writing was interrupted on our side, so clear what you have shown when you get it. A form filed on its official PDF (a deed, for example) is filled in rather than written: it goes from queued to rendering to document.ready with no generating and no deltas.

Path parameters

document string required

Headers

Authorization string required
Bearer dg_test_… or Bearer dg_live_…
Last-Event-ID string optional

Returns

200 OK: The event stream. Content type text/event-stream.

Errors

StatusCodeWhat to do
404document_not_foundCheck the ID and that it belongs to your organisation.
410document_expiredThe files were deleted at expires_at. Generate it again.

Any endpoint can also return the common errors (bad key, rate limit, idempotency).