v1

latestOpenAPI 3.1.02026-08-06244570.4 KB
PDF Tools

Rotate pages of a PDF

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.

post/v1/pdf-tools/rotate

Request body

export_type'url' | 'binary'
expirationinteger

URL expiration in seconds. Min 60, max 604800. Only applies to url export type.

filenamestring nullable

Custom filename (without .pdf). Defaults to a generic name.

pdf_urlstring nullable

Public HTTPS URL to download the PDF from

pdf_base64string nullable

PDF file encoded as a base64 string

rotationinteger nullable

Rotation in degrees applied to every page. Must be 0, 90, 180 or 270. Cumulative with the page's existing rotation.

page_rotationsobject 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.

Example request

{
  "filename": "merged",
  "pdf_url": "https://example.com/file.pdf",
  "pdf_base64": "JVBERi0xLjQKJ...",
  "rotation": 90,
  "page_rotations": {
    "1": 90,
    "3": 180
  }
}

Response

Successful Response

urlstring required

Signed URL to download the PDF

filenamestring required

Filename of the resulting PDF

credits_remaininginteger required

Remaining credits after this request

expires_ininteger required

Seconds until the signed URL expires