Developer API
Use the tools processed on our servers from your own programs: compression, OCR, conversions, summaries, translation.
Authentication
Every call carries an API key. Create one from the “My account” page, then send it in one of these two headers.
X-API-Key: pdk_…
# or
Authorization: Bearer pdk_…A key acts on your behalf and uses your quota: keep it on a server, never in a web page or a code repository. A leaked key can be revoked from the same page.
Process a file
Processing is a job: you create it, wait for it to finish, then download the result.
1. Create the job
Send a multipart/form-data form. The tool and options fields must come before the files. options is a JSON object, empty if the tool has no settings.
curl -X POST "https://my-dz-pdf.winalco.net/v1/jobs" \
-H "X-API-Key: $PDFDESK_KEY" \
-F tool=compress \
-F 'options={"level":"recommended"}' \
-F files=@document.pdf
# 202
{"id": "0b6f6c0e-7d3a-4c58-9d55-0d9d3a3f6f0a"}2. Follow the job
Poll the job about once a second. status is queued, running, done or failed. On failure, error holds the error code. The job identifier is what grants access: do not publish it.
curl "https://my-dz-pdf.winalco.net/v1/jobs/$ID"
{"id": "…", "status": "done", "outputs": [{"index": 0, "size": 48211}]}3. Download the result
Each uploaded file produces one result, at the matching index.
curl -o resultat.pdf "https://my-dz-pdf.winalco.net/v1/jobs/$ID/outputs/0"4. Delete
Files are deleted automatically when they expire. This call deletes them right away.
curl -X DELETE "https://my-dz-pdf.winalco.net/v1/jobs/$ID"Tools and options
The tool field takes one of these identifiers.
| Tool | Accepted files | Options |
|---|---|---|
compress | {"level": "extreme" | "recommended" | "low"} | |
repair | {} | |
ocr | {"languages": ["fra", "eng"]} | |
pdf-to-pdfa | {} | |
word-to-pdf | .doc .docx .odt | {} |
excel-to-pdf | .xls .xlsx .ods | {} |
powerpoint-to-pdf | .ppt .pptx .odp | {} |
html-to-pdf | — | {"url": "https://…", "format": "A4" | "Letter", "landscape": false} |
pdf-to-word | {"method": "layout" | "text"} | |
pdf-to-excel | {} | |
pdf-to-powerpoint | {} | |
pdf-to-markdown | {} | |
summarize | {"length": "short" | "medium" | "detailed", "language": "auto", "format": "md" | "pdf"} | |
translate | {"target": "en", "format": "md" | "pdf"} |
A server may not offer every tool. This call, which needs no key, tells you which ones are available, and the maximum file size.
curl "https://my-dz-pdf.winalco.net/v1/tools"To chain two tools, send the result of the first job as the file of the second.
Quotas and limits
Each job you create counts towards the daily quota of your plan; artificial intelligence tools also have their own quota. A rejected job does not count. This call returns your limits and today’s usage.
curl -H "X-API-Key: $PDFDESK_KEY" "https://my-dz-pdf.winalco.net/v1/me"
{"plan": "free", "limits": {"jobsPerDay": 100, "aiPerDay": 10, "maxFileMb": 50},
"usage": {"jobs": 3, "ai": 0}}Once the quota is reached, creating a job returns 429 with the error quota-exceeded. Counters reset at midnight UTC.
Errors
An error comes back with a 4xx or 5xx HTTP status and a stable code in the error field.
{"error": "quota-exceeded"}unknown-tool- The tool identifier does not exist.
bad-options- The options field is not a valid JSON object for this tool.
no-file- No file was sent.
wrong-type- The file is not of the type the tool expects.
file-too-large- The file exceeds the size your plan allows.
engine-missing- This tool is not available on this server.
quota-exceeded- Today’s quota is reached.
busy- Too many calls in a short time. Try again in a minute.
encrypted- The PDF is password protected.
timeout- Processing took longer than allowed.
failed- Processing failed.
not-found- The job does not exist, or its files have expired.