Replace Attachments in PDF
Replaces existing embedded attachments in a PDF with new files, and makes the modified PDF available for download.
Attachment Pairing:input_options.target_files and replace_files are paired by position — the first target_files entry is replaced by the first replace_files upload, and so on. If the two differ in length, only pairs up to the shorter one are applied.
Endpoint
OAuth Scope
curl --request POST \
--url https://www.zohoapis.com/pdfeditor/api/v1/pdf/attachment/replace \
--header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
--header 'content-type: multipart/form-data' \
-F 'file=@file_path' \
-F 'replace_files=updated-signed-form.pdf' \
-F 'input_options={
"target_files": [
"signed-form.pdf"
]
}' \
-F 'password=OpenSesame123'Request Body
multipart/form-dataThe source PDF whose attachments are replaced, 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.
One to 10 replacement files, uploaded directly — URL import is not supported for this field. Each file must be no larger than 20 MB and its filename must not exceed 255 characters. Each new attachment takes its replacement file's own uploaded filename, not its target's former name. Supported formats: pdf, jpg, jpeg, png.
[
"updated-signed-form.pdf"
]Configures which attachments are replaced.
{
"target_files": [
"signed-form.pdf"
]
}Show Sub-Attributes
The existing attachments to replace, by filename. Each named file must already exist as an embedded attachment, or the request fails.
[
"signed-form.pdf"
]The password to unlock the source PDF, if it is password-protected.
// Note: payload contains multiple type attributes
// type: file
file = quarterly-review.pdf
// type: array[file]
replace_files = [
"updated-signed-form.pdf"
]
// type: object
input_options = {
"target_files": [
"signed-form.pdf"
]
}
// type: string
password = OpenSesame123 {
"status": "inprogress",
"status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/attachment/replace/job/3f65c7592a741d98e46bf310cbe678f574a1d51fce306a8d9b6430217e538acd"
}
Rate Limits
Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.
© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.