apyhub
Back

Reorder, rotate, remove or insert PDF pages

What it does

PDF Page Organizer lets you reorder, rotate, remove, or insert pages in a PDF and get a new PDF back. Send the original PDF file along with a pageSpecs JSON array that describes the page sequence you want.

Use pageSpecs to build the output from source pages, blank pages, and rotated pages. The input PDF is sent as file and can be up to 20 MB. The response is a binary PDF, so you can pass it straight into downstream storage, preview, or signing workflows.

Use this when you need to normalize incoming documents, remove cover pages, insert separators, or fix sideways scans before archiving. It is useful in document pipelines where page order matters, such as invoice bundles, reports, contracts, and case files.

Because the service works at the page level, you can precisely reshape a document without rasterizing or rebuilding it from scratch.

POST
Reorder, rotate, remove or insert PDF pages
https://api.eu.apyhub.com/freedailypro/reorder-rotate-remove--or-insert-pdf-pages/organize

QUICKSTART

GUIDE

Quickstart

Upload a PDF and a page-specs list to reorder, rotate, remove, or insert pages.

curl -X POST "https://api.eu.apyhub.com/freedailypro/reorder-rotate-remove--or-insert-pdf-pages/organize" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.pdf" \
  -F 'pageSpecs=[{"type":"source","index":0},{"type":"blank"},{"type":"source","index":2,"rotation":90}]'

What you'll get back

Returns a binary file containing the organized PDF document.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The PDF. Up to 20 MB.
JSON array, for example [{"type":"source","index":0},{"type":"blank"},{"type":"source","index":2,"rotation":90}]

About this endpoint

What it does

Reorders, rotates, removes, or inserts pages in a PDF you upload, then returns the modified PDF as a binary file. You provide the source PDF plus a pageSpecs JSON array that describes the new page arrangement.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe PDF file to organize. Binary upload. Up to 20 MB.
pageSpecsStringYesJSON array that defines the output pages, for example [{"type":"source","index":0},{"type":"blank"},{"type":"source","index":2,"rotation":90}].

Response

Returns a binary file containing the organized PDF. The response schema is a single binary payload, not a JSON object.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.