Skip to content

Cancel a job

POST /v1/jobs/{id}/cancel

Cancel a job that hasn’t finished; nothing is charged.

A job that has already ended is answered as it is.

API key with the convert scope.

Request

Terminal window
curl -X POST "https://api.formatjet.com/v1/jobs/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/cancel" \
-H "Authorization: Bearer $FORMATJET_API_KEY"

Path parameters

FieldTypeDescription
id requiredstring

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.

Responses

200 OK

The job

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_requestAn Idempotency-Key that isn’t 1 to 255 printable characters.
401unauthorizedNo API key, or one that’s unknown or revoked.
403forbiddenThe key lacks the convert scope, or the plan has no API.
404not_foundNo such job of this key’s mode, or its files are gone.
409idempotency_conflictThe Idempotency-Key was used for a different request in the last 24 hours, or its first request is still running.
429rate_limitedMore requests than the plan allows in 10 seconds: wait Retry-After seconds.