Replaces the ingredient list of one or more food items in an existing intake.
The request is organized by food_item_position. Each key in ingredients_per_item identifies the food item whose recipe must be updated.
The endpoint supports two kinds of itemized intakes:
- Segmentation intakes, whose positions normally correspond to detected image regions such as
1,2,3, ... - Manual or mixed intakes, whose positions use the generated format
manual1,manual2,manual3, ...
This includes manual intakes that are internally represented as an APIImage because they contain a favorite, custom recipe or barcode product.
Their editable positions are still obtained from the stored recipe_per_item.
A normal recognition-only image without an itemized recipe cannot use this endpoint.
Its food must first be converted into an itemized/mixed intake, for example through POST /v2/image/confirm/dish.
Each recipe component must be identified using exactly one of:
ingredientId: an existing LogMeal ingredient ID. Available ingredients can be retrieved throughGET /v2/dataset/ingredients.ingredientName: a free-text ingredient not represented by an existing LogMeal ingredient.ingredientAmountis mandatory and nutritional information cannot be obtained directly for this free-text component.barcodeClassId: a barcode product previously resolved throughPOST /v2/barcode_scan/{barcode_id}. Use thedish_idreturned by that endpoint asbarcodeClassId.
These three identifiers are mutually exclusive.
Ingredient amount
ingredientAmount is expressed in grams.
- For
ingredientId, it is optional. When omitted, the ingredient's existing default/average quantity is used. - For
barcodeClassId, it is optional. When omitted, the stored OpenFoodFacts nutritional reference or serving quantity is used. - For
ingredientName, it is mandatory because there is no catalog ingredient from which a default quantity can be obtained.
When provided, ingredientAmount must be zero or greater.
Measures
measureSystem and measureId are available with a LogMeal Monitor plan or higher and are supported only for regular LogMeal ingredients identified through ingredientId.
They cannot be used with ingredientName or barcodeClassId.
If the target APIUser does not have access to ingredient measures, submitted measure information is ignored and the gram-based ingredient amount is used.
Nutrition
After the ingredients have been successfully replaced, the API recalculates the nutritional information for the intake.
When this operation is executed internally as part of a unified POST /v2/image/confirm/dish request, intermediate recalculation is suppressed and nutrition is calculated once after all dish, ingredient and quantity changes have been applied.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests⦠| |||
