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
Rate limits
| Plan | Requests / day | Max file size |
|---|---|---|
| Free | Not available | — |
| Pro | Unlimited | 200 MB |
Base URL
https://pdf-edit.dev
Endpoints
/api/v1/mergeMerge multiple PDFs into oneForm fields (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
files | File[] | required | Two 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
/api/v1/compressCompress a PDF using object streamsForm fields (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | required | The 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
/api/v1/splitSplit a PDF into partsForm fields (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | required | The PDF to split. |
ranges | JSON string | optional | Array 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]]'
/api/v1/rotateRotate pages in a PDFForm fields (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | required | The PDF to rotate. |
angle | number | optional | Rotation angle: 90, 180, or 270. Default: 90. |
pages | JSON string | optional | Array 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
/api/v1/protectPassword-protect a PDFForm fields (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | required | The PDF to protect. |
user_password | string | required | Password required to open the document. |
owner_password | string | optional | Owner 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
/api/v1/unlockRemove password protection from a PDFForm fields (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | required | The password-protected PDF. |
password | string | required | The 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
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
400 | Bad request — missing field, wrong format, or wrong password |
403 | Feature not available on your plan |
500 | Internal server error |
{ "error": "Invalid or missing API key." }