Download Redacted Document
GET/redaction/jobs/:job_id/document
Download the redacted document of a completed job.
A Word document comes back as .docx with every detection replaced by a
_____ placeholder as a tracked change, authored as its entity name, so
a reviewer can accept or reject the redactions in Word. A legacy .doc
or .rtf is converted to .docx first. A PDF or an image comes back as
a PDF with the detections removed from text and pixels. With
format=docx a PDF is converted to .docx and marked up like a Word
document; the converted layout can differ from the PDF, rejecting every
change gives back the converted file rather than the PDF, and a PDF with
a page that is an image (a scan) is refused with a 422 with
code: pdf_image_pages and the image pages in pages, since the markup
cannot redact an image; the job's formats tells this up front. A format
the document type cannot have, such as pdf for a Word document, is a 422
naming query.format without a code. Logos, stamps and other pictures stay as they are
in either output; a job detects text only.
The file is built from the document's detections as they are stored now,
narrowed to the job's label_ids, plus the hits of its instructions;
corrections made in feld.ai after the job are included. Instruction hits
are redacted in both outputs like the entities; in Word they are tracked
changes authored by the instruction's name, marked where they were
detected, not at other occurrences of the same words; only a distinctive word of a hit that the
Word source holds in another form is also searched by text. When there is
nothing to redact, the document comes
back unchanged in the same format. A job whose detections a later job on the same document
replaced is a 409; download that job's result instead. A job that is not
completed is a 409 as well.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 413
- 422
- 502
Redacted document download
Unauthorized
Forbidden
Not Found
Conflict
Request Entity Too Large
Unprocessable Entity
Bad Gateway