Skip to main content

Redaction

The Redaction endpoints redact sensitive entities from a previously uploaded PDF and return a new PDF with the entities removed. The request takes the source PDF, the FDF reference produced by a detection job, and the list of entities to redact. The response contains a reference to the redacted PDF, downloadable through the Files endpoints. The cURL examples use the Manager’s default address (http://localhost:9982); substitute the host and port of your deployment as needed.

Sync and async processing

Each redaction request specifies a processingMode:

  • sync — the request blocks until redaction completes. The response is 200 with the full result.
  • async — the request returns 202 immediately with a jobId. Use the result endpoint to poll until jobStatus is finished or error.

Use sync for small, interactive flows. Use async for large documents that would exceed HTTP timeouts in sync mode, or when starting many jobs in parallel.

Endpoints

Start a redaction job

POST /v1/jobs/redaction

Redacts the entities listed in redactionInput from the previously uploaded PDF and returns a new PDF with the content removed. The behavior depends on processingMode: sync blocks until the result is ready; async returns immediately with a jobId for polling.

Request bodyRedactionRequest.

ResponseRedactionResponse.

Status codes:

CodeMeaning
200Sync only. The job completed and the response contains the full result.
202Async only. The job was accepted and is running. Poll the result endpoint with the returned jobId.
400The request was malformed, or the file references and DEK tokens don’t match existing files.
404No file with the given pdfFileId or fdfFileId exists.
429Admission control rejected the request because too many jobs are pending.
503The job couldn’t be dispatched to a worker.

Sync example:

curl -X POST "http://localhost:9982/v1/jobs/redaction" \
-H "Content-Type: application/json" \
-d '{
"processingMode": "sync",
"pdfFileId": "<PDF_FILE_ID>",
"pdfDekToken": "<PDF_DEK_TOKEN>",
"fdfFileId": "<FDF_FILE_ID>",
"fdfDekToken": "<FDF_DEK_TOKEN>",
"redactionInput": {
"redactions": [
{
"pageIndex": 0,
"text": "John",
"label": "PERSON",
"score": 0.99,
"quadrilaterals": [{
"bottomLeft": {"x": 235.8, "y": 671.8},
"bottomRight": {"x": 264.0, "y": 671.8},
"topRight": {"x": 264.0, "y": 682.0},
"topLeft": {"x": 235.8, "y": 682.0}
}]
}
]
}
}'

Replace the following:

  • <PDF_FILE_ID>: The file ID of the source PDF, returned by the upload endpoint.
  • <PDF_DEK_TOKEN>: The DEK token for the source PDF, returned by the upload endpoint.
  • <FDF_FILE_ID>: The file ID of the FDF produced by a detection job.
  • <FDF_DEK_TOKEN>: The DEK token for the FDF, returned in the detection job response.

Async example: the same body, with "processingMode": "async". The response returns a jobId to poll.

Get the result of a redaction job

GET /v1/jobs/redaction/{jobId}/result

Returns the current state of an async redaction job. Poll this endpoint until jobStatus is finished or error. The response uses the same shape whether the job is still in progress or has completed.

Path parameters:

NameTypeDescription
jobIdstring (UUID)The jobId returned by the start-job request.

ResponseRedactionResponse.

Status codes:

CodeMeaning
200The job has finished. The response contains the full result.
202The job is still running. Poll again.
400The request was malformed.
404No job with the given jobId exists.

Example:

curl "http://localhost:9982/v1/jobs/redaction/$JOB_ID/result"

Schemas

RedactionRequest schema

FieldTypeDescription
processingModeProcessingModeWhether the request blocks until the job completes (sync) or returns immediately for polling (async).
pdfFileIdstring (UUID)Identifier of the previously uploaded source PDF.
pdfDekTokenstringDEK token returned alongside the pdfFileId at upload time.
fdfFileIdstring (UUID)Identifier of the FDF file produced by a detection job, or of an FDF re-uploaded after visual editing.
fdfDekTokenstringDEK token for the FDF file, returned alongside the fdfFileId.
redactionInputRedactionInputThe list of entities to redact.

RedactionResponse schema

FieldTypeDescription
jobIdstring (UUID)Identifier of the job. Use it to poll the result endpoint.
jobTypeJobTypeAlways redaction for this endpoint.
jobStatusJobStatusCurrent state of the job.
errorApiErrorResponseSet when jobStatus is error. Otherwise omitted.
outputFilesarray of FileResultReferences to files produced by the job. For redaction, contains one entry pointing at the redacted PDF. Empty until the job is finished.

RedactionInput schema

FieldTypeDescription
redactionsarray of RedactionEntityDtoEntities to redact. Same shape as DetectionResult.redactions.