Documentation
The OfficePDF API is a small REST interface: upload a Word document, poll its status, download the PDF. This page covers everything you need to integrate.
Need every field explained? See the interactive API reference (OpenAPI).
Quick start
Conversions are asynchronous: submit a document with POST /v1/conversions, poll the returned job every 1–2 seconds, and download the PDF once the status is succeeded. Requests and responses are JSON (except uploads) and timestamps are ISO-8601 in UTC.
https://api.getofficepdf.com/v1# 1. Upload a document (strict mode is the default)
curl -X POST https://api.getofficepdf.com/v1/conversions \
-H "Authorization: Bearer opk_your_key" \
-F "[email protected]" -F "mode=strict"
# => {"id": "job_...", "status": "queued", ...}
# 2. Poll until status is final
curl https://api.getofficepdf.com/v1/conversions/job_123 \
-H "Authorization: Bearer opk_your_key"
# 3. Download the PDF
curl -o report.pdf https://api.getofficepdf.com/v1/conversions/job_123/pdf \
-H "Authorization: Bearer opk_your_key"Authentication
Every endpoint requires an API key, sent as a Bearer token. Keys start with opk_.
Authorization: Bearer opk_your_key
# or use the X-API-Key header
X-API-Key: opk_your_key- A key is shown in full only once, when it is created. Store it in server-side configuration — never in frontend code or a repository.
- You can have up to 20 active keys. Revoked keys stop working immediately and return
invalid_api_key. - Create and revoke keys on the API keys page of your dashboard. Account endpoints (purchases, key management) only accept a signed-in browser session; API keys get
session_required.
Create a conversion
Upload as multipart/form-data: file is the document (.docx or .doc, up to 20 MB) and mode is strict (default) or preview.
curl -X POST https://api.getofficepdf.com/v1/conversions \
-H "Authorization: Bearer opk_your_key" \
-F "[email protected]" \
-F "mode=strict"A successful submission returns 202 Accepted with the job object in status queued. The account must have a verified email and remaining pages, otherwise you get email_unverified or quota_exhausted.
{
"id": "job_8f2c1d...",
"status": "succeeded",
"degraded": false,
"filename": "report.docx",
"input_format": "docx",
"mode": "strict",
"pages": 12,
"billed_pages": 12,
"error": null,
"diagnostics": [
{ "code": "font_substituted", "severity": "info", "message": "...", "page": 3 }
],
"diagnostics_total": 1,
"engine_version": "1.4.0",
"created_at": "2026-10-07T08:00:00Z",
"finished_at": "2026-10-07T08:00:04Z",
"expires_at": "2026-10-14T08:00:04Z",
"output_available": true,
"pdf_url": "/v1/conversions/job_8f2c1d.../pdf"
}Strict and preview modes
Both modes use the same engine. They differ in how content that can't be rendered correctly is handled.
strict
The default. If the document contains anything the engine can't guarantee (for example an unsupported equation), the job ends as rejected with a reason. No PDF is produced and no pages are billed. Use it for contracts, official documents and invoices.
preview
Always tries to produce a PDF. Unsupported content falls back (for example to a placeholder), the job's degraded flag is true, and the diagnostics report marks each fallback. Use it for previews or archiving where small deviations are acceptable.
Get status
Fetch the job with GET /v1/conversions/{id}. Poll every 1–2 seconds until the status is no longer queued or running.
curl https://api.getofficepdf.com/v1/conversions/job_123 \
-H "Authorization: Bearer opk_your_key"| Status | Meaning | Billed |
|---|---|---|
| queued | Accepted and waiting to be processed. | No |
| running | Being converted. | No |
| succeeded | Done — the PDF is ready to download. | Yes |
| rejected | Strict mode found content it can't render correctly. See error and diagnostics. | No |
| failed | The conversion failed (for example a corrupt file). See error. | No |
| cancelled | Cancelled. | No |
When status is succeeded and degraded is true, some content fell back in preview mode; check diagnostics to decide whether the output is acceptable. The job carries up to 50 diagnostics (diagnostics_total has the full count); fetch the report for all of them.
Download the PDF
Once succeeded, download with GET /v1/conversions/{id}/pdf (application/pdf). Results are kept for 7 days; afterwards you get 410 expired. Before success you get 409 not_ready.
curl -o contract.pdf https://api.getofficepdf.com/v1/conversions/job_123/pdf \
-H "Authorization: Bearer opk_your_key"
# open in the browser instead of downloading
curl "https://api.getofficepdf.com/v1/conversions/job_123/pdf?disposition=inline" ...Diagnostics report
GET /v1/conversions/{id}/report returns the full engine report: page count, all diagnostics (up to 200, each with code, severity, message and page), the font manifest and file hashes. Available as soon as a job finishes — including rejected and failed jobs.
curl https://api.getofficepdf.com/v1/conversions/job_123/report \
-H "Authorization: Bearer opk_your_key"List conversions
GET /v1/conversions returns jobs newest first. It accepts limit (1–100, default 20), a status filter and cursor pagination: when has_more is true, pass next_cursor as cursor in the next request.
curl "https://api.getofficepdf.com/v1/conversions?limit=20&status=succeeded" \
-H "Authorization: Bearer opk_your_key"
# => { "data": [...], "has_more": true, "next_cursor": "job_..." }
curl "https://api.getofficepdf.com/v1/conversions?limit=20&cursor=job_..." ...Cancel and delete
DELETE /v1/conversions/{id} cancels a queued or running job (not billed). For a finished job it deletes the stored PDF and report immediately; the job record is kept for accounting.
curl -X DELETE https://api.getofficepdf.com/v1/conversions/job_123 \
-H "Authorization: Bearer opk_your_key"Errors
Every error uses the same shape: {"error": {"code", "message"}}. Branch on code; message is for humans and may change. Validation errors also include a details list.
HTTP/1.1 402 Payment Required
{
"error": {
"code": "quota_exhausted",
"message": "No pages remaining. Purchase a page pack to continue."
}
}| code | HTTP | Meaning |
|---|---|---|
| unauthorized | 401 | No credentials were provided. |
| invalid_api_key | 401 | The API key is invalid or revoked. |
| session_required | 403 | This endpoint only accepts a signed-in browser session. |
| email_unverified | 403 | The account's email is not verified. |
| account_disabled | 403 | The account is disabled. |
| quota_exhausted | 402 | No pages left; buy a page pack. |
| unsupported_format | 415 | Not a .docx/.doc file, or the content doesn't match the extension. |
| file_too_large | 413 | The file is larger than 20 MB. |
| validation_error | 422 | Invalid request parameters; see details. |
| too_many_active_jobs | 429 | More than 20 queued or running jobs. |
| rate_limited | 429 | Too many requests; back off and retry. |
| job_not_found | 404 | The job doesn't exist or belongs to another account. |
| not_ready | 409 | The job hasn't succeeded yet; no output. |
| expired | 410 | The output passed its retention period and was deleted. |
Limits
- Maximum file size: 20 MB.
.docxis supported; legacy.docis experimental and best used with preview mode.- Up to 20 queued or running jobs per account; beyond that you get
too_many_active_jobs. - Source files are deleted right after conversion; PDFs and reports are kept for 7 days and can be deleted earlier with DELETE.
- Login, sign-up and password-reset endpoints are rate-limited per IP and return
429 rate_limited; retry with exponential backoff.
On-prem SDK
The SDK ships the same layout engine as the cloud API for local installation on Windows servers. It runs fully offline — ideal when documents must not leave your network.
License file
After purchase you'll find a license file (.lic) in your dashboard: a single line starting with OPDF1. that contains the license payload (customer, edition, features, servers, expiry) and an Ed25519 signature. Place it at the license path configured for the SDK.
OPDF1.eyJpZCI6ImxpY18uLi4iLCJjdXN0b21lciI6Ii4uLiJ9.MEUCIQ...Offline verification
The SDK embeds OfficePDF's Ed25519 public key and verifies the signature and expiry locally — no connection to our servers needed. The public key is also available at GET /v1/licenses/public-key; if the server is online you can call POST /v1/licenses/verify to check for revocation.
curl https://api.getofficepdf.com/v1/licenses/public-key
curl -X POST https://api.getofficepdf.com/v1/licenses/verify \
-H "Content-Type: application/json" \
-d '{"license": "OPDF1...."}'
# => { "valid": true, "problem": null, "payload": { ... } }Downloads
With an active license, download SDK packages and your license file from Licenses & downloads in the dashboard. Every release published during your license term is available.