Skip to content

Save food or recipe

Saves a food or recipe to My foods, or changes one.

WRITEsave_food

Your assistant saves a food only when a search finds nothing that matches. A recipe’s nutrition is added up from its ingredients. When your assistant changes a packaged product, your copy is saved to My foods and the change goes to Splot for review before it can correct the shared product.

It takes the same input as Save a food in the API, plus photos.

InputTypeDescription
namestringRequired. The food's name, without its brand. Up to 200 characters.
dataobjectRequired. What the food is: its base unit, nutrition and measures, and for a recipe its ingredients and steps.
brandstring or nullThe brand, for a packaged or restaurant food. Up to 200 characters.
barcodestring or nullThe EAN or UPC barcode digits from the package.
copyFromobjectThe food this one was changed from, so its provenance is kept and a product correction can be proposed.
idstringTo update one of the person's own foods: its key from list_foods with library mine. Leave out to save a new food.
photosarrayPhotos the person attached in this conversation to keep with this record: pass the attachments themselves, never file paths. Up to 6 items.

The tool’s own instructions, word for word, as every assistant receives them.

Save a food or recipe to My foods, or with id update one of the person's foods. Search list_foods first and save a new food only when nothing matches, never for a product the catalogue already has. Each recipe ingredient is a food from list_foods or, only when nothing matches, a newFood, with a portion; the server adds up the nutrition. When changing a shared or saved food, pass copyFrom so its origin is kept: a product change goes to review and does not change the shared catalogue directly. Meals and recipes keep the version they were saved with. Pass photos the person attached as photos.

Last updated