Redact Content
Purpose
This API allows you to mask or redact selected content in a PDF document, including text, rectangles, images, and entire pages.
Quick Reference
| Property | Value |
|---|---|
| Method | POST |
| Request URL (Download) | https://{zohoapis_domain}/pdfeditor/api/v1/pdf/content/redact |
| Request URL (Store) | https://{zohoapis_domain}/pdfeditor/api/v1/pdf/content/redact/store |
| Request URL (Callback) | https://{zohoapis_domain}/pdfeditor/api/v1/pdf/content/redact/callback |
Body Parameters
| Parameter | Value | Mandatory/Optional | Description |
|---|---|---|---|
| file | File or String | Mandatory | Upload the PDF file from your local drive or desktop. If the PDF file is available via a publicly accessible web URL, you can provide the URL using the same parameter. |
| input_options | { "mask_info": [ { ... } ] } | Mandatory | Specify the redaction configuration using the mask_info array. Multiple redaction types can be combined in a single request. |
| password | String | Optional | If the input PDF is password protected, specify the password to unlock it. |
| output_settings | { "name": "<document_name>", "folder_id": "<folder_id>", "overwrite_existing_file": true | false } | Mandatory for store variant | name – Specify the name for the redacted PDF document. folder_id – Specify the ID of the WorkDrive folder in which to store the output file. overwrite_existing_file(optional) – Set to true to overwrite an existing file with the same name in the folder. |
| callback | { "invoke_url": "<callback_url>", "timeout": 60, "retry_interval": 60, "headers": { "header_name": "header_value" }, "http_method_type": "post" } | Mandatory for callback variant | Specify the callback delivery configuration for the /callback variant. |
mask_info Parameters
| Parameter | Data Type | Possible Values | Default Value |
|---|---|---|---|
| type | String | text, rect, image, page | – |
| query | String | Text content to redact. Applicable for type = text. | – |
| rect | JSON Object | Rectangle coordinates: top, left, width, height. Applicable for type = rect. | – |
| page_range | String | all, 1-5, 1,3,5, odd, even | all except for full page redaction where a value is required |
callback Parameters
| Parameter | Data Type | Possible Values | Default Value |
|---|---|---|---|
| invoke_url | String | URL. Maximum length: 300 characters. | – |
| timeout | Integer | 10 to 120 seconds | 60 seconds |
| retry_interval | Integer | 60 to 28800 seconds | 60 seconds |
| headers | JSON Object | Maximum 10 keys. Allowed characters for keys: alphabets, numbers, hyphen, underscore, dot. Maximum key length: 100. Maximum value length: 2500. | – |
| http_method_type | String | put, post | post |
Notes and Limits
- The maximum file size allowed for the input PDF is 50 MB.
- The mask_info array must contain at least one redaction object.
- The store variant requires a Zoho WorkDrive account.
- To use the download or callback variants, an OAuth token should be generated with the following scopes: ZohoWriter.pdfEditor.ALL
- To use the store variant, an OAuth token should be generated with the following scopes: ZohoWriter.pdfEditor.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL
Possible Errors
Refer to the following pages for the list of possible errors for this API:
Download Variant Sample Request
Copiedcurl --location --request POST "https://{zohoapis_domain}/pdfeditor/api/v1/pdf/content/redact" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@/Users/username/Documents/Original.pdf' \
--form 'password="pdf_password"' \
--form 'input_options={"mask_info": [{"type": "text", "query": "confidential data", "page_range": "1,3,5"}]}'Store Variant Sample Request
Copiedcurl --location --request POST "https://{zohoapis_domain}/pdfeditor/api/v1/pdf/content/redact/store" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@/Users/username/Documents/Original.pdf' \
--form 'password="pdf_password"' \
--form 'input_options={"mask_info": [{"type": "text", "query": "confidential data", "page_range": "1,3,5"}]}' \
--form 'output_settings={"name": "Redacted_Document.pdf", "folder_id": "<folder_id>", "overwrite_existing_file": true}'Callback Variant Sample Request
Copiedcurl --location --request POST "https://{zohoapis_domain}/pdfeditor/api/v1/pdf/content/redact/callback" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@/Users/username/Documents/Original.pdf' \
--form 'password="pdf_password"' \
--form 'input_options={"mask_info": [{"type": "text", "query": "confidential data", "page_range": "1,3,5"}]}' \
--form 'callback={"invoke_url": "https://www.example.com/v1/api/callback/savecallback", "timeout": 120, "retry_interval": 60, "http_method_type": "post"}'Download Variant Sample Response
Copied{
"status": "inprogress",
"status_check_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/content/redact/job/e9051e30fd7f0093cba4247d1f831e03e945a127bde429ed6e9ef3a703b15a6060b830256c650cb88a3f687773c33076"
}Download Variant Success Response
Copied{
"status": "success",
"download_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/content/redact/download/f8c1e4a7d0b3e6f9c2d5a8b1e4f7a0d3",
"response_generated_time": 1780912499331
}Store Variant Sample Response
Copied{
"status": "inprogress",
"status_check_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/content/redact/job/2ae74c719bdb14ed9941fe351ade742439bf75ab0fb8fdf0a68b57a7a60cbd54ab7cb7bea5d0fafb4d2560a90331aaf8",
"document_id": "hf3e60435a4c7576f4d21a16cfc292a4c64a9",
"document_url": "https://workdrive.zoho.com/file/hf3e60435a4c7576f4d21a16cfc292a4c64a9"
}Store Variant Success Response
Copied{
"status": "success",
"document_id": "hf3e60435a4c7576f4d21a16cfc292a4c64a9",
"document_url": "https://workdrive.zoho.com/file/hf3e60435a4c7576f4d21a16cfc292a4c64a9",
"response_generated_time": 1780912529135
}Callback Variant Sample Response
Copied{
"status": "inprogress",
"status_check_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/content/redact/job/1d358192770dc68d173ca34b8f7c9dcb121ad0bf3d6307b7387be79e76dacf586f9d62cd253c26020f8c3dcf79d51b6b"
}Callback Variant Success Response
Copied{
"status": "success",
"callback_response": {
"invoked_time": 1780912655806,
"http_status_code": 200,
"message": {
"download_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/content/redact/download/f8c1e4a7d0b3e6f9c2d5a8b1e4f7a0d3",
"response_generated_time": 1780912656237
}
}
}