Organize PDF Pages

Organize PDF Pages API

File Tools

Reorder, rotate, delete and duplicate PDF pages by dragging thumbnails, add pages from other PDFs, and save. Works in your browser with no upload.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

20 requests per minute

Endpoints

1 endpoint available

Overview

Build a new PDF from a page list: reorder pages, rotate them, duplicate them, delete them (leave them out of the list), and combine pages from several PDFs.

The page list

The pages field is a JSON array. Each entry is either a page number of the first file (3) or an object {"file": 1, "page": 2, "rotate": 90}:

  • file: which uploaded PDF, numbered from 0 in the order sent. Default 0.
  • page: page number in that file, starting at 1.
  • rotate: extra clockwise rotation, 0, 90, 180 or 270. Default 0.

Example: [3, 1, {"page": 2, "rotate": 90}] puts page 3 first, then page 1, then page 2 turned a quarter turn, and drops every other page.

Limits

  • Up to 20 PDFs of 25 MB each, and at most 500 entries in the page list.
  • Pages that don't exist, password-protected or damaged PDFs return 422.

Endpoints

POST
https://opentools.ca/api/v1/tools/organize-pdf
Reorder, rotate, duplicate, delete and combine PDF pages

Request Body

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
file
file
OptionalOne PDF to organize. Send this or files.
files
file[]
OptionalSeveral PDFs (up to 20), numbered from 0 in the order sent. Used when file is not sent.
pages
string (JSON array)
Required
The output pages in order. Each entry is a 1-based page number of the first file, or {"file": number, "page": number, "rotate": 0|90|180|270}.

Response Example

The new PDF file (Content-Type: application/pdf, filename <name>-organized.pdf).

Error Codes

400
Bad Request - missing or invalid fields (see details)
401
Unauthorized - missing or invalid API key
403
Forbidden - API key inactive or expired, or request IP not allowed
413
Payload Too Large - a file is over 25 MB
415
Unsupported Media Type - a file is not a PDF
422
Unprocessable - a PDF is damaged or password-protected, or an entry points at a file or page that does not exist
429
Too Many Requests - more than 20 requests per minute for this key
500
Internal Server Error

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/organize-pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@scan.pdf" \
  -F 'pages=[3, 1, {"page": 2, "rotate": 90}]' \
  -o scan-organized.pdf

Ready to get started?

Create an API key to start using the Organize PDF Pages API.

Rather use it in your browser? Open the Organize PDF Pages