PDF Clinic REST API Documentation

Integrate PDF processing into your applications with our powerful REST API

Base URL: https://your-domain.com/api/v1/pdf
Authentication: API Key (Header: X-API-Key: sk_your_key_here)
Important: All endpoints require authentication - requests without a valid API key will return 401 Unauthorized

Authentication

How Authentication Works

All API endpoints use centralized API key authentication. Every request must include your API key in the X-API-Key header:

X-API-Key: sk_your_api_key_here
Security:
  • API keys are validated using async authorization filters before request processing
  • Keys are stored securely using SHA-256 hashing
  • Failed authentication attempts are logged for security monitoring
  • You can revoke keys instantly from your account settings

Getting Your API Key:

  1. Go to your API Keys page
  2. Click "Create New API Key" and give it a descriptive name
  3. Copy the generated key immediately (you won't see it again!)
  4. Include it in the X-API-Key header for all API requests

API Endpoints (33 Total)

Basic Operations

POST /merge

Merge multiple PDFs into one

Parameters:

  • files (form-data, multiple files): PDF files to merge

Response: PDF file (application/pdf)

curl -X POST https://api.pdfclinic.com/api/v1/pdf/merge \
  -H "X-API-Key: sk_your_key" \
  -F "files=@file1.pdf" \
  -F "files=@file2.pdf"
POST /split

Split PDF into individual pages

Parameters:

  • file (form-data): PDF file to split

Response: ZIP file with all pages (if multi-page)

POST /compress

Compress PDF to reduce file size

Parameters:

  • file (form-data): PDF file
  • quality (optional, default: 70): Compression quality (0-100)

Response: Compressed PDF file

PDF Conversions

POST /convert/pdf-to-word

Convert PDF to Word (DOCX)

POST /convert/word-to-pdf

Convert Word to PDF

POST /convert/pdf-to-excel

Convert PDF to Excel (XLSX)

POST /convert/excel-to-pdf

Convert Excel to PDF

POST /convert/pdf-to-powerpoint

Convert PDF to PowerPoint (PPTX)

POST /convert/powerpoint-to-pdf

Convert PowerPoint to PDF

POST /convert/pdf-to-jpg

Convert PDF pages to JPG images

dpi parameter optional (default: 300)

POST /convert/jpg-to-pdf

Convert JPG images to PDF

Multiple files supported

POST /convert/html-to-pdf

Convert HTML content to PDF

Request Body (JSON):

{
  "htmlContent": "<html><body>Hello</body></html>",
  "baseUrl": "https://example.com" // optional
}

Advanced Features

POST /quality-check

Analyze PDF quality

Returns quality score, issues, suggestions

POST /enhance

Auto-enhance document quality

Deskew, denoise, improve contrast

POST /detect-pii

Detect personally identifiable information

Finds SSN, credit cards, emails, phones

POST /extract-tables

Extract tables to structured data

Returns JSON array of tables

POST /classify

Auto-classify document type

Invoice, Resume, Contract, Report, etc.

POST /add-bookmarks

Auto-generate bookmarks from headings

PDF Editing

POST /rotate

Rotate PDF pages

angle: 90, 180, 270

POST /watermark

Add text watermark

text, position

POST /sign

Add visual signature

Security

POST /protect

Password-protect PDF

password required

POST /unlock

Remove password from PDF

password required

POST /redact

Redact sensitive information

Request Body: Array of redaction areas with coordinates

Page Organization

POST /extract-pages

Extract specific pages

pageNumbers: 1,2,5

POST /remove-pages

Remove specific pages

pageNumbers: 3,4

POST /organize

Reorder pages

pageOrder: 2,1,3

POST /page-numbers

Add page numbers to PDF

format: "Page {0}" (optional)

position: "bottom-center" (optional)

Utility Functions

POST /info

Get PDF metadata

Returns page count, size, author, etc.

POST /validate

Validate PDF file

Checks if file is valid PDF

POST /compare

Compare two PDFs

Returns similarity score & differences

POST /ocr

OCR (make searchable)

language: eng, spa, fra, etc.

POST /repair

Repair corrupted PDF

📊 Rate Limits

Rate limits are enforced per API key based on your subscription tier:

  • Free: 10 requests/minute, 100 requests/day
  • Premium: 100 requests/minute, 5,000 requests/day
  • Team: 500 requests/minute, 50,000 requests/day

When rate limit is exceeded, the API returns HTTP 429 Too Many Requests. Rate limit headers are included in all responses.

⚠️ Error Responses

All error responses follow a consistent JSON format:

{
  "error": "Error description"
}

Common Error Scenarios:

Status Code Error Type Common Causes
400 Bad Request Invalid request Missing required parameters, invalid file format, file too large
401 Unauthorized Authentication failed Missing X-API-Key header, invalid API key, expired key
429 Too Many Requests Rate limit exceeded Too many requests in time window - upgrade plan or wait
500 Internal Server Error Processing failed Corrupted file, unsupported feature, system error

Example Error Response:

HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
  "error": "Invalid API key"
}