---
title: "Rotate pages of a PDF"
method: POST
path: "/v1/pdf-tools/rotate"
tags: ["PDF Tools"]
---

# Rotate pages of a PDF

`POST /v1/pdf-tools/rotate`

Rotate every page by the same angle (`rotation`), or apply a per-page rotation map (`page_rotations`). Rotations are cumulative with the page's existing rotation. Allowed angles: 0, 90, 180, 270.

**Credits:** 1 credit per call.

## Request body

- RotatePdfRequest
  - `export_type` 'url' | 'binary'
  - `expiration` integer — URL expiration in seconds. Min 60, max 604800. Only applies to `url` export type.
  - `filename` string, nullable — Custom filename (without `.pdf`). Defaults to a generic name.
  - `pdf_url` string, nullable — Public HTTPS URL to download the PDF from
  - `pdf_base64` string, nullable — PDF file encoded as a base64 string
  - `rotation` integer, nullable — Rotation in degrees applied to every page. Must be 0, 90, 180 or 270. Cumulative with the page's existing rotation.
  - `page_rotations` object, nullable — 1-indexed map of page number to rotation in degrees (0/90/180/270). Cumulative with the page's existing rotation. Use this OR `rotation`, not both.

## Response `200`

Successful Response

- PdfToolsResponse
  - `url` string, required — Signed URL to download the PDF
  - `filename` string, required — Filename of the resulting PDF
  - `credits_remaining` integer, required — Remaining credits after this request
  - `expires_in` integer, required — Seconds until the signed URL expires

## Other responses

- `402` — Insufficient credits
- `422` — Invalid input (bad PDF, out-of-bounds page, etc.)
- `429` — Rate limit exceeded

---

[API](https://skmtc.net/pdftemplateapi/apis/templatefox-api.md) · [All operations](https://skmtc.net/pdftemplateapi/apis/templatefox-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pdftemplateapi/templatefox-api/revisions/5673fc0d5fad/schema)
