Skip to main content

Jobs

The Jobs endpoints expose the Orchestrator-managed redaction workflow. A job is created by uploading a PDF; detection then runs automatically, the job moves to readyForReview, a reviewer submits the redaction list, redaction runs, and the redacted PDF is downloadable. The cURL examples use the Orchestrator’s default address (http://localhost:9983); substitute the host and port of your deployment as needed. They also use an $API_KEY shell variable for the API key — refer to Authentication for how to obtain one.

Job lifecycle

Each job progresses through the following statuses. Endpoints that move a job between statuses are noted alongside.

StatusDescriptionSet by
createdThe job has been registered. Detection hasn’t started yet.POST /v1/jobs
detectionInProgressDetection is running.Automatic, after created.
readyForReviewDetection is complete. A reviewer can now submit the redaction list.Automatic, when detection finishes.
redactionInProgressRedaction is running.POST /v1/jobs/{id}/redaction
finishedRedaction is complete. The redacted PDF is available for download.Automatic, when redaction finishes.
expiredThe job has expired and the redacted file is no longer available.Automatic, when the uploaded PDF expires.
failedAn error occurred while processing the job. Details are in the response.Automatic, on failure.

Endpoints

All endpoints require authentication. Unauthenticated requests receive 401 Unauthorized; refer to the Authentication section for details. The per-endpoint status code tables don’t repeat this.

Create a job

POST /v1/jobs

Creates a new job by uploading a PDF as multipart form data. Detection runs automatically; the response returns the job in created or detectionInProgress status.

Request body (multipart/form-data):

FieldTypeDescription
filebinaryThe PDF to redact.

ResponseJobResponse.

Status codes:

CodeMeaning
201The job was created.
400The request was malformed or the file couldn’t be read.

Example:

curl -X POST "http://localhost:9983/v1/jobs" \
-H "X-Api-Key: $API_KEY" \
-F "file=@document.pdf"

List jobs

GET /v1/jobs

Returns a paginated list of jobs, ordered by most recent first. Supports cursor-based pagination, status filtering, and substring search on the file name.

Query parameters:

NameTypeDescription
pageSizeintegerItems per page (1–100). Defaults to 20.
cursorstringPagination cursor returned in nextCursor on a previous response.
statusJobStatusFilter by job status.
createdBystringFilter by creator user ID.
reviewedBystringFilter by reviewer user ID.
fileNamestringCase-insensitive substring search on the file name.
sortByJobSortFieldSort field. Defaults to createdAt.
sortDirectionSortDirectionSort direction. Defaults to desc.

ResponseJobSummaryResponsePaginatedResponse.

Example:

curl "http://localhost:9983/v1/jobs?status=readyForReview&pageSize=50" \
-H "X-Api-Key: $API_KEY"

Get a job

GET /v1/jobs/{id}

Returns the full details of a job, including the detection result when available.

Path parameters:

NameTypeDescription
idstring (UUID)The job ID.

ResponseJobResponse.

Status codes:

CodeMeaning
200The job was found.
404No job with the given id exists.

Example:

curl "http://localhost:9983/v1/jobs/$JOB_ID" \
-H "X-Api-Key: $API_KEY"

Start redaction for a job

POST /v1/jobs/{id}/redaction

Submits the reviewed list of entities to redact and starts the redaction step. The job must be in readyForReview.

Path parameters:

NameTypeDescription
idstring (UUID)The job ID.

Request bodyRedactionInput.

ResponseJobResponse, with status updated to redactionInProgress.

Status codes:

CodeMeaning
200Redaction was started.
404No job with the given id exists.
409The job isn’t in readyForReview.

Example:

curl -X POST "http://localhost:9983/v1/jobs/$JOB_ID/redaction" \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"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}
}]
}
]
}'

Download a job file

GET /v1/jobs/{id}/files/{fileType}

Downloads one of the files associated with a job: the original PDF, the FDF detection annotations, or the redacted output PDF.

Path parameters:

NameTypeDescription
idstring (UUID)The job ID.
fileTypeJobFileTypeWhich file to download.

Response — the file bytes (application/pdf or application/fdf).

Status codes:

CodeMeaning
200The file was returned.
404The job or the requested file type doesn’t exist.
502The Orchestrator couldn’t fetch the file from the Manager.

Example:

curl "http://localhost:9983/v1/jobs/$JOB_ID/files/redactedPdf" \
-H "X-Api-Key: $API_KEY" \
--output redacted.pdf

Schemas

JobResponse schema

FieldTypeDescription
idstring (UUID)Job identifier.
fileNamestringOriginal file name of the uploaded PDF.
statusJobStatusCurrent job status.
createdByUserInfoResponseThe user that created the job.
reviewedByUserInfoResponseThe user that submitted the redaction list. Set after redaction starts.
createdAtstring (UTC date-time)When the job was created.
updatedAtstring (UTC date-time)When the job was last updated.
pdfExpiresAtstring (UTC date-time)When the uploaded PDF expires. After this point, the job moves to expired.
fdfExpiresAtstring (UTC date-time)When the detection result (FDF) expires. Set once detection completes.
redactedPdfExpiresAtstring (UTC date-time)When the redacted PDF expires. Set once redaction completes.
detectionResultDetectionResultDetected entities. Available once the job reaches readyForReview.

JobSummaryResponse schema

FieldTypeDescription
idstring (UUID)Job identifier.
fileNamestringOriginal file name of the uploaded PDF.
statusJobStatusCurrent job status.
createdByUserInfoResponseThe user that created the job.
reviewedByUserInfoResponseThe user that submitted the redaction list.
createdAtstring (UTC date-time)When the job was created.
updatedAtstring (UTC date-time)When the job was last updated.
pdfExpiresAtstring (UTC date-time)When the uploaded PDF expires. After this point, the job moves to expired.
fdfExpiresAtstring (UTC date-time)When the detection result (FDF) expires. Set once detection completes.
redactedPdfExpiresAtstring (UTC date-time)When the redacted PDF expires. Set once redaction completes.

JobSummaryResponsePaginatedResponse schema

FieldTypeDescription
itemsarray of JobSummaryResponsePage of jobs.
pageSizeintegerPage size that was applied.
totalCountintegerTotal number of jobs matching the query.
nextCursorstringCursor to pass on the next call. Absent when there are no more pages.
hasNextPagebooleanWhether more pages are available.

RedactionInput schema

FieldTypeDescription
redactionsarray of RedactionEntityDtoEntities to redact.

RedactionEntityDto schema

FieldTypeDescription
pageIndexintegerZero-based page index where the entity appears.
textstringThe matched text. Required.
labelstringThe entity type, for example EMAIL_ADDRESS or PERSON. Required.
scorenumberConfidence score between 0 and 1.
quadrilateralsarray of QuadrilateralDtoOn-page bounding regions for the entity.

QuadrilateralDto schema

All four corners are required. Quadrilaterals can describe rotated or skewed text regions, not only axis-aligned rectangles.

FieldTypeDescription
bottomLeftPointDtoBottom-left corner.
bottomRightPointDtoBottom-right corner.
topRightPointDtoTop-right corner.
topLeftPointDtoTop-left corner.

PointDto schema

FieldTypeDescription
xnumberX coordinate in PDF user-space points.
ynumberY coordinate in PDF user-space points.

DetectionResult schema

FieldTypeDescription
redactionsarray of RedactionEntityDtoDetected entities returned by the detection step.

UserInfoResponse schema

FieldTypeDescription
userIdstringUser identifier.
emailstringUser’s email address.
fullNamestringUser’s full name.
isActivebooleanWhether the user account is active.

JobStatus enum

ValueDescription
createdThe job is registered. Detection hasn’t started yet.
detectionInProgressDetection is running.
readyForReviewDetection is complete. The redaction list is ready for review.
redactionInProgressRedaction is running.
finishedRedaction is complete.
expiredThe job has expired.
failedThe job failed.

JobFileType enum

ValueDescription
pdfThe original uploaded PDF.
fdfThe FDF file produced by detection.
redactedPdfThe redacted PDF, available once the job is finished.

JobSortField enum

ValueDescription
createdAtSort by creation time.
updatedAtSort by last update time.

SortDirection enum

ValueDescription
ascAscending.
descDescending.