apyhub
Back

Rotate PDF Pages API

What it does

PDF Page Rotator lets you rotate one or more pages in a PDF and download the updated file. Send the PDF as binary data, plus a rotations JSON object that maps 1-based page numbers to degrees such as 90, 180, or 270.

Use it when a scan was saved sideways, when a few pages were imported with the wrong orientation, or when you need to normalize documents before sharing or archiving them. You control exactly which pages are changed, so a single request can fix an entire file or just the pages that need adjustment.

The input is a PDF file up to 20 MB and a rotation map in the request body. The response is the rotated PDF as a binary file, ready to store, forward, or send into the next step of your document workflow.

If your application handles uploads, document cleanup, or PDF preparation, PDF Page Rotator gives you a simple transformation step without requiring a desktop PDF editor.

POST
Rotate PDF pages
https://api.eu.apyhub.com/freedailypro/rotate-pdf-pages-api/rotate

QUICKSTART

GUIDE

Quickstart

Rotate selected pages in a PDF by uploading the file and a page-to-degrees mapping.

curl -X POST "https://api.eu.apyhub.com/freedailypro/rotate-pdf-pages-api/rotate" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.pdf" \
  -F "rotations={\"1\":90,\"2\":180}"

What you'll get back

Returns a binary file response (string with format: binary), which is the rotated 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 object: 1-based page number to degrees, for example {"1":90,"2":180}

About this endpoint

What it does

Rotates one or more pages in an uploaded PDF according to the page-to-degrees mapping you provide, and returns the resulting PDF as a binary file.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe PDF file to process. Up to 20 MB.
rotationsStringYesJSON object mapping 1-based page numbers to rotation degrees, for example {"1":90,"2":180}.

Response

Returns the rotated PDF as a binary file.

ParameterTypeMandatoryDescription
binaryStringYesThe response body is the processed PDF file.

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.