Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Find substitutions that work in a planned meal

POST
/api/list/items/{itemId}/substitutions/suggest
curl --request POST \
--url http://localhost:3000/api/list/items/0199e8b0-5a10-7a01-8b00-00000000001d/substitutions/suggest \
--header 'Content-Type: application/json' \
--data '{ "mealId": "0199e8b0-5a10-7a01-8b00-00000000001b", "recipeId": "0199e8b0-5a10-7a01-8b00-000000000006", "ingredientId": "0199e8b0-5a10-7a01-8b00-000000000011", "state": "example-state" }'

Signed-in household members only. Uses the household’s AI swaps task, dietary rules and pantry with the actual saved meal ingredients and instructions. Nothing is applied automatically.

itemId
required
string

Example

0199e8b0-5a10-7a01-8b00-00000000001d
Media typeapplication/json
object
mealId
required
string
recipeId
required
string
ingredientId
required
string
state
required
string
allRecipes
boolean

Example

{
"mealId": "0199e8b0-5a10-7a01-8b00-00000000001b",
"recipeId": "0199e8b0-5a10-7a01-8b00-000000000006",
"ingredientId": "0199e8b0-5a10-7a01-8b00-000000000011",
"state": "example-state"
}

Possible replacements.

Media typeapplication/json
object
swaps
required
Array
object
lines
required

Ingredient lines in its place, with amounts for the recipe as written.

Array<string>
note
required

How to use it, and how it changes the dish.

string
atHome
required

It’s in the pantry.

boolean
steps
required

Steps it changes, rewritten. Usually none.

Array<object>
object
stepId
required
string
text
required

The step, rewritten.

string
<= 5000 characters
replacements
Array
object
ingredientId
required
string
lines
required
Array<string>
>= 1 items <= 5 items
steps
Array<object>
<= 20 items
object
stepId
required
string
text
required

The step, rewritten.

string
<= 5000 characters
recipeId
required
string
state
required
string

Example

{
"swaps": []
}

Not signed in.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Not allowed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Context no longer available.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Meal changed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.