Skip to Content
API ReferenceBatch Processing

Batch Processing

Submit multiple files for redaction in a single request. Each file in the batch creates an individual job that can be tracked independently.

Limits

  • Maximum 100 URIs per batch request.
  • Each URI creates a separate async job.

POST /batch/redact

Submit a batch of files for redaction.

Request Body

FieldTypeRequiredDescription
input_urisstring[]YesList of file URIs to redact (max 100)
policy_idstringNoApply a saved redaction policy to all files

Response

FieldTypeDescription
batch_idstringUnique identifier for the batch
job_idsstring[]List of individual job IDs created
totalnumberTotal number of jobs in the batch
completednumberNumber of completed jobs (initially 0)
failednumberNumber of failed jobs (initially 0)

Example

curl -X POST https://api.pii-redactor.dev/api/v1/batch/redact \ -H "X-API-Key: pk_live_abc123" \ -H "Content-Type: application/json" \ -d '{ "input_uris": [ "s3://my-bucket/docs/contract-001.pdf", "s3://my-bucket/docs/contract-002.pdf", "s3://my-bucket/docs/contract-003.pdf" ], "policy_id": "pol_hipaa_standard" }'
{ "batch_id": "batch_a1b2c3d4", "job_ids": [ "job_f1e2d3c4", "job_a5b6c7d8", "job_e9f0a1b2" ], "total": 3, "completed": 0, "failed": 0 }

GET /batch/{batch_id}

Get the status of a batch and its constituent jobs.

Response

FieldTypeDescription
batch_idstringBatch identifier
job_idsstring[]List of job IDs in the batch
totalnumberTotal number of jobs
completednumberNumber of completed jobs
failednumberNumber of failed jobs

Example

curl https://api.pii-redactor.dev/api/v1/batch/batch_a1b2c3d4 \ -H "X-API-Key: pk_live_abc123"
{ "batch_id": "batch_a1b2c3d4", "job_ids": [ "job_f1e2d3c4", "job_a5b6c7d8", "job_e9f0a1b2" ], "total": 3, "completed": 2, "failed": 0 }

To get details on individual jobs within the batch, use GET /jobs/{job_id} for each job ID. See Jobs for details.