API Reference Private beta

PrivConvert API

A single REST endpoint for every conversion - images, documents, data, eBooks, fonts and archives. Files are processed entirely in memory and deleted the instant they are returned. Nothing is ever written to disk.

Introduction

The PrivConvert API turns any file conversion on PrivConvert into a single authenticated POST request. It is designed for teams that handle sensitive documents - legal, medical, finance - and cannot send files to a service that stores them.

Private beta. The API is currently invite-only while we onboard our first developers. Request access and we will issue a key and walk you through onboarding. Endpoints and parameters below reflect the stable contract.
Base URLhttps://privconvert.com/api
ProtocolHTTPS only (TLS 1.3)
AuthBearer API key
Requestmultipart/form-data
ResponseBinary file stream

Authentication

Every request must include your secret API key as a Bearer token in the Authorization header. Keys are issued per account and look like pk_live_…. Keep them server-side - never expose a key in client-side code.

# Pass your key in the Authorization header
Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxx
Keep keys secret. A leaked key can spend your monthly quota. Rotate immediately from your dashboard if you suspect exposure (dashboard ships with general availability).

Quick start

Convert a Word document to PDF. The converted file streams straight back in the response body.

# Convert contract.docx → PDF
curl -X POST https://privconvert.com/api/convert/word-to-pdf \
  -H "Authorization: Bearer pk_live_…" \
  -F "[email protected]" \
  -o contract.pdf

Convert a file

POST /api/convert/{tool}

The {tool} path segment selects the conversion - for example word-to-pdf, png-to-jpg or json-to-csv. Send the source file as a file field in a multipart/form-data body. The same pattern works for all 450+ tools.

Parameters

FieldTypeRequiredDescription
filefileYesThe source file to convert, sent as multipart form data.
qualityintegerNoOutput quality 1-100 for image/PDF tools. The default varies by format - 90 for JPEG, 85 for WebP, 60 for AVIF. GET /api/tools reports the exact default for each tool.
widthintegerNoTarget width in pixels for resize-capable image tools.
heightintegerNoTarget height in pixels for resize-capable image tools.

Response

On success (200) the response body is the converted file - a raw binary stream, not JSON. Read it from the body and write it to disk. Useful headers:

HeaderExample
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="contract.pdf"
X-Credits-Remaining4985
X-Sanitize-Report{"javascript":2,"launch":1,"clean":false}

X-Sanitize-Report is returned by sanitize-pdf and sanitize-svg only. It is a JSON object counting what was removed from the file, so a pipeline can log which uploads arrived carrying active content without keeping the original. "clean": true means nothing was found.

Errors return JSON instead of a file:

{
  "error": {
    "code": "file_too_large",
    "message": "File exceeds your plan’s size limit."
  }
}

Convert many files

POST /api/convert-batch runs one tool over up to 20 files in a single request and returns them as a ZIP. Same key, same tool names as the single-file endpoint.

curl -X POST https://privconvert.com/api/convert-batch \
  -H "Authorization: Bearer pk_live_..." \
  -F "tool=png-to-jpg" \
  -F "[email protected]" -F "[email protected]" -F "[email protected]" \
  -o converted.zip
FieldRequiredNotes
toolYesTool id, e.g. png-to-jpg. An unknown id returns 400.
filesYesRepeat the field once per file. More than 20 returns 400.
qualityNoApplies to every file in the request. Defaults to 85.
start, endNoPage range, for tools that take one. Applied to each file individually.

How it counts against your plan

This is the reason to use it. A batch is one request against your per-minute rate limit regardless of how many files it carries, while each converted file counts as one conversion against your monthly quota. Twenty files sent as a batch cost one of your rate-limit slots; sent individually they cost twenty. Either way the quota cost is identical, so batching buys you throughput, not cheaper conversions.

The whole request must fit in 100 MB, and your plan's per-request size cap applies to the total as well. Over either limit the response is 413.

When some files fail

One unreadable file does not fail the batch. Everything that converted is still returned, and the ZIP gains a PRIVCONVERT-ERRORS.txt listing what was skipped and why. The status is still 200, so check the headers rather than the status code:

HeaderExampleMeaning
X-Converted-Count18Files in the ZIP.
X-Failed-Count2Files skipped.
X-Partial-Success1Present only when something was skipped.

If nothing converted there is no partial result worth shipping, so the response is 400 with the first failure reason instead of an empty archive.

A single file above your plan's size cap belongs on the chunked upload endpoint instead - batch is for many ordinary files, not for one large one.

Code examples

The same request in your language of choice. Swap the png-to-jpg slug for any tool.

curl -X POST https://privconvert.com/api/convert/png-to-jpg \
  -H "Authorization: Bearer pk_live_…" \
  -F "[email protected]" \
  -o photo.jpg

Large file uploads

A single POST to /api/convert/{tool} is capped at 100 MB by our edge network. To convert larger files - up to your plan’s max file size (500 MB above 10,000 conversions a month) - upload the file in parts of under 100 MB each. It is a simple three-step flow, authenticated with the same Bearer key:

  1. Initialise the session - declare the total size, number of parts, filename and tool.
  2. Upload each part in order (index 0…N-1), each under 100 MB.
  3. Convert - the server reassembles the file in memory, converts it, and streams the result back. It counts as one conversion against your quota.
When to use it. Only files larger than ~95 MB need this. For everything else, the single POST in Quick start is simpler. Upload sessions are bound to your account and expire after 5 minutes of inactivity.

POST /api/upload-init  ·  POST /api/upload-chunk  ·  POST /api/convert-chunked

StepEndpointForm fieldsReturns
1/api/upload-inittotal_size, total_chunks, filename, tool{ "upload_id": "…" }
2/api/upload-chunkupload_id, chunk_index, file (the chunk){ "received": n, "total": N }
3/api/convert-chunkedupload_id (+ optional quality, width, height, password)Converted file (binary stream)
# Convert a 300 MB PDF by uploading it in parts (bash).
# Requires a key above 10,000/mo. Splits, uploads, then converts.
KEY="pk_live_…"
FILE=big.pdf
TOOL=compress-pdf
CHUNK=$((95*1024*1024))

# 0. split into 95 MB parts
split -b $CHUNK -d "$FILE" part_
N=$(ls part_* | wc -l)
SIZE=$(stat -c%s "$FILE")

# 1. init
ID=$(curl -s https://privconvert.com/api/upload-init \
  -H "Authorization: Bearer $KEY" \
  -F total_size=$SIZE -F total_chunks=$N -F filename="$FILE" -F tool=$TOOL \
  | jq -r .upload_id)

# 2. upload each chunk
i=0; for p in part_*; do
  curl -s https://privconvert.com/api/upload-chunk \
    -H "Authorization: Bearer $KEY" \
    -F upload_id=$ID -F chunk_index=$i -F file=@"$p" > /dev/null
  i=$((i+1))
done

# 3. convert + download
curl -s https://privconvert.com/api/convert-chunked \
  -H "Authorization: Bearer $KEY" \
  -F upload_id=$ID -o out.pdf

Available tools

Every server-side conversion uses the same /api/convert/{tool} pattern. A sample of the 450+ available slugs:

Images

png-to-jpgto-webpheic-to-jpgcompress-imageresize-image

Documents

word-to-pdfexcel-to-pdfpdf-to-wordhtml-to-pdfmarkdown-to-pdf

Data

json-to-csvcsv-to-jsonxml-to-jsonyaml-to-jsonjson-to-sql

eBooks

epub-to-mobipdf-to-epubmobi-to-epubazw3-to-epub

Fonts & archives

ttf-to-woff2otf-to-woff2rar-to-zip7z-to-zip

See the full tool catalog for every supported conversion. If a tool exists on the site, it works over the API with the same slug.

List tools programmatically

GET /api/tools

A public, machine-readable catalog of every conversion the API exposes - ideal for building dynamic integrations without hard-coding slugs. No API key required. Filter with ?category= (e.g. image, document, data, audio, ebook, archive, mesh, font, spreadsheet, presentation, medical). Every response also carries the full categories list, so an integration can discover them rather than hard-code this one.

curl https://privconvert.com/api/tools?category=image
{
  "version": "1",
  "base_url": "https://privconvert.com/api",
  "count": 79,
  "categories": ["archive", "audio", "data", "…"],
  "tools": [
    {
      "id": "png-to-jpg",
      "name": "PNG to JPG",
      "category": "image",
      "input": "png",
      "output": "jpg",
      "endpoint": "/api/convert/png-to-jpg",
      "params": [{ "name": "quality", "type": "integer", "default": 90 }]
    }
  ]
}

Rate limits & quotas

Quota is counted per successful conversion and resets on the first of each month. Beyond your rate limit or quota, requests return 429 with a Retry-After header.

Monthly volumeRate limitConcurrent jobsMax request size
Up to 10,000 / mo60 req / min2250 MB
10,001 - 50,000 / mo120 req / min4500 MB
Above 50,000 / mo300 req / min6500 MB
EnterpriseCustomCustomCustom

Rate limit and quota are shared across every key on your account, so rotating keys does not reset either. The three limits fail differently and are worth telling apart: exceeding the per-minute rate or the monthly quota returns 429 rate_limited, while exceeding concurrent jobs - conversions running at the same instant, not per minute - returns 429 concurrency_limited. The second one is not fixed by waiting longer between batches; it is fixed by running fewer requests in parallel.

Errors

The API uses conventional HTTP status codes. 2xx means success; 4xx means a problem with the request; 5xx means a problem on our side.

StatusCodeMeaning
200OKConversion succeeded. The body is the converted file.
400bad_requestMalformed request - missing file, bad parameter, or unreadable input.
401unauthorizedMissing or invalid API key.
411length_requiredNo Content-Length header. Size limits are enforced before the body is read, so a declared length is mandatory. Every standard HTTP client sends one.
413file_too_largeThe uploaded file exceeds your plan’s size limit.
415unsupported_typeThe input file type is not valid for this tool.
422conversion_failedThe file was read but could not be converted.
429rate_limitedPer-minute rate or monthly quota exceeded. Slow down and retry after Retry-After.
429concurrency_limitedToo many conversions running at once on your account. Reduce parallelism, then retry after Retry-After.
500server_errorUnexpected error on our side. Safe to retry.
503server_busyThe service is at capacity right now. Retry after Retry-After with backoff.

Privacy & data handling

Privacy is the product. Every file you send to the API is:

  • Processed entirely in RAM - never written to disk.
  • Deleted from memory the instant the converted file is returned.
  • Never logged, never used for training, never shared.
  • Covered by a signed DPA on Enterprise plans.
Ready to build?

Request a beta key and we will get you converting in minutes.

Request API access