PDF Clinic REST API Documentation
Integrate PDF processing into your applications with our powerful REST API
https://your-domain.com/api/v1/pdfAuthentication: 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
- 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:
- Go to your API Keys page
- Click "Create New API Key" and give it a descriptive name
- Copy the generated key immediately (you won't see it again!)
- Include it in the
X-API-Keyheader for all API requests
API Endpoints (33 Total)
Basic Operations
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"
Split PDF into individual pages
Parameters:
file(form-data): PDF file to split
Response: ZIP file with all pages (if multi-page)
Compress PDF to reduce file size
Parameters:
file(form-data): PDF filequality(optional, default: 70): Compression quality (0-100)
Response: Compressed PDF file
PDF Conversions
Convert PDF to Word (DOCX)
Convert Word to PDF
Convert PDF to Excel (XLSX)
Convert Excel to PDF
Convert PDF to PowerPoint (PPTX)
Convert PowerPoint to PDF
Convert PDF pages to JPG images
dpi parameter optional (default: 300)
Convert JPG images to PDF
Multiple files supported
Convert HTML content to PDF
Request Body (JSON):
{
"htmlContent": "<html><body>Hello</body></html>",
"baseUrl": "https://example.com" // optional
}
Advanced Features
Analyze PDF quality
Returns quality score, issues, suggestions
Auto-enhance document quality
Deskew, denoise, improve contrast
Detect personally identifiable information
Finds SSN, credit cards, emails, phones
Extract tables to structured data
Returns JSON array of tables
Auto-classify document type
Invoice, Resume, Contract, Report, etc.
Auto-generate bookmarks from headings
PDF Editing
Rotate PDF pages
angle: 90, 180, 270
Add text watermark
text, position
Add visual signature
Security
Password-protect PDF
password required
Remove password from PDF
password required
Redact sensitive information
Request Body: Array of redaction areas with coordinates
Page Organization
Extract specific pages
pageNumbers: 1,2,5
Remove specific pages
pageNumbers: 3,4
Reorder pages
pageOrder: 2,1,3
Add page numbers to PDF
format: "Page {0}" (optional)
position: "bottom-center" (optional)
Utility Functions
Get PDF metadata
Returns page count, size, author, etc.
Validate PDF file
Checks if file is valid PDF
Compare two PDFs
Returns similarity score & differences
OCR (make searchable)
language: eng, spa, fra, etc.
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"
}