Conversions

Create a conversion

Upload a PDF and start converting its pages to JPG images.

POST/v1/conversions

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

Authorizationstringrequired

Bearer YOUR_API_KEY. The key needs the conversions:write scope.

Idempotency-Keystringrequired

A 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

filefilerequired

The PDF. Your plan sets the largest file you can upload.

optionsJSON stringoptional

Conversion options, up to 16 KB. All of the fields below are optional.

pagesstringoptional

Which pages to convert, such as "1-3,5,8-". Default "all".

dpiintegeroptional

Output resolution, from 10 up to your plan's maximum. Default 150.

qualityintegeroptional

JPEG quality, 1 to 100. Default 90.

subsamplingstringoptional

"auto", "444", "420" or "gray". Default "auto".

backgroundstringoptional

The colour behind transparent areas, as "#RRGGBB". Default "#FFFFFF".

name_templatestringoptional

File names. Must include {page_number}. Default "{original}_page_{page_number:0001}".

zipbooleanoptional

true also creates a ZIP of all pages. Default false.

passwordstringoptional

The password of a protected PDF.

More detail in Conversion options.

Response

202 Accepted returns the job.

idstring

The job ID. Use it to follow the job and get the results.

statestring

queued at first. See all states.

channelstring

Where it came from: api, web or desktop.

input_filenamestring

The name of the uploaded file.

input_bytesinteger

The size of the uploaded file.

optionsobject

The options in use, with defaults filled in.

page_countinteger or null

Pages in the PDF. null until the PDF has been opened.

pages_succeededinteger

Pages converted so far.

credits_consumedinteger

Credits charged. You pay only for pages that converted.

errorobject or null

What went wrong, when something did. See job errors.

Errors

StatusCodeWhat to do
400idempotency_key_requiredSend an Idempotency-Key header.
400invalid_optionAn option is unknown or out of range. See field.
401unauthenticatedThe API key is missing, invalid, expired or revoked.
403insufficient_scopeUse a key with conversions:write.
403plan_limit_exceededAbove your plan, such as a DPI over its maximum.
409idempotency_key_reusedThe key was used for a different request.
413file_too_largeAbove your plan's upload limit.
415not_a_pdfThe file is not a PDF.
429too_many_active_jobsWait for one of your jobs to finish.

A wrong PDF password or too few credits appear later, on the job. See Errors.