Skip to content

Save a recipe

POST /v1/recipes

Save a recipe: steps and an output name to run on files.

Run it with recipe on POST /v1/jobs, or ?recipe= on POST /v1/convert. Its steps are checked now as a job's are, and again for each file. At most 100 recipes an organization. Recipes need Pro or an API plan. Test keys have them on any plan.

API key with the convert scope.

Request

Terminal window
curl -X POST "https://api.formatjet.com/v1/recipes" \
-H "Authorization: Bearer $FORMATJET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Word documents to Markdown",
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf"
},
{
"op": "convert",
"conversion": "pdf-to-markdown"
}
],
"output_name": "{name}-text"
}'

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
name requiredstringUp to 100 characters.
steps requiredobject[]Up to 5 steps, as POST /v1/jobs takes them. The first names its conversion, or to with from; no step may hold a password.
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)
output_namestring | nullThe output’s name without its extension: text and {name}, the input’s name, such as {name}-small. Null for the input’s name. Up to 100 characters.
Example
{
"name": "Word documents to Markdown",
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf"
},
{
"op": "convert",
"conversion": "pdf-to-markdown"
}
],
"output_name": "{name}-text"
}

Responses

201 Created

The recipe

FieldTypeDescription
idstring
namestring
stepsobject[]
steps[].op"convert"
steps[].conversionstring
steps[].fromstring
steps[].tostring
steps[].optionsobject (map)
output_namestring | null
created_atstring
updated_atstring
Example
{
"id": "rcp_01JBXA7M2P4R6T8V0X2Z4B6D8F",
"name": "Word documents to Markdown",
"steps": [
{
"op": "convert",
"conversion": "word-to-pdf"
},
{
"op": "convert",
"conversion": "pdf-to-markdown"
}
],
"output_name": "{name}-text",
"created_at": "2026-11-16T09:00:00.000Z",
"updated_at": "2026-11-16T09:00:00.000Z"
}

Errors

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

StatusCodeWhen
400invalid_requestThe body failed validation, or a step can’t follow the one before.
401unauthorizedNo API key, or one that’s unknown or revoked.
403forbiddenRecipes need Pro or an API plan. Test keys have them on any plan. Or the organization has 100 recipes already.
409idempotency_conflictThe Idempotency-Key was used for a different request in the last 24 hours, or its first request is still running.
422unsupported_conversionA step names a conversion we can’t run.
429rate_limitedMore requests than the plan allows in 10 seconds: wait Retry-After seconds.