API Documentation

Comprehensive REST API for PDF processing, AI analysis, and automation

1

Get API Access

Register for an account and obtain your JWT token for authentication.

2

Make API Calls

Use your token to authenticate requests to any endpoint.

3

Process Files

Upload files, track processing status, and download results.

Rate Limiting

All API endpoints are rate-limited per account tier. Limits reset on a rolling window.

Tier API calls / hour Operations / day Max file size
Free 50 10 10 MB
Paid 1,000 500 50 MB

When a limit is exceeded the API responds with HTTP 429. The following headers are included on all /api/* responses:

Header Description
X-RateLimit-Limit Maximum requests allowed in the current window
X-RateLimit-Remaining Requests remaining in the current window
Retry-After Seconds to wait before retrying (only on 429 responses)

Authentication

All API endpoints require JWT authentication. Include your token in the Authorization header:

Authorization: Bearer your_jwt_token_here
POST /api/auth/register Register a new user account
POST /api/auth/login Login and receive JWT token

PDF Operations

All PDF operations accept multipart/form-data with a file field unless otherwise noted. Operations that complete synchronously return the result directly; long-running operations return an operation_id for polling.

Format Conversions

POST /api/pdf/convert/pdf-to-word Convert PDF to Word (.docx)
POST /api/pdf/convert/pdf-to-excel Convert PDF to Excel (.xlsx)
POST /api/pdf/convert/pdf-to-powerpoint Convert PDF to PowerPoint (.pptx)
POST /api/pdf/convert/pdf-to-images Convert PDF pages to images (ZIP)
POST /api/pdf/convert/images-to-pdf Combine images into a PDF
POST /api/pdf/convert/pdf-to-text Extract plain text from PDF
POST /api/pdf/convert/pdf-to-csv Extract tabular data from PDF as CSV
POST /api/pdf/extract/pdf-to-json Extract structured data from PDF as JSON
POST /api/pdf/convert/pdf-to-html Convert PDF to clean, structured HTML5
POST /api/pdf/convert/pdf-to-pdfa Convert PDF to archival PDF/A format
POST /api/pdf/convert/email-to-pdf Convert .eml / .msg email to PDF
POST /api/pdf/html-to-pdf Convert HTML string or URL to PDF
POST /api/pdf/markdown-to-pdf Convert Markdown to PDF

Document Manipulation

POST /api/pdf/merge Merge multiple PDF files
POST /api/pdf/split Split PDF into multiple files
POST /api/pdf/compress Compress PDF to reduce size
POST /api/pdf/extract-pages Extract specific pages from a PDF
POST /api/pdf/rearrange-pages Reorder pages within a PDF
POST /api/pdf/watermark Add text or image watermark
POST /api/pdf/add-page-numbers Add page numbers to PDF
POST /api/pdf/flatten Flatten form fields and annotations
POST /api/pdf/repair Attempt to repair a corrupted PDF

Security & Redaction

POST /api/pdf/add-password Password-protect a PDF
POST /api/pdf/remove-password Remove password protection from PDF
POST /api/pdf/redact Permanently redact text or regions
POST /api/pdf/sign-stamp Add signature or stamp image

Metadata & Inspection

POST /api/pdf/metadata Read PDF metadata (author, title, etc.)
POST /api/pdf/edit-metadata Edit PDF metadata fields
POST /api/pdf/inspect Inspect PDF structure, fonts, and properties
POST /api/pdf/fill-form Fill fillable form fields with JSON values
POST /api/pdf/read-barcodes Detect and decode barcodes / QR codes
POST /api/pdf/crop Crop PDF pages by margins or bounding box
POST /api/pdf/annotate Add highlights, notes, text, underlines, and drawings to PDF pages 2 credits
POST /api/pdf/grayscale Convert a color PDF to grayscale or black-and-white 2 credits
POST /api/pdf/resize Resize PDF pages to standard paper sizes or custom dimensions 2 credits
POST /api/pdf/hyperlinks Add clickable hyperlinks (URLs or internal page navigation) to PDF 2 credits
POST /api/pdf/accessibility-check Check PDF for WCAG/PDF-UA accessibility compliance 2 credits
POST /api/pdf/delete-pages Delete specific pages from a PDF document 1 credit
POST /api/pdf/add-bookmarks Add hierarchical bookmarks and table of contents to a PDF 2 credits
POST /api/pdf/compare Compare two PDFs and generate a diff report 3 credits
POST /api/pdf/to-markdown Convert PDF to clean Markdown for LLM ingestion 2 credits
POST /api/pdf/batch Batch process multiple PDFs with chained operations (ZIP output) varies
POST /api/pdf/to-svg Convert PDF pages to scalable vector graphics (SVG) 2 credits
POST /api/pdf/headers-footers Add custom headers and footers with dynamic variables 2 credits
POST /api/pdf/to-epub Convert PDF to EPUB e-book format with chapter detection 3 credits
POST /api/pdf/from-template Generate PDF from HTML/Jinja2 template with JSON data merge 3 credits

OCR & AI-Powered Operations

These endpoints use AI and consume additional credits. Credit costs are listed per operation at base file size; larger files may cost more.

POST /api/pdf/ocr Extract text from scanned/image PDFs via OCR 3 credits
POST /api/pdf/summarize AI-powered structured summary of a PDF 5 credits
POST /api/pdf/extract-data AI-powered structured data extraction (invoices, contracts) 8 credits
POST /api/pdf/translate AI-powered PDF translation to 30+ languages 5 credits

Status & Download

GET /api/pdf/status/{operation_id} Poll processing status
GET /api/pdf/download/{operation_id} Download processed file

Chat with PDF

Upload a PDF to start a conversation. Each session costs 5 credits to start. Follow-up messages within the same session are free.

POST /api/chat/start Upload PDF and start chat session 5 credits
POST /api/chat/{session_id}/message Send a message in an active session
GET /api/chat/{session_id}/history Retrieve full message history
GET /api/chat/sessions List all chat sessions for your account

User Management

GET /api/user/credits Get current credit balance
GET /api/user/credit-transactions Credit transaction history
GET /api/user/processing-history File processing history
GET /api/user/subscription Get current subscription details
POST /api/user/credits/checkout Create a checkout URL to buy credit packs or subscribe

MCP — Model Context Protocol

The MCP server lets AI agents (Claude, Windsurf, Cursor, etc.) call PDF Platform tools directly via the MCP SSE transport. Authenticate with an MCP API key as a Bearer token.

GET /mcp/sse Open SSE stream — server sends endpoint event with session URL
POST /mcp/messages?sessionId={id} Send JSON-RPC message to an active SSE session
GET /mcp/ MCP server info and available tools

Credit Costs Reference

Base costs for a file under 5 MB. Larger files scale proportionally.

Operation Endpoint Base Credits
PDF → Word/api/pdf/convert/pdf-to-word2
PDF → Excel/api/pdf/convert/pdf-to-excel3
PDF → PowerPoint/api/pdf/convert/pdf-to-powerpoint3
PDF → Images/api/pdf/convert/pdf-to-images2
Images → PDF/api/pdf/convert/images-to-pdf1
PDF → Text/api/pdf/convert/pdf-to-text1
PDF → CSV/api/pdf/convert/pdf-to-csv2
PDF → JSON/api/pdf/extract/pdf-to-json3
PDF → HTML/api/pdf/convert/pdf-to-html2
PDF → PDF/A/api/pdf/convert/pdf-to-pdfa3
Email → PDF/api/pdf/convert/email-to-pdf2
HTML / URL → PDF/api/pdf/html-to-pdf3
Markdown → PDF/api/pdf/markdown-to-pdf2
Merge PDFs/api/pdf/merge1
Split PDF/api/pdf/split1
Compress PDF/api/pdf/compress2
OCR (image PDF → text)/api/pdf/ocr3
Summarize PDF (AI)/api/pdf/summarize5
Extract Data (AI)/api/pdf/extract-data8
Fill Form/api/pdf/fill-form3
Read Barcodes / QR/api/pdf/read-barcodes2
Start Chat Session (AI)/api/chat/start5
Watermark/api/pdf/watermark2
Redact/api/pdf/redact2
Sign / Stamp/api/pdf/sign-stamp2
Repair PDF/api/pdf/repair2
Crop PDF/api/pdf/crop2
Annotate PDF/api/pdf/annotate2
Grayscale PDF/api/pdf/grayscale2
Resize PDF/api/pdf/resize2
Add Hyperlinks/api/pdf/hyperlinks2
Accessibility Check/api/pdf/accessibility-check2
Delete Pages/api/pdf/delete-pages1
Add Bookmarks/TOC/api/pdf/add-bookmarks2
Compare PDFs/api/pdf/compare3
PDF to Markdown/api/pdf/to-markdown2
Batch Process/api/pdf/batchper-op
PDF to SVG/api/pdf/to-svg2
Add Headers & Footers/api/pdf/headers-footers2
PDF to EPUB/api/pdf/to-epub3
PDF from Template/api/pdf/from-template3
Translate PDF (AI)/api/pdf/translate5
Others (metadata, flatten, etc.)various1

Example Usage

1. Register and Login

curl -X POST "https://your-domain.com/api/auth/register" \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]", "username": "myusername", "password": "mypassword" }'

2. Convert PDF to Word

curl -X POST "https://your-domain.com/api/pdf/convert/pdf-to-word" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "[email protected]"

3. Convert HTML to PDF

curl -X POST "https://your-domain.com/api/pdf/html-to-pdf" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"html": "<h1>Hello World</h1><p>My content</p>"}' # Or convert a URL: curl -X POST "https://your-domain.com/api/pdf/html-to-pdf" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com"}'

4. AI Summarize a PDF

curl -X POST "https://your-domain.com/api/pdf/summarize" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "[email protected]"

5. Chat with a PDF

# Step 1 — start a session (costs 5 credits) curl -X POST "https://your-domain.com/api/chat/start" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "[email protected]" # Returns: {"session_id": "abc-123", ...} # Step 2 — send a message curl -X POST "https://your-domain.com/api/chat/abc-123/message" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"message": "What are the key obligations?"}'

6. Check Processing Status

curl -X GET "https://your-domain.com/api/pdf/status/operation_id" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

7. Download Result

curl -X GET "https://your-domain.com/api/pdf/download/operation_id" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ --output converted_document.docx

8. Buy Credits (Checkout)

# One-time credit pack (small | medium | large) curl -X POST "https://your-domain.com/api/user/credits/checkout" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"pack_id": "small"}' # Returns: {"checkout_url": "https://..."}

9. MCP — Connect an AI Agent

# 1. Open SSE stream — server returns the messages endpoint curl -N "https://your-domain.com/mcp/sse" \ -H "Authorization: Bearer YOUR_MCP_API_KEY" # event: endpoint # data: https://your-domain.com/mcp/messages?sessionId=xyz # 2. Send a JSON-RPC initialize message curl -X POST "https://your-domain.com/mcp/messages?sessionId=xyz" \ -H "Authorization: Bearer YOUR_MCP_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"my-agent","version":"1.0"}}}'

Interactive Documentation — explore schemas, test endpoints, and see live responses.

Open Scalar Docs →