Log food
Add a product or meal from the database to a meal on a day.
POST https://cotlet.dev/api/v1/fitatu/foods/{food_id}
write
Adds one product or meal from search_food to the chosen meal and day, in grams, milliliters or a handy measure the product offers, such as a slice or a package. It reaches no one and is undone with one call, delete_diary_item, so it runs without asking first.
Parameters
| Name | Type | Description |
|---|---|---|
| food_id string required | string | Product or meal ID from search_food. |
| meal string required | string | Meal name from your Fitatu meal scheme. By default: breakfast, second breakfast, lunch, dinner, snack or supper. |
| amount number required | number | How much, in the unit below. |
| unit string required | string | gram, milliliter or a measure the product lists, e.g. slice, teaspoon, handful or package. |
| date date | date | Day to log on, YYYY-MM-DD. Default: today. |
Request
curl -X POST https://cotlet.dev/api/v1/fitatu/foods/food_8c41d2 \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"meal":"meal","amount":1,"unit":"unit"}' result = client.call("fitatu", "log_food", {"food_id":"food_8c41d2","meal":"meal","amount":1,"unit":"unit"}) const result = await cotlet.call('fitatu', 'log_food', {"food_id":"food_8c41d2","meal":"meal","amount":1,"unit":"unit"}); cotlet call fitatu log_food --data '{"food_id":"food_8c41d2","meal":"meal","amount":1,"unit":"unit"}' Example response
{
"item_id": "it_5c20",
"date": "2026-10-13",
"meal": "breakfast",
"name": "Rye bread",
"amount": "2 slices",
"kcal": 160,
"status": "logged"
}