Authentication
All API requests must include a valid API key in the Authorization header using the Bearer scheme. You can generate API keys from your PannaPDF dashboard.
- Production keys start with
pk_live_ - Test keys start with
pk_test_— they work identically but are rate-limited and watermark output files.
Example Header
Authorization: Bearer pk_live_xxxxx
Rate Limits
Rate limits vary by plan. When you exceed your limit the API responds with HTTP 429 Too Many Requests and includes a Retry-After header indicating how many seconds to wait before retrying.
| Plan | Calls / Month | Calls / Minute |
|---|---|---|
| Free | 100 | 10 |
| Starter | 5,000 | 60 |
| Growth | 50,000 | 200 |
| Scale | 500,000 | 1,000 |
Error Handling
All errors follow a consistent JSON structure so you can handle them programmatically.
Error Response Format
{
"error": {
"code": "string",
"message": "string"
}
}Error Codes
| Code | Description |
|---|---|
| invalid_api_key | The API key provided is missing or invalid. |
| rate_limit_exceeded | You have exceeded your plan's rate limit. |
| file_too_large | The uploaded file exceeds the maximum allowed size. |
| invalid_file_type | The uploaded file type is not supported for this operation. |
| processing_error | An internal error occurred while processing the file. |
| invalid_parameters | One or more request parameters are invalid or missing. |
| quota_exceeded | Your monthly API call quota has been reached. |
Webhooks
For long-running operations (large merges, AI tools) you can provide a webhook_url query parameter. When the job finishes, PannaPDF will send a POST request to your URL with the result.
Webhook Payload
{
"event": "job.completed",
"job_id": "job_abc123",
"status": "success",
"result_url": "https://api.pannapdf.com/v1/download/job_abc123",
"expires_at": "2026-05-02T00:00:00Z"
}PDF Tools
Endpoints for manipulating PDF files.
/v1/mergeCombine two or more PDF files into a single document. Upload up to 50 files in one request. Optionally specify a custom page order.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| files | File[] | Yes | PDF files to merge (2-50 files) |
| order | string | No | Comma-separated file indices to control merge order (e.g., "2,0,1") |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/merge \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "[email protected]" \ -F "order=1,0" \ -o merged.pdf
/v1/compressReduce the file size of a PDF while maintaining acceptable quality. Choose from low, medium, or high compression levels.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to compress |
| quality | string | No | Compression level: low, medium (default), or high |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/compress \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "quality=high" \ -o compressed.pdf
Example Response
// Response headers include compression stats: // X-Original-Size: 12582912 // X-Compressed-Size: 3145728 // X-Compression-Ratio: 75%
/v1/splitSplit a PDF into multiple files by specifying page ranges. Returns a ZIP archive containing the resulting PDFs.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to split |
| pages | string | Yes | Page ranges to extract (e.g., "1-3,5,7-10") |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/split \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "pages=1-3,5,7-10" \ -o split-pages.zip
/v1/convert/pdf-to-imageConvert each page of a PDF to a raster image. Supports PNG and JPG output formats with configurable DPI. Returns a ZIP archive of images.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to convert |
| format | string | Yes | Output image format: png or jpg |
| dpi | number | No | Resolution in dots per inch (72-300, default 150) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/convert/pdf-to-image \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "format=png" \ -F "dpi=200" \ -o images.zip
/v1/convert/image-to-pdfConvert one or more images (PNG, JPG, WEBP) into a single PDF document. Each image becomes one page.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| files | File[] | Yes | Image files to convert (PNG, JPG, WEBP) |
| pageSize | string | No | Page size: a4, letter, or original (default a4) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/convert/image-to-pdf \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "[email protected]" \ -F "pageSize=letter" \ -o images.pdf
/v1/watermarkAdd a text watermark to every page of a PDF. Customize position, opacity, and font size.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to watermark |
| text | string | Yes | Watermark text |
| position | string | No | Placement: center or diagonal (default center) |
| opacity | number | No | Transparency from 0 (invisible) to 1 (opaque), default 0.3 |
| fontSize | number | No | Font size in points (default 48) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/watermark \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "text=CONFIDENTIAL" \ -F "position=diagonal" \ -F "opacity=0.2" \ -F "fontSize=60" \ -o watermarked.pdf
/v1/protectEncrypt a PDF with a password and optionally restrict permissions such as printing, copying, or editing.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to protect |
| password | string | Yes | Password to set on the PDF |
| permissions | string | No | Comma-separated allowed permissions: print, copy, edit |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/protect \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "password=s3cur3P@ss" \ -F "permissions=print,copy" \ -o protected.pdf
/v1/flattenFlatten all form fields, annotations, and layers in a PDF into a single flat document. Useful for archiving or preventing further edits.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to flatten |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/flatten \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -o flattened.pdf
/v1/metadataRead or update the metadata (title, author, subject) of a PDF document. Send the file along with the fields you want to change.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to update |
| title | string | No | New document title |
| author | string | No | New author name |
| subject | string | No | New subject / description |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/metadata \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "title=Annual Report 2026" \ -F "author=Jane Doe" \ -o updated.pdf
Example Response
{
"title": "Annual Report 2026",
"author": "Jane Doe",
"subject": null,
"creator": "PannaPDF API v1",
"pages": 24,
"size_bytes": 1048576
}/v1/rotateRotate one or more pages of a PDF by 90, 180, or 270 degrees clockwise.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file |
| angle | number | Yes | Rotation angle: 90, 180, or 270 |
| pages | string | No | Pages to rotate (e.g., "1,3,5-7"). Defaults to "all" |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/rotate \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "angle=90" \ -F "pages=1,3" \ -o rotated.pdf
/v1/reorderRearrange the pages of a PDF by specifying a new page order.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file |
| order | string | Yes | New page order as comma-separated page numbers (e.g., "3,1,2,5,4") |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/reorder \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "order=3,1,2,5,4" \ -o reordered.pdf
AI Tools
AI-powered endpoints for document intelligence and generation.
/v1/ai/summarizeGenerate a concise summary of a PDF document using AI. Choose between short, medium, or long summary lengths.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to summarize |
| length | string | Yes | Summary length: short, medium, or long |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/ai/summarize \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "length=medium"
Example Response
{
"summary": "The annual report highlights a 23% increase in revenue...",
"word_count": 250,
"pages_analyzed": 24
}/v1/ai/extractExtract structured information from a PDF. Specify the fields you want to extract and the AI will locate and return them.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to extract from |
| fields | string[] | Yes | Array of field names to extract (e.g., ["name","email","phone"]) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/ai/extract \ -H "Authorization: Bearer pk_live_xxxxx" \ -H "Content-Type: multipart/form-data" \ -F "[email protected]" \ -F 'fields=["name","email","phone","total"]'
Example Response
{
"data": {
"name": "Acme Corp",
"email": "[email protected]",
"phone": "+1-555-0123",
"total": "$4,250.00"
},
"confidence": 0.96
}/v1/ai/translateTranslate the content of a PDF into another language. The layout and formatting are preserved as closely as possible.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The PDF file to translate |
| targetLanguage | string | Yes | ISO 639-1 language code (e.g., "es", "fr", "de", "ja") |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/ai/translate \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "targetLanguage=es" \ -o translated.pdf
/v1/ai/resumeGenerate a professional resume PDF from a text description. Provide your experience, skills, and education in natural language and receive a formatted PDF.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Text description of your experience, skills, and education |
| template | string | No | Resume template: modern, classic, or minimal (default modern) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/ai/resume \
-H "Authorization: Bearer pk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Software engineer with 5 years of experience in React and Node.js. Worked at Google and a YC startup. MS in Computer Science from Stanford.",
"template": "modern"
}' \
-o resume.pdf/v1/ai/createGenerate a PDF document from a text prompt. Describe what you need and the AI will create a professionally formatted document.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Description of the document to generate |
| pageCount | number | No | Number of pages (1-10, default auto) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/ai/create \
-H "Authorization: Bearer pk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A project proposal for building a mobile app for restaurant reservations",
"pageCount": 3
}' \
-o proposal.pdf/v1/ai/cover-letterGenerate a tailored cover letter for a job application. Optionally upload your resume so the AI can reference your experience.
Headers
| Header | Value |
|---|---|
| Authorization | Bearer pk_live_xxxxx |
| Content-Type | multipart/form-data |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| resume | File | No | Your resume PDF (used to personalize the letter) |
| jobDescription | string | Yes | The job description or posting text |
| tone | string | No | Writing tone: formal or friendly (default formal) |
Responses
| Status | Description |
|---|---|
| 200 | Success — returns the processed file or JSON result |
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Too Many Requests — rate limit exceeded |
Example Request
curl -X POST https://api.pannapdf.com/v1/ai/cover-letter \ -H "Authorization: Bearer pk_live_xxxxx" \ -F "[email protected]" \ -F "jobDescription=Senior Frontend Engineer at Stripe. 5+ years React..." \ -F "tone=formal" \ -o cover-letter.pdf
SDKs
Official client libraries for faster integration.
JavaScript / Node.js
Install the official Node.js SDK from npm:
npm install @pannapdf/sdk
Quick Example
import PannaPDF from '@pannapdf/sdk';
const client = new PannaPDF('pk_live_xxxxx');
// Merge two PDFs
const merged = await client.merge({
files: ['./doc1.pdf', './doc2.pdf'],
});
await merged.saveTo('./merged.pdf');
// Compress a PDF
const compressed = await client.compress({
file: './large.pdf',
quality: 'high',
});
await compressed.saveTo('./compressed.pdf');
// AI Summarize
const summary = await client.ai.summarize({
file: './report.pdf',
length: 'short',
});
console.log(summary.text);Python
Install the official Python SDK from PyPI:
pip install pannapdf
Quick Example
from pannapdf import PannaPDF
client = PannaPDF("pk_live_xxxxx")
# Merge two PDFs
merged = client.merge(files=["doc1.pdf", "doc2.pdf"])
merged.save_to("merged.pdf")
# Compress a PDF
compressed = client.compress(file="large.pdf", quality="high")
compressed.save_to("compressed.pdf")
# AI Summarize
summary = client.ai.summarize(file="report.pdf", length="short")
print(summary["text"])Changelog
v1.4.0 — April 2026
- Added AI Cover Letter generation endpoint
- Added webhook support for all long-running operations
- Increased maximum merge file count from 20 to 50
v1.3.0 — February 2026
- Added AI Resume and AI Create endpoints
- Added Python SDK
- Improved compression quality at all levels
v1.2.0 — December 2025
- Added AI Summarize, Extract, and Translate endpoints
- Added JavaScript / Node.js SDK
- Added Flatten and Metadata endpoints
v1.1.0 — October 2025
- Added Watermark, Protect, Rotate, and Reorder endpoints
- Added Image to PDF conversion
- Increased rate limits for Growth and Scale plans
v1.0.0 — August 2025
- Initial release with Merge, Compress, Split, and PDF to Image
- Authentication and rate limiting
- Free tier with 100 calls/month