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 is200with the full result.async— the request returns202immediately with ajobId. Use the result endpoint to poll untiljobStatusisfinishedorerror.
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 body — RedactionRequest.
Response — RedactionResponse.
Status codes:
| Code | Meaning |
|---|---|
200 | Sync only. The job completed and the response contains the full result. |
202 | Async only. The job was accepted and is running. Poll the result endpoint with the returned jobId. |
400 | The request was malformed, or the file references and DEK tokens don’t match existing files. |
404 | No file with the given pdfFileId or fdfFileId exists. |
429 | Admission control rejected the request because too many jobs are pending. |
503 | The 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:
| Name | Type | Description |
|---|---|---|
jobId | string (UUID) | The jobId returned by the start-job request. |
Response — RedactionResponse.
Status codes:
| Code | Meaning |
|---|---|
200 | The job has finished. The response contains the full result. |
202 | The job is still running. Poll again. |
400 | The request was malformed. |
404 | No job with the given jobId exists. |
Example:
curl "http://localhost:9982/v1/jobs/redaction/$JOB_ID/result"
Schemas
RedactionRequest schema
| Field | Type | Description |
|---|---|---|
processingMode | ProcessingMode | Whether the request blocks until the job completes (sync) or returns immediately for polling (async). |
pdfFileId | string (UUID) | Identifier of the previously uploaded source PDF. |
pdfDekToken | string | DEK token returned alongside the pdfFileId at upload time. |
fdfFileId | string (UUID) | Identifier of the FDF file produced by a detection job, or of an FDF re-uploaded after visual editing. |
fdfDekToken | string | DEK token for the FDF file, returned alongside the fdfFileId. |
redactionInput | RedactionInput | The list of entities to redact. |
RedactionResponse schema
| Field | Type | Description |
|---|---|---|
jobId | string (UUID) | Identifier of the job. Use it to poll the result endpoint. |
jobType | JobType | Always redaction for this endpoint. |
jobStatus | JobStatus | Current state of the job. |
error | ApiErrorResponse | Set when jobStatus is error. Otherwise omitted. |
outputFiles | array of FileResult | References to files produced by the job. For redaction, contains one entry pointing at the redacted PDF. Empty until the job is finished. |
RedactionInput schema
| Field | Type | Description |
|---|---|---|
redactions | array of RedactionEntityDto | Entities to redact. Same shape as DetectionResult.redactions. |