API Reference

Process PDFs from your own code. All operations run server-side — no browser required. API keys are available on the Pro plan.

Authentication

All API routes require a bearer token. Generate your API key in the Dashboard.

Authorization: Bearer pfe_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keep your API keys secret. Rotate them immediately if compromised.

Rate limits

PlanRequests / dayMax file size
FreeNot available
ProUnlimited200 MB

Base URL

https://pdf-edit.dev

Endpoints

POST/api/v1/mergeMerge multiple PDFs into one

Form fields (multipart/form-data)

FieldTypeRequiredDescription
filesFile[]requiredTwo or more PDF files. Send as multiple form fields with the same name.

Response

Returns the merged PDF binary (application/pdf).

Example

curl -X POST https://pdf-edit.dev/api/v1/merge \
  -H "Authorization: Bearer pfe_your_key" \
  -F "files=@document1.pdf" \
  -F "files=@document2.pdf" \
  --output merged.pdf
POST/api/v1/compressCompress a PDF using object streams

Form fields (multipart/form-data)

FieldTypeRequiredDescription
fileFilerequiredThe PDF to compress.

Response

Returns the compressed PDF binary (application/pdf).

Example

curl -X POST https://pdf-edit.dev/api/v1/compress \
  -H "Authorization: Bearer pfe_your_key" \
  -F "file=@large.pdf" \
  --output compressed.pdf
POST/api/v1/splitSplit a PDF into parts

Form fields (multipart/form-data)

FieldTypeRequiredDescription
fileFilerequiredThe PDF to split.
rangesJSON stringoptionalArray of [start, end] page ranges (1-indexed). Example: [[1,3],[5,7]]. Omit to split every page.

Response

Returns JSON: { count: number, files: [{ index: number, data: string (base64) }] }

Example

curl -X POST https://pdf-edit.dev/api/v1/split \
  -H "Authorization: Bearer pfe_your_key" \
  -F "file=@document.pdf" \
  -F 'ranges=[[1,3],[5,7]]'
POST/api/v1/rotateRotate pages in a PDF

Form fields (multipart/form-data)

FieldTypeRequiredDescription
fileFilerequiredThe PDF to rotate.
anglenumberoptionalRotation angle: 90, 180, or 270. Default: 90.
pagesJSON stringoptionalArray of page numbers to rotate (1-indexed). Omit to rotate all pages.

Response

Returns the rotated PDF binary (application/pdf).

Example

curl -X POST https://pdf-edit.dev/api/v1/rotate \
  -H "Authorization: Bearer pfe_your_key" \
  -F "file=@document.pdf" \
  -F "angle=90" \
  -F 'pages=[1,3]' \
  --output rotated.pdf
POST/api/v1/protectPassword-protect a PDF

Form fields (multipart/form-data)

FieldTypeRequiredDescription
fileFilerequiredThe PDF to protect.
user_passwordstringrequiredPassword required to open the document.
owner_passwordstringoptionalOwner password (for permissions). Defaults to user_password.

Response

Returns the protected PDF binary (application/pdf).

Example

curl -X POST https://pdf-edit.dev/api/v1/protect \
  -H "Authorization: Bearer pfe_your_key" \
  -F "file=@document.pdf" \
  -F "user_password=secret123" \
  --output protected.pdf
POST/api/v1/unlockRemove password protection from a PDF

Form fields (multipart/form-data)

FieldTypeRequiredDescription
fileFilerequiredThe password-protected PDF.
passwordstringrequiredThe current password to unlock the document.

Response

Returns the unlocked PDF binary (application/pdf).

Example

curl -X POST https://pdf-edit.dev/api/v1/unlock \
  -H "Authorization: Bearer pfe_your_key" \
  -F "file=@protected.pdf" \
  -F "password=secret123" \
  --output unlocked.pdf

Error responses

StatusMeaning
401Missing or invalid API key
400Bad request — missing field, wrong format, or wrong password
403Feature not available on your plan
500Internal server error
{ "error": "Invalid or missing API key." }