Skip to content

Update a meal

Changes a meal. Only what you send changes.

PATCHhttps://app.splot.health/v1/meals/:id

Needs the Read and write permission.

ParameterTypeDescription
idstringRequired. The meal's id.

Send at least one field. A field you leave out keeps its value.

FieldTypeDescription
statestringWhether the meal was eaten or is planned ahead. Send logged when a planned meal is eaten. One of planned or logged.
eatenAtdate-timeWhen it was eaten, or will be for a plan, with a UTC offset.
timezonestringThe IANA timezone it is eaten in, such as Europe/Berlin. Up to 100 characters.
namestring or nullThe meal's name. null clears it. Up to 2,000 characters.
notesstring or nullThe meal's notes. null clears them. Up to 2,000 characters.
imagesarrayReplaces the meal's photos. Keep a saved photo by sending it as the meal returned it. Up to 20 items.
itemsobjectItems to add, change or remove.
FieldTypeDescription
addarrayNew items, as creating a meal takes them. Up to 100 items.
changearrayNew portions for items, by id. Up to 100 items.
removearrayIds of items to remove. Up to 100 items.

Items are matched by the ids the meal returned. A meal keeps at least one item and at most 100; to remove the last one, delete the meal.

200 with the updated meal.

Terminal window
curl -X PATCH https://app.splot.health/v1/meals/6f1c2a8e-3b7d-4c5e-9a1f-2d8b7e4c9a10 \
-H "Authorization: Bearer $SPLOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "logged",
"items": { "change": [{ "id": "0b9e4d2c-7a51-4f8e-b3c6-5d1a9e2f7c48", "quantity": 30, "unit": "g" }] }
}'

Last updated