Skip to main content

PDF Tools API

PDF Redaction API

Apply deterministic redaction areas from review decisions, coordinates, or compliance workflows.

Credits

1 Credit / call

1 Credit per successful API request. Failed processing attempts are refunded automatically.

Pricing

1,000 Credits = $1

Every signed-in user receives 100 free API Credits each month.

Endpoint

/api/external/pdf-tools/pdf-redaction

Use your API Key in the x-api-key header.

Use case

Use it after a reviewer or detection system identifies regions that must be covered before a PDF is shared.

cURL example

curl -X POST https://itextmaster.com/api/external/pdf-tools/pdf-redaction \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'file=@input.pdf;type=application/pdf' \
  -F 'options={"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}' \
  --output redacted.pdf

Multipart example

curl -X POST https://itextmaster.com/api/external/pdf-tools/pdf-redaction \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'file=@input.pdf;type=application/pdf' \
  -F 'options={"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}' \
  --output redacted.pdf

JSON base64 example

curl -X POST https://itextmaster.com/api/external/pdf-tools/pdf-redaction \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "file": { "name": "input.pdf", "dataBase64": "JVBERi0xLjcK..." },
    "options": {"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}
  }' \
  --output redacted.pdf

Node.js example

import { writeFile } from 'node:fs/promises';

const response = await fetch('https://itextmaster.com/api/external/pdf-tools/pdf-redaction', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.ITEXTMASTER_API_KEY
  },
  body: JSON.stringify({
  file: { name: 'input.pdf', dataBase64: 'JVBERi0xLjcK...' },
  options: {"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}
})
});

if (!response.ok) {
  throw new Error(await response.text());
}

await writeFile('redacted.pdf', Buffer.from(await response.arrayBuffer()));

Python example

import os
import requests

response = requests.post(
    'https://itextmaster.com/api/external/pdf-tools/pdf-redaction',
    headers={
        'Content-Type': 'application/json',
        'x-api-key': os.environ['ITEXTMASTER_API_KEY'],
    },
    json={
        'file': {'name': 'input.pdf', 'dataBase64': 'JVBERi0xLjcK...'},
        'options': {'areas': [{'page': 1, 'x': 72, 'y': 120, 'width': 180, 'height': 36, 'replacementText': 'REDACTED'}], 'color': {'r': 0, 'g': 0, 'b': 0}}
    },
)
response.raise_for_status()

with open('redacted.pdf', 'wb') as f:
    f.write(response.content)

Error codes

401invalid_api_key

The x-api-key header is missing, invalid, or has been rotated.

402insufficient_credits

The account does not have enough API Credits for the request.

422pdf_tool_processing_failed

The file, options, or PDF structure could not be processed. Failed processing attempts are refunded automatically.

Limits

  • Requires one valid PDF file.
  • Coordinates use PDF points.
  • The current redaction processor draws opaque redaction areas; validate output for your compliance requirements.

Response headers

redacted.pdf with X-Credits-Charged: 1 and X-Credit-Balance response headers.

Content-Type
The MIME type of the generated file, usually application/pdf or application/zip.
Content-Disposition
Attachment filename for the generated output.
X-Credits-Charged
Credits charged for the successful request.
X-Credit-Balance
Remaining API Credit balance after the request.

FAQ

How much does the PDF Redaction API cost?

Each successful PDF Redaction API request uses 1 Credit. 1,000 Credits cost $1, and every signed-in user receives 100 free API Credits each month.

What happens if processing fails?

Failed processing attempts are refunded automatically, and the API returns an error response you can log or retry.

Should I call this API from the browser?

No. Keep API Keys server-side and call the endpoint from your backend, queue, or automation job when you need to pdf redaction.

Start with 100 free API Credits

Create an API Key, test PDF Redaction API, and buy more Credits only when automation volume grows.