Download a document

View as Markdown
Download one document, as the source issued it. The raw file, streamed with its own content type and its original filename in `Content-Disposition`. The `attachment_id` comes from [the document list](api:GET/executions/results/{execution_id}/attachments/v1/all) or from the `attachments` of any result that carries documents. <Tip> **These are the originals** — signed and stamped by the administration or the institution that issued them. That is what makes them usable in a file that has to stand up to an audit, and what a re-typed figure can never be. </Tip> <Warning> **A document lives exactly as long as its execution.** [Deleting the execution](api:DELETE/executions/handler/v1/{execution_id}/delete) removes every file under it, permanently — store what you need to keep before you purge. </Warning> | Status | Meaning | | :--- | :--- | | `200` | The file, streamed with its own content type. | | `202` | `execution_still_processing` — documents are served once the execution is closed. | | `404` | No document with that id in this execution. | <Note> **Server to server only.** This call is authorised with your application secret: it belongs in your backend, never in a browser, a mobile app or anything your customer can read. </Note>

Authentication

X-APP-SECRETstring
Application Secret

Path parameters

execution_idstringRequiredformat: "object-id"
The execution, as the acceptance response returned it.
attachment_idstringRequiredformat: "object-id"
The document, as the attachment list reports it.

Response

200 OK
The file itself, streamed with the content type the source issued it under. Content-Disposition carries the original filename.

Errors

404
Not Found Error
422
Unprocessable Entity Error