Skip to main content
An export packs documents and the evidence around them into a ZIP archive. Which way it arrives depends on the endpoint you call: the one that exports a single document answers with the archive itself, while every other export is prepared in the background and collected once it is ready. This guide does both, in four calls.

Before you begin

  • Documents to export. The examples export employment agreements filed under the Contract category.

Step 1: Export a single document

The request body says what goes into the archive:
Request
Response
The archive arrives in the response itself — no job, no polling. Alongside the audit trail and the attachments shown here, the body can ask for the certificate of fulfillment and the files recipients submitted, merge everything into one PDF, seal the result, or protect it with a password; the API reference lists them all. Every export is a ZIP, even this one covering a single document — an export is the document’s package, not a bare file. To download just the document’s own PDF, use the file endpoint instead, as in Upload and download files.

Step 2: Queue an export of a selection

Every export other than the single-document one runs in the background, however much it ends up containing. This one takes the filters of a document search, plus the same archive options:
Request
Response
The response is the job, not the archive: 202 means the work has been accepted. status is still queued, and fileId and finishedAt are null because nothing has been produced yet. Keep the id.

Step 3: Poll until the export is finished

Read the job until it reaches a terminal status:
Request
Response
A few things to notice:
  • status walks queued → processing → completed, or ends in failed when the archive could not be produced.
  • fileId appears once the export completed — that is the finished archive.
  • isEmpty is true when the export finished with nothing to put in an archive — the documents it selected were gone by the time it ran. There is then no archive, and fileId stays null.

Step 4: Download the archive

The result is an ordinary file, so it is downloaded like any other:
Request
Response
An export job stays readable after it finished, so the archive can be collected later — and only by the account that started the export; anybody else gets a 404. Two more exports work exactly the same way, differing only in what they gather: POST /folders/export takes a whole folder tree by its scope, or the folders you name in folderIds, while POST /me/export packs up your own documents together with their metadata. Both answer with the same job, polled and downloaded as above.
When the selection matches nothing, no job is created and the answer is 404. A scheduled export that finds nothing in its window is therefore an expected outcome, not a failure — treat that status as “nothing to export this time”.
Because a queued export is a create, it accepts an Idempotency-Key, so a retried request cannot start the same export twice — Retry requests safely covers that.

Complete example

Queueing an export, waiting for it, and saving the archive, as a Node.js script. Error handling is minimal for brevity — in production, inspect the error envelope of non-2xx responses.

Next steps