API Documentation
conv2pdf REST API — convert, merge, split, compress and protect PDFs from your application. EU hosting, GDPR-strict, no US tier in the processing chain.
Quick start
- Create an account (free, email — no password required)
- From your dashboard, create an API key (free Dev plan, 100 conversions/mo to get started)
- Authenticate your calls with the
Authorization: Bearer cpdf_live_…header
Base URL
https://api.conv2pdf.com/v1
Authentication
Every request must include the HTTP header Authorization: Bearer <your_key>. A revoked or non-existent key returns a 401 status. An exceeded quota returns 429 with reset details.
Endpoints
GET /v1/tools
Returns the list of available tools, their limits and accepted formats.
curl https://api.conv2pdf.com/v1/tools \
-H "Authorization: Bearer cpdf_live_xxx"
POST /v1/convert/:tool
Performs a conversion. Files are sent as multipart/form-data.
Available tools: image-to-pdf, office-to-pdf, merge-pdf, split-pdf, compress-pdf, protect-pdf.
Optional parameters (form-data fields):
split-pdf: fieldranges(e.g.1-5,7,10-12)compress-pdf: fieldquality(low,medium,high)protect-pdf: fieldpasswordrequired (4 to 64 characters); optionalprevent_print=on,prevent_copy=on
Example — Image → PDF (curl)
curl -X POST https://api.conv2pdf.com/v1/convert/image-to-pdf \
-H "Authorization: Bearer cpdf_live_xxx" \
-F "file=@photo.jpg"
Example — Merge PDFs (curl)
curl -X POST https://api.conv2pdf.com/v1/convert/merge-pdf \
-H "Authorization: Bearer cpdf_live_xxx" \
-F "file=@doc1.pdf" \
-F "file=@doc2.pdf" \
-F "file=@doc3.pdf"
Example — Compression (curl)
curl -X POST https://api.conv2pdf.com/v1/convert/compress-pdf \
-H "Authorization: Bearer cpdf_live_xxx" \
-F "file=@big.pdf" \
-F "quality=medium"
Example — Password protection (curl)
curl -X POST https://api.conv2pdf.com/v1/convert/protect-pdf \
-H "Authorization: Bearer cpdf_live_xxx" \
-F "file=@confidential.pdf" \
-F "password=secret123" \
-F "prevent_print=on" \
-F "prevent_copy=on"
AES-256 encryption. The resulting PDF will prompt for the password on opening and apply the selected restrictions.
Successful response
{
"job_id": "abc123…",
"status": "success",
"download_url": "/v1/download/abc123…",
"size_bytes": 124533,
"quota": {
"plan": "starter",
"monthly_quota": 500,
"used": 42,
"period_end": 1715789012345
}
}
GET /v1/download/:jobId
Downloads the converted file. The PDF is served with Content-Type: application/pdf and Cache-Control: no-store. Available for 1 hour after conversion.
curl https://api.conv2pdf.com/v1/download/abc123… \
-H "Authorization: Bearer cpdf_live_xxx" \
-o output.pdf
Examples — Node.js
import { readFile } from 'node:fs/promises';
const file = await readFile('./photo.jpg');
const formData = new FormData();
formData.append('file', new Blob([file]), 'photo.jpg');
const res = await fetch('https://api.conv2pdf.com/v1/convert/image-to-pdf', {
method: 'POST',
headers: { 'Authorization': 'Bearer cpdf_live_xxx' },
body: formData
});
const data = await res.json();
console.log(data.download_url);
Examples — Python
import requests
with open('photo.jpg', 'rb') as f:
r = requests.post(
'https://api.conv2pdf.com/v1/convert/image-to-pdf',
headers={'Authorization': 'Bearer cpdf_live_xxx'},
files={'file': f}
)
print(r.json()['download_url'])
Error codes
| Code | Error | Cause |
|---|---|---|
| 400 | not_enough_files / too_many_files | File count outside tool bounds |
| 401 | missing_bearer_token / invalid_api_key | Missing auth or invalid key |
| 403 | forbidden | Job belongs to another key |
| 404 | tool_not_found / job_not_found | Tool or job does not exist |
| 409 | job_not_ready | Conversion not complete |
| 410 | file_expired | File deleted (1 h TTL exceeded) |
| 413 | file_too_large | File > 200 MB (API limit) |
| 415 | unsupported_format | Extension not accepted by tool |
| 429 | quota_exceeded | Monthly quota reached |
| 500 | failed | Server conversion error (details in error field) |
Quotas and reset
Each API key has a monthly quota according to its plan (see pricing). The period is rolling 30 days from the key creation date. At the end of each period, used_current_period is automatically reset to zero.
Privacy
No file (input or output) is kept beyond 1 hour. No result caching is applied. All processing happens on EU servers (OVH Gravelines). See our privacy policy for details.
Support
For any technical question, use our contact form (subject "Technical question"). Business and Enterprise plans: priority support with contractual SLA.