Documents API
Use the Documents API to download redacted outputs, and for pseudonymized documents their text version and correspondence table.
GET /v1/documents/{doc_id}/output
Download the redacted PDF for a successfully processed document.
Headers
X-API-Key(required)
Path params
doc_id(required, UUID)
cURL example
curl -sS -L "https://www.redact-pdf.ai/v1/documents/DOC_ID/output" \
-H "X-API-Key: YOUR_API_KEY" \
-o redacted.pdf
Success
- HTTP
200 - Content-Type:
application/pdf - Response body: binary PDF data
Failure cases
401: missing or invalid key404: document not found or output not ready
GET /v1/documents/{doc_id}/output.md
The pseudonymized document as Markdown: one ## Page N section per page, every tag in place ([Person 1], or your rename such as [Seller]), black boxes as a block. Only for jobs created with mode=pseudonymize.
curl -sS -D headers.txt "https://www.redact-pdf.ai/v1/documents/DOC_ID/output.md" \
-H "X-API-Key: YOUR_API_KEY" \
-o document.md
- HTTP
200, Content-Typetext/markdown X-Text-Versionheader: a 16-character id of the output this text describes. It changes when the document is edited or detected again in the Studio. Pass it astext_versionto the correspondence route when you put the names back into text written from this output.402: not enough credits (same gate as the PDF)404: not found, not redacted yet, not a pseudonymize job, or no text version for this output409: the document was edited in the Studio after this text was produced; the PDF is current, the text is not
GET /v1/documents/{doc_id}/correspondence
The tag → original table of a pseudonymized document, as CSV (UTF-8 with BOM): one row per tag with placeholder, label (your rename, or empty), category and original.
curl -sS "https://www.redact-pdf.ai/v1/documents/DOC_ID/correspondence?text_version=TEXT_VERSION" \
-H "X-API-Key: YOUR_API_KEY" \
-o correspondence.csv
text_version(optional query param): theX-Text-Versionof theoutput.mdyou are restoring into. If the output changed since, you get412(text_changed) instead of a table whose tags may now stand for other names.402: not enough credits404: not found, not redacted yet, or not a pseudonymize job409: edited in the Studio after the output was produced; download it again from the Studio422: some tags have no stored original (analysed in redact mode before being pseudonymized)
The table re-identifies the document: keep it on your side. See the Pseudonymize guide.
Integration tip
Only attempt downloads for documents with status redacted from GET /v1/jobs/{job_id}.