Skip to content

Make a job

POST /v1/jobs

Make a job: convert an upload, a base64 file or a file at a URL.

The job starts at once and is answered while it runs: wait for it with GET /v1/jobs/{id}, its event stream, or a webhook. Credits are held now and charged only if it succeeds.

API key with the convert scope.

Request

Terminal window
curl -X POST "https://api.formatjet.com/v1/jobs" \
-H "Authorization: Bearer $FORMATJET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
"steps": [
{
"op": "convert",
"to": "pdf"
}
]
}'

Headers

FieldTypeDescription
Idempotency-KeystringUp to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (Idempotent-Replayed: true); the same key with a different request is a 409.

Body

application/json

FieldTypeDescription
inputobjectThe file. Send this or inputs. One of 3 shapes; their fields are below.
input.upload_idstringUp to 40 characters.
input.base64stringUp to 13981020 characters.
input.filenamestringUp to 255 characters.
input.urlstringAn http or https URL we fetch the file from; never logged. Private addresses, and video and social platforms, are refused. Up to 2048 characters.
inputsobject[]Two to 20 files joined into one output, in order (merge-pdf, image-to-pdf): uploads or base64, up to 10 MB of base64 in all. Send this or input. One of 2 shapes; their fields are below.
inputs[].upload_idstringUp to 40 characters.
inputs[].base64stringUp to 13981020 characters.
inputs[].filenamestringUp to 255 characters.
stepsobject[]Up to 5 steps, each converting what the step before made: the job’s output is the last step’s. Send this or recipe.
steps[].op required"convert"
steps[].conversionstringA conversion’s slug from GET /v1/operations, such as word-to-pdf Up to 100 characters.
steps[].fromstring (a format ID)What the file is; detected from its bytes when left out
steps[].tostring (a format ID)The format to make, when conversion is left out
steps[].optionsobject (map)The conversion’s options (options_schema in GET /v1/operations)
recipestringA recipe’s ID (rcp_…, POST /v1/recipes): its steps and output name. Send this or steps. Up to 40 characters.
outputobject
output.ttlintegerSeconds the output is kept after completion (default 86400)
output.filenamestringUp to 255 characters.
metadataobject (map)Up to 20 string values, 2 KB in all; returned with the job
webhookstringA URL that gets this job’s events besides your webhook endpoints, signed with your organization’s job-webhook secret (dashboard, Webhooks). HTTPS on a public host name. Up to 2048 characters.
Convert an upload
{
"input": {
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
"steps": [
{
"op": "convert",
"to": "pdf"
}
]
}
Convert a base64 file, naming the conversion
{
"input": {
"base64": "UEsDBBQABgAIAAAAIQ…",
"filename": "report.docx"
},
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf"
}
],
"metadata": {
"invoice": "INV-1042"
}
}
Import a file from a URL
{
"input": {
"url": "https://formatjet.com/docs/samples/report.pdf"
},
"steps": [
{
"op": "convert",
"to": "md"
}
],
"webhook": "https://example.com/formatjet/events"
}
Chain steps: Word to PDF, then Markdown
{
"input": {
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf"
},
{
"op": "convert",
"conversion": "pdf-to-markdown"
}
]
}
Run a recipe
{
"input": {
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
"recipe": "rcp_01JBXA7M2P4R6T8V0X2Z4B6D8F"
}
Join files into one PDF
{
"inputs": [
{
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D"
},
{
"upload_id": "up_01JBXA3S8V0W2X4Y6Z8A0B2C4D"
}
],
"steps": [
{
"op": "convert",
"conversion": "merge-pdf"
}
]
}

Responses

201 Created

The job, running

FieldTypeDescription
idstring
status"created" | "awaiting_upload" | "queued" | "processing" | "completed" | "failed" | "canceled"awaiting_upload while a URL input is being fetched
mode"live" | "test"
conversionstring
progressnumber
stepsobject[]Every step in order: each converts what the step before made, and the last makes the output
steps[].op"convert"
steps[].conversionstring
steps[].fromstring (a format ID)
steps[].tostring (a format ID)
steps[].optionsobject (map)
steps[].status"created" | "awaiting_upload" | "queued" | "processing" | "completed" | "failed" | "canceled"
steps[].creditsnumber | nullWhat the step costs if the job succeeds; null once the job’s details have expired
steps[].unitsnumber | nullThe pages or minutes the step counted (1 for a step priced per file); null until measured
steps[].enginestring | null
steps[].engine_versionstring | null
inputobjectThe file, or the first of inputs
input.upload_idstring
input.formatstring (a format ID)
input.bytesnumber | null
input.filenamestring | null
inputsobject[]Every input in order, input first: more than one when the job joins files. Empty once the job’s details have expired.
inputs[].upload_idstring
inputs[].formatstring (a format ID)
inputs[].bytesnumber | null
inputs[].filenamestring | null
outputsobject[]
outputs[].idstring
outputs[].filenamestring | null
outputs[].bytesnumber
outputs[].mimestring
outputs[].urlstring | nullNull once the file is deleted
outputs[].expires_atstring | null
outputs[].deleted_atstring | nullWhen the file was deleted from storage; null until then
estimateobjectWhat the job costs, and what that counts (P3-2)
estimate.creditsnumberWhat the job costs if it succeeds. A conversion priced per page or minute counts one unit until the file is measured, then what its pages or minutes cost
estimate.unit"file" | "page" | "output_minute" | "audio_minute"What the conversion is priced by
estimate.unitsnumber | nullUnits counted: 1 for a conversion priced per file; the pages to read or started minutes once the file is measured, null until then
creditsnumberCredits charged: only for a job that succeeded
enginestring | null
engine_versionstring | null
errorobject | null
error.codestring
error.detailstring
metadataobject (map)
created_atstring
finished_atstring | null
linksobject
links.selfstring
links.eventsstring
Example
{
"id": "job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
"status": "completed",
"mode": "live",
"conversion": "word-to-pdf",
"progress": 100,
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf",
"from": "docx",
"to": "pdf",
"options": {},
"status": "completed",
"credits": 2,
"units": 1,
"engine": "office",
"engine_version": "libreoffice-25.8+runner-7"
}
],
"input": {
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
"format": "docx",
"bytes": 48213,
"filename": "report.docx"
},
"inputs": [
{
"upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
"format": "docx",
"bytes": 48213,
"filename": "report.docx"
}
],
"outputs": [
{
"id": "file_01JBXA3R2N5P7Q9S1T3V5W7X9Z",
"filename": "report.pdf",
"bytes": 61874,
"mime": "application/pdf",
"url": "https://<account>.r2.cloudflarestorage.com/formatjet-files-us/out/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/file_01JBXA3R2N5P7Q9S1T3V5W7X9Z?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=…",
"expires_at": "2026-10-25T10:00:06.000Z",
"deleted_at": null
}
],
"estimate": {
"credits": 2,
"unit": "file",
"units": 1
},
"credits": 2,
"engine": "office",
"engine_version": "libreoffice-25.8+runner-7",
"error": null,
"metadata": {},
"created_at": "2026-10-24T10:00:02.000Z",
"finished_at": "2026-10-24T10:00:06.000Z",
"links": {
"self": "https://api.formatjet.com/v1/jobs/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
"events": "https://api.formatjet.com/v1/jobs/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/events"
}
}

Errors

Problem documents (application/problem+json); see Errors.

StatusCodeWhen
400invalid_requestThe body failed validation, or an upload isn’t ready.
401unauthorizedNo API key, or one that’s unknown or revoked.
402insufficient_creditsNot enough credits for the job.
403forbiddenThe key lacks the convert scope, or the plan has no API.
404not_foundNo such upload.
409idempotency_conflictThe Idempotency-Key was used for a different request in the last 24 hours, or its first request is still running.
413file_too_largeLarger than the plan, test mode or the engine takes.
422unsupported_conversionA conversion we can’t run for this file.
429rate_limitedOver the rate limit, or as many jobs running as the plan allows: wait Retry-After seconds.