Conversions
Create a conversion
Upload a PDF and start converting its pages to JPG images.
The upload is checked immediately and the job runs in the background. Follow it with the job status or a webhook, then download the results.
Part order matters. Send options before file in the multipart/form-data body. The examples on this page already do.
Headers
AuthorizationstringrequiredBearer YOUR_API_KEY. The key needs the conversions:write scope.
Idempotency-KeystringrequiredA value you choose, unique for each conversion. Repeating a request with the same key returns the same job, with no second charge. See Retries and idempotency.
Body
filefilerequiredThe PDF. Your plan sets the largest file you can upload.
optionsJSON stringoptionalConversion options, up to 16 KB. All of the fields below are optional.
pagesstringoptionalWhich pages to convert, such as "1-3,5,8-". Default "all".
dpiintegeroptionalOutput resolution, from 10 up to your plan's maximum. Default 150.
qualityintegeroptionalJPEG quality, 1 to 100. Default 90.
subsamplingstringoptional"auto", "444", "420" or "gray". Default "auto".
backgroundstringoptionalThe colour behind transparent areas, as "#RRGGBB". Default "#FFFFFF".
name_templatestringoptionalFile names. Must include {page_number}. Default "{original}_page_{page_number:0001}".
zipbooleanoptionaltrue also creates a ZIP of all pages. Default false.
passwordstringoptionalThe password of a protected PDF.
More detail in Conversion options.
Response
202 Accepted returns the job.
idstringThe job ID. Use it to follow the job and get the results.
statestringqueued at first. See all states.
channelstringWhere it came from: api, web or desktop.
input_filenamestringThe name of the uploaded file.
input_bytesintegerThe size of the uploaded file.
optionsobjectThe options in use, with defaults filled in.
page_countinteger or nullPages in the PDF. null until the PDF has been opened.
pages_succeededintegerPages converted so far.
credits_consumedintegerCredits charged. You pay only for pages that converted.
errorobject or nullWhat went wrong, when something did. See job errors.
Errors
| Status | Code | What to do |
|---|---|---|
| 400 | idempotency_key_required | Send an Idempotency-Key header. |
| 400 | invalid_option | An option is unknown or out of range. See field. |
| 401 | unauthenticated | The API key is missing, invalid, expired or revoked. |
| 403 | insufficient_scope | Use a key with conversions:write. |
| 403 | plan_limit_exceeded | Above your plan, such as a DPI over its maximum. |
| 409 | idempotency_key_reused | The key was used for a different request. |
| 413 | file_too_large | Above your plan's upload limit. |
| 415 | not_a_pdf | The file is not a PDF. |
| 429 | too_many_active_jobs | Wait for one of your jobs to finish. |
A wrong PDF password or too few credits appear later, on the job. See Errors.