Merran documentation API & integrations
Find substitutions that work in a planned meal
POST
/api/list/items/{itemId}/substitutions/suggest
const url = 'http://localhost:3000/api/list/items/0199e8b0-5a10-7a01-8b00-00000000001d/substitutions/suggest';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"mealId":"0199e8b0-5a10-7a01-8b00-00000000001b","recipeId":"0199e8b0-5a10-7a01-8b00-000000000006","ingredientId":"0199e8b0-5a10-7a01-8b00-000000000011","state":"example-state"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”itemId
required
string
Example
0199e8b0-5a10-7a01-8b00-00000000001dRequest Bodyrequired
Section titled “Request Bodyrequired”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"}Responses
Section titled “Responses”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
replacements
Array
object
ingredientId
required
string
lines
required
Array<string>
steps
Array<object>
object
stepId
required
string
text
required
The step, rewritten.
string
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.