Insert PDF Pages

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

Inserts selected pages from one or more source PDFs before or after specified pages in an original PDF and makes the modified PDF available for download.


Source Mapping: Provide one input_options item for each source_file, in the same order. When one source PDF is provided, input_options may be either a single object or a one-item array.

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/pages/insert \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: multipart/form-data' \
  -F 'original_file=@file_path' \
  -F 'source_file=appendix-a.pdf' \
  -F 'source_file=appendix-b.pdf' \
  -F 'input_options=[
  {
    "position": "after",
    "page_number": "3",
    "page_ranges": [
      "1,3-5"
    ]
  },
  {
    "position": "before",
    "page_number": "8",
    "page_ranges": [
      "all"
    ]
  }
]' \
  -F 'output_settings={
  "name": "quarterly-review-with-appendices.pdf"
}'

Request Body

multipart/form-data
original_filebinary(Required)

The original PDF to modify, 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 with an area greater than 2,400 square inches. Its filename must not exceed 255 characters. Password-protected, corrupted, and empty PDFs are not supported. Supported formats: pdf.

Example
quarterly-review.pdf
source_filearray[binary](Required)

The PDFs containing the pages to insert, uploaded directly or imported from publicly accessible URLs. Provide between 1 and 10 files. Each file must be no larger than 50 MB, contain no more than 400 pages, and have no page with an area greater than 2,400 square inches. Each filename must not exceed 255 characters. Password-protected, corrupted, and empty PDFs are not supported. Supported formats: pdf.

Example
[
  "appendix-a.pdf",
  "appendix-b.pdf"
]
Range :[1 .. 10][1 .. 10]
input_optionsJSON Array[object](Required)

The page-insertion instructions. Provide between 1 and 10 items.

Example
[
  {
    "position": "after",
    "page_number": "3",
    "page_ranges": [
      "1,3-5"
    ]
  },
  {
    "position": "before",
    "page_number": "8",
    "page_ranges": [
      "all"
    ]
  }
]
Range :[1 .. 10][1 .. 10]
Show Sub-Attributes
positionstring(Required)

Controls whether the selected source pages are inserted before or after the target page.

Example
after
Allowed Values :
Show Values ▾
beforeCopied!
afterCopied!
Copied!Copy all as JSON Array
Maximum Length :1010Copied!
page_numberstring(Required)

The one-based target page in the original PDF. The page must exist in the original PDF.

Example
3
Maximum Length :100100Copied!
page_rangesarray[string](Optional)

Up to 10 expressions selecting pages from the corresponding source PDF. Every numeric page must exist in that PDF. If omitted or empty, all source pages are inserted.

Example
[
  "1,3-5"
]
Maximum Length :100100Copied!
Range :[0 .. 10][0 .. 10]
output_settingsJSON Object(Required)

Configures the modified PDF's filename.

Example
{
  "name": "quarterly-review-with-appendices.pdf"
}
Show Sub-Attributes
namestring(Required)

The filename for the modified PDF. A .pdf extension is appended when the name does not already end with one.

Example
quarterly-review-with-appendices.pdf
Maximum Length :255255Copied!

Body Parameters

Copied!
// Note: payload contains multiple type attributes

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

// type: array[file]
source_file = [
  "appendix-a.pdf",
  "appendix-b.pdf"
]

// type: array
input_options = [
  {
    "position": "after",
    "page_number": "3",
    "page_ranges": [
      "1,3-5"
    ]
  },
  {
    "position": "before",
    "page_number": "8",
    "page_ranges": [
      "all"
    ]
  }
]

// type: object
output_settings = {
  "name": "quarterly-review-with-appendices.pdf"
}
▼ Show full

Response Example

200
Copied!
  {
    "status": "inprogress",
    "status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/pages/insert/job/4b97319d5c6a240ef86513782b7e1439fb92cd837ab864416fda91417e926bc8"
  }
                
▼ 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.