šŸ”“šŸ”µ Confirm or replace the ingredients of one or more food items.

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 through GET /v2/dataset/ingredients.
  • ingredientName: a free-text ingredient not represented by an existing LogMeal ingredient. ingredientAmount is mandatory and nutritional information cannot be obtained directly for this free-text component.
  • barcodeClassId: a barcode product previously resolved through POST /v2/barcode_scan/{barcode_id}. Use the dish_id returned by that endpoint as barcodeClassId.

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Ingredients grouped by the food_item_position of the food item whose recipe should be replaced.

integer
required

ID of the intake whose recipes will be modified.

ingredients_per_item
object
required

Ingredient lists keyed by food_item_position.

Valid keys depend on the intake:

  • segmentation positions commonly use values such as 1, 2, 3;
  • mixed/manual intakes use manual1, manual2, manual3, ...

Only positions included in this object are modified.

Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json