Redact PDF Content

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Permanently blacks out selected text, regions, images, or entire pages of a PDF, and makes the redacted PDF available for download.


Mask Types: Provide query when type is text, or rect when type is rect. An entry missing its field is skipped rather than failing the request.

Endpoint

OAuth Scope

ZohoWriter.pdfEditor.ALLCopied!

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/pdfeditor/api/v1/pdf/content/redact \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: multipart/form-data' \
  -F 'file=@file_path' \
  -F 'input_options={
  "mask_info": [
    {
      "type": "text",
      "query": "Confidential,Internal Use Only",
      "page_range": "1-3"
    },
    {
      "type": "rect",
      "rect": {
        "top": "100px",
        "left": "100px",
        "width": "200px",
        "height": "50px"
      },
      "page_range": "2"
    }
  ]
}' \
  -F 'password=OpenSesame123'

Request Body

multipart/form-data
filebinary(Required)

The source PDF to redact, uploaded directly or imported from a publicly accessible URL. The file must be no larger than 50 MB, contain no more than 400 pages, and have no page larger than 2,400 square inches. Its filename must not exceed 255 characters. Supported formats: pdf.

Example
quarterly-review.pdf
input_optionsJSON Object(Required)

Configures the redactions applied to the PDF.

Example
{
  "mask_info": [
    {
      "type": "text",
      "query": "Confidential,Internal Use Only",
      "page_range": "1-3"
    },
    {
      "type": "rect",
      "rect": {
        "top": "100px",
        "left": "100px",
        "width": "200px",
        "height": "50px"
      },
      "page_range": "2"
    }
  ]
}
Show Sub-Attributes
mask_infoJSON Array[object](Required)

One or more redaction instructions applied to the PDF.

Example
[
  {
    "type": "text",
    "query": "Confidential,Internal Use Only",
    "page_range": "1-3"
  },
  {
    "type": "rect",
    "rect": {
      "top": "100px",
      "left": "100px",
      "width": "200px",
      "height": "50px"
    },
    "page_range": "2"
  }
]
Range :[1 .. ∞][1 .. ∞]
Show Sub-Attributes
typestring(Required)

The kind of redaction this entry performs. text redacts matches of query, rect redacts the box in rect, image blacks out every image on the selected pages, and page blacks out the entire page content.

Example
text
Allowed Values :
Show Values ▾
textCopied!
rectCopied!
imageCopied!
pageCopied!
Copied!Copy all as JSON Array
Maximum Length :1010Copied!
querystring(Optional)

Comma-separated search terms to redact wherever found on each page in page_range. Each match is blacked out and the underlying text removed so it can't be searched or extracted.

Example
Confidential,Internal Use Only
Maximum Length :1000010000Copied!
rectJSON Object(Optional)

The explicit coordinate box to redact on each page in page_range.

Example
{
  "top": "100px",
  "left": "100px",
  "width": "200px",
  "height": "50px"
}
Show Sub-Attributes
topstring(Required)

The redaction box's distance from the top of the page, suffixed with px. The value is applied as a PDF point (1/72 in), not a true screen pixel.

Example
100px
Maximum Length :100100Copied!
leftstring(Required)

The redaction box's distance from the left of the page, suffixed with px. The value is applied as a PDF point (1/72 in), not a true screen pixel.

Example
100px
Maximum Length :100100Copied!
widthstring(Required)

The redaction box's width, suffixed with px. The value is applied as a PDF point (1/72 in), not a true screen pixel.

Example
200px
Maximum Length :100100Copied!
heightstring(Required)

The redaction box's height, suffixed with px. The value is applied as a PDF point (1/72 in), not a true screen pixel.

Example
50px
Maximum Length :100100Copied!
page_rangestring(Optional)

The pages this entry applies to. Accepts all, odd, even, or a comma-separated list of page numbers and ranges (e.g. 1,3-5).

Example
1-3
Default Value :allallCopied!
Maximum Length :100100Copied!
passwordstring(Optional)

The password to unlock the source PDF, if it is password-protected.

Example
OpenSesame123
Maximum Length :255255Copied!

Body Parameters

Copied!
// Note: payload contains multiple type attributes

// type: file
file = quarterly-review.pdf

// type: object
input_options = {
  "mask_info": [
    {
      "type": "text",
      "query": "Confidential,Internal Use Only",
      "page_range": "1-3"
    },
    {
      "type": "rect",
      "rect": {
        "top": "100px",
        "left": "100px",
        "width": "200px",
        "height": "50px"
      },
      "page_range": "2"
    }
  ]
}

// type: string
password = OpenSesame123
▼ Show full

Response Example

200
Copied!
  {
    "status": "inprogress",
    "status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/content/redact/job/3f65c7592a741d98e46bf310cbe678f574a1d51fce306a8d9b6430217e538acd"
  }
                
▼ Show full

Rate Limits

Duration1 minute
Threshold50
Lock Period5 minutes 30 seconds
Duration1 hour
Threshold200
Lock Period15 minutes
Duration1 day
Threshold2000
Lock Period2 hours

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.