re-doc
Try for free
OverviewPage 1 of 5
Developers · REST API

Document anonymization API

Add document anonymization to your own workflow with a REST API. Upload a PDF, Word file, text file or scan, and Re-Doc finds the personal and health information in it, then redacts it or replaces it with realistic synthetic data while keeping the original layout. Three calls: upload, poll, download.

Try interactive demo
Overview

What the document anonymization API does

Two anonymization modes

Synthetic replacement for text-searchable PDF, DOCX and TXT: names, dates, IDs, addresses and contact details are replaced with consistent synthetic values, and the output keeps the same format and layout.

Redaction for scanned PDFs, images (PNG, JPG, TIFF, WebP, BMP, GIF) and DOCX: sensitive text is read with OCR and permanently blacked out.

Multiple data types (Pro and higher) for a DOCX with text and images: text is replaced and logos, stamps and signatures inside images are redacted in one pass.

What it detects

Personal and health identifiers that appear as text: names, dates, addresses, phone numbers, emails, ID and account numbers and medical record numbers. Add your own entity types with an optional custom prompt.

Processing many documents

One file per request, up to 50 MB (5 MB for TXT). Send requests in parallel from your own job queue; each upload returns a session ID to poll. Check page usage with GET /api/v1/usage/check.

Security and deployment

All calls use HTTPS with bearer API keys. Documents and outputs are typically kept up to 30 days and then deleted, and are not used to train Re-Doc's own models (see the privacy policy). On-premise deployment is available on request, so documents stay on your infrastructure.

Access

The API is included on paid plans. Try the same processing free in the web app (first 10 pages).

3 simple steps

Quick start

Include your API key in all requests: Authorization: Bearer re-doc-xxx...
STEP 01

Upload document

POST /api/v1/processing/upload
file: document.pdf
STEP 02

Poll status

GET /api/v1/processing/
    status/{session_id}
STEP 03

Download result

GET /api/v1/processing/
    download/{session_id}/converted/0
At scale

REST API

Processing thousands of documents? Our REST API handles batch redaction, text replacement, and multiple data types at scale.

Available

Redaction API

Upload a scanned PDF, image or DOCX. We find the sensitive data and black it out.

POST /api/v1/processing/upload
Available

Text Replacement API

Upload a native PDF, DOCX or TXT. We replace sensitive values with synthetic data that looks real and keep your layout.

POST /api/v1/text-replacement/process-searchable-pdf
Available

Download API

Get your processed document back. Text replacement keeps your format: PDF stays PDF, DOCX stays DOCX, TXT stays TXT. Redaction returns a PDF, plus a DOCX for DOCX uploads.

GET /api/v1/processing/download/{session_id}/converted/0
Available

Multiple Data Types API

Send a DOCX that mixes text and images. We replace the sensitive text and redact the sensitive parts of embedded images in one pass, keeping your layout intact.

POST /api/v1/hybrid/upload
API keysPage 2 of 5
Base URL: https://re-doc.com

API keys

Your API key is your access pass. Create one, add it to your requests, and you're ready to process documents programmatically.

Sign in to manage API keys

Create API keys to access Re-Doc programmatically.

Note: API access requires a paid plan (Starter or higher).

Sign in with Google
Usage examplecurl
curl -X POST https://re-doc.com/api/v1/processing/upload \
  -H "Authorization: Bearer re-doc-your-api-key" \
  -F "file=@document.pdf" \
  -F "lang=en" \
  -F "document_type=general"
Redact a TXT file with [PERSON_NAME] labelscurl
curl -X POST https://re-doc.com/api/v1/text-replacement/process-searchable-pdf \
  -H "Authorization: Bearer re-doc-your-api-key" \
  -F "file=@notes.txt" \
  -F "txt_mode=redact" \
  -F "txt_redact_style=tag"
ParametersPage 3 of 5
Most are optional

API parameters guide

Upload a file and we'll figure out the rest. But if you need control, here's what you can tweak.

ParameterRequiredDescription
fileYesThe document to process, one file per request, up to 50MB. Redaction: scanned PDF, DOCX, PNG, JPG, TIFF, WebP, BMP, GIF. Text replacement: text-searchable PDF, DOCX, TXT. Multiple data types: DOCX.
langNoLanguage code for OCR processing. Defaults to "en" (English). Common values: en, es, fr, de, it, pt, zh, ja, ko
document_typeNoDocument category to optimize entity detection patterns. Options: "general", "financial", "medical", "legal"
custom_promptNoCustom instructions to focus entity detection on specific information types. Example: "Focus on social security numbers and dates of birth"
txt_modeNoTXT files only. "replace" (default) swaps sensitive values for realistic synthetic data; "redact" removes them and marks where they were.
txt_redact_styleNoUsed when txt_mode is "redact". "tag" (default) writes labels such as [PERSON_NAME] or [EMAIL]; "block" writes ████ blocks.

What happens behind the scenes

01

Text extraction

Our OCR reads every character, even from tilted scans and faded prints. Works across 80+ languages.

02

Entity detection

The tool finds names, Aadhaar numbers, account details, and whatever else you tell it to look for.

03

Smart redaction

Redaction marks go exactly where they should. Your document comes back in the same format you sent it.

API referencePage 4 of 5
Endpoints

API documentation and reference

POST/api/v1/processing/uploadAuth requiredUpload a document for redaction (black-box masking of sensitive data)

Headers

Content-Type: multipart/form-data

Request body

Upload a scanned PDF, an image (PNG, JPG, TIFF, WebP, BMP, GIF) or a DOCX. One file per request, up to 50MB. The API uses OCR to read the text and places black boxes over detected PII. Native PDFs, DOCX and TXT files that should keep their text can use the text replacement endpoint instead.

{
  "file": "document.pdf, document.docx, or image.png (File) - Required",
  "lang": "en (string) - Language code for OCR (default: \"en\")",
  "document_type": "general (string) - Document type: \"general\", \"financial\", \"medical\", \"legal\" (default: \"general\")",
  "custom_prompt": "Detect PII in legal documents (string, optional) - Custom prompt for specific entity detection"
}

Responses

200Document uploaded and processing started
{
  "session_id": "91f53136-a734-4fb9-a8b8-482d1de14035",
  "status": "pending",
  "message": "Document uploaded successfully. Processing started.",
  "file_name": "document.pdf",
  "estimated_time": 120
}
400Bad request - unsupported file type
{
  "detail": "File type not supported: text/plain"
}
413File too large
{
  "detail": "File too large. Maximum size: 50.0MB"
}
GET/api/v1/processing/status/{session_id}Auth requiredPoll the processing status of a redaction job until status is "completed" or "failed"

Responses

200Processing status retrieved successfully
{
  "session_id": "91f53136-a734-4fb9-a8b8-482d1de14035",
  "status": "completed",
  "progress": 100,
  "message": "Status: completed",
  "error_message": null,
  "created_at": "2026-10-01T16:26:13",
  "updated_at": "2026-10-01T16:26:42"
}
GET/api/v1/processing/results/{session_id}Auth requiredGet the results of a completed redaction job: counts and the list of output files

Responses

200Processing results retrieved successfully
{
  "session_id": "91f53136-a734-4fb9-a8b8-482d1de14035",
  "status": "completed",
  "file_name": "document.pdf",
  "total_images_processed": 1,
  "total_entities_found": 12,
  "total_pii_entities": 12,
  "redacted_images": [
    "…/page-1_redacted.png"
  ],
  "converted_documents": [
    "…/document_redacted.pdf"
  ],
  "created_at": "2026-10-01T16:26:13",
  "completed_at": "2026-10-01T16:26:42"
}
400Processing not completed
{
  "detail": "Processing not completed"
}
404Session not found
{
  "detail": "Processing session not found"
}
Limits & supportPage 5 of 5
BASE URLhttps://re-doc.com

All requests go here. HTTPS only, no exceptions.

USAGE LIMITS
Free (web app only, no API)10 pages total
Starter · $11/mo500 pages/month
Pro · $49/mo3,000 pages/month
Business · $149/mo9,000 pages/month
EnterpriseCustom, contact us

Extra pages on Pro and Business: $0.02 each, after approval (contact us first). Multiple data types: Pro and higher. See pricing.

Need more? Email support@re-doc.com

Frequently asked questions

What is a document anonymization API?

A service you call from your own code to find personal data in documents and remove or replace it, so files can be shared, analysed or used for AI without exposing people.

Which file types does the Re-Doc API accept?

PDF, DOCX and TXT for synthetic replacement; scanned PDFs, images (PNG, JPG, TIFF, WebP, BMP, GIF) and DOCX for redaction. Files can be up to 50 MB (5 MB for TXT).

Can the API keep the original layout?

Yes. Synthetic replacement returns the same format with the layout kept. Redaction returns a PDF, plus a DOCX for DOCX uploads.

Is there a batch endpoint?

Each request takes one file. To process many documents, run requests in parallel from your own queue and poll each session.

Can it run on our own servers?

On-premise deployment is available on request through an enterprise discussion. Contact our team to discuss your requirements.

Stuck somewhere?

Integration issues, edge cases, or just want to talk architecture? We're here.