Skip to content

Inputs

A job’s file comes in one of three ways. Whichever you use, its format is detected from its bytes, never from its name, and checked before anything is converted.

For files where your code runs. POST /v1/uploads with the file’s size (and its name, if you’d like the output named after it) answers with a URL; PUT the bytes there with the headers the upload names, then put the upload’s ID in the job:

POST /v1/jobs
{
"input": {
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
"steps": [
{
"op": "convert",
"to": "pdf"
}
]
}

The URL works for 15 minutes. An upload makes one job; one that no job uses is deleted 60 minutes after it arrived. The file goes straight to storage, never through our API servers, so uploads take the largest files your plan allows. One request or a job has the whole flow in curl, TypeScript and Python.

For small files you already hold in memory: up to 10 MB, in the job’s body. No upload step.

POST /v1/jobs
{
"input": {
"base64": "UEsDBBQABgAIAAAAIQ…",
"filename": "report.docx"
},
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf"
}
],
"metadata": {
"invoice": "INV-1042"
}
}

metadata is yours: up to 20 short strings, returned with the job and its webhook events.

For files already online. We fetch the file once the job starts; the URL must serve the file itself, to anyone, without a sign-in.

POST /v1/jobs
{
"input": {
"url": "https://formatjet.com/docs/samples/report.pdf"
},
"steps": [
{
"op": "convert",
"to": "md"
}
],
"webhook": "https://example.com/formatjet/events"
}

The fetch must finish within 30 minutes. We don’t fetch from private or local addresses, or from video and social platforms, and the URL is never logged. When we can’t fetch it, the job fails with import_failed and costs nothing.

Conversions that join files into one, such as Merge PDF and Image to PDF, take inputs instead of input: two to 20 uploads or base64 files, in order, together within your plan’s file size (and 10 MB of base64 in all).

POST /v1/jobs
{
"inputs": [
{
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
{
"upload_id": "up_01JBXA3S8V0W2X4Y6Z8A0B2C4D"
}
],
"steps": [
{
"op": "convert",
"conversion": "merge-pdf"
}
]
}

A joined job costs what one file of the conversion costs. GET /v1/operations says how many files each conversion takes (files.min and files.max).

Some conversions make more than one file: Split PDF, a PDF’s pages as images, each sheet of a workbook as CSV. The job’s outputs list them in order, up to 250, each with its own download URL.