Manual Water Intake Tracking
Plan & Token Requirements
Feature available in the following LogMeal Plans:
Accessible by the following User Types:
ā« APICompany tokens cannot call the manual-water creation or deletion endpoints, but they can retrieve a user's water totals through the applicable history endpoints.
What It Does
Manual Water Intake Tracking provides a dedicated water-tracker workflow without requiring an image or a dish-selection step.
- POST /intake/manualWater/{userId} creates an image-less manual intake whose only dish is the configured water class.
- DELETE /intake/manualWater/{userId} removes a requested quantity from the user's newest water-only entries for a selected day and cutoff time.
- GET /history/getIntakesList returns each entry's
is_waterflag and atotal_watersummary that separates direct water entries from fluids found in other intakes.
A created water entry behaves like any other manual intake: it has an imageId, timestamp, occasion, recipe, nutritional information, and serving size, but it has no uploaded photo.
Water-only classification is content-based, not endpoint-based. Any intake whose only dish is the configured water class is returned with
is_water: true, contributes tototal_water.manual_water, and is eligible for quantity removal through DELETE/intake/manualWater/\{userId\}. This includes an equivalent entry created through the generic manual-intake endpoint.
When to Use It / Outcomes
- Add quick water buttons such as one glass, one bottle, or a custom milliliter amount.
- Let an š“ APIUser record water for themselves without taking a photo.
- Let a šµ APIUserManager record or correct water for a managed user.
- Implement an undo or correction action that subtracts a quantity from the newest water entries.
- Display a hydration summary that distinguishes directly logged water from fluids contained in meals and drinks.
- Output on creation: a compact intake reference containing
imageId,userId, andoccasion. - Output on deletion: the quantity actually removed, fully deactivated intake IDs, and the ID of any intake that was partially reduced.
Feature-Specific Details
Creating Water Entries
The POST request body is optional.
| Field | Behavior |
|---|---|
quantity | Water quantity in milliliters. Must be at least 1. Defaults to 250. |
timestamp | User-local intake time in YYYY/MM/DD, HH:MM:SS format. Defaults to the user's current localized time. |
intake_name | Optional display label for the intake. |
The water dish and its recipe are selected internally. Clients do not need to send a dish ID or ingredient list.
Example request body:
{
"quantity": 500,
"timestamp": "2026/07/22, 10:30:00",
"intake_name": "Morning bottle"
}Example response:
{
"message": "Water intake created successfully.",
"intake": {
"imageId": 623657,
"userId": 546,
"occasion": "snack"
}
}The response does not contain the complete intake or refreshed hydration totals. Retrieve them through GET /intake/{imageId} or GET /history/getIntakesList.
Because the entry has no uploaded photo, image_url can be null. When an icon is configured for the water class or one of its ancestors, the history response can use that icon as a fallback.
Removing Water by Quantity
The DELETE request body is optional. quantity again defaults to 250 milliliters.
The optional timestamp has a different role than it does on POST: it selects the local day and acts as the inclusive cutoff time. The endpoint considers water entries from 00:00:00 on that day through the supplied time. Without a timestamp, it uses the current local day through the user's current localized time.
Deletion proceeds from the newest eligible entry backwards:
- Entries fully covered by the requested quantity are deactivated and returned in
deleted_intake_ids. - When the remaining quantity is smaller than the next entry, that entry's serving size is reduced and its ID is returned in
edited_intake_id. - At most one entry is partially edited, but a response can contain both fully deleted IDs and one edited ID.
- When less water is available than requested, all available water is removed and the endpoint still returns HTTP
200with the actualdeleted_quantityand a message describing the missing remainder. - When no eligible water is found, the endpoint returns HTTP
200withremoved: falseanddeleted_quantity: 0.
Example partial removal:
{
"quantity": 250,
"timestamp": "2026/07/22, 12:00:00"
}{
"removed": true,
"deleted_quantity": 250.0,
"unit": "ml",
"message": "Water intake deleted successfully.",
"deleted_intake_ids": null,
"edited_intake_id": 623657
}
DELETE/intake/manualWater/is a quantity-removal operation, not a request to delete one fixed resource. Repeating the same request removes additional water from the then-current history. Do not retry it blindly. To remove one known entry, call DELETE /intake/{imageId}.
History and Hydration Totals
GET /history/getIntakesList returns the following fields for water-tracker integrations:
| Field | Meaning |
|---|---|
intakes_list[].is_water | true only when the intake contains exactly one dish and that dish is the configured water class. |
total_water.manual_water | Milliliters from water-only entries, regardless of whether they were created through the dedicated or generic manual-intake endpoint. |
total_water.from_intakes_water | Milliliters contributed by configured fluid ingredients in all other intakes, such as milk, coffee, or broth. |
total_water.weight | manual_water + from_intakes_water. |
total_water.measure.glasses.quantity | Total fluid quantity divided by the configured 250 ml glass size. |
When food waste has been reported, fluid totals use the post-consumption recipe so the hydration total reflects the amount actually consumed.
A mixed intake containing water plus another dish is not a water-only entry. Its fluid ingredients contribute to from_intakes_water, and the manual-water DELETE endpoint does not target it. The same applies to drinks represented by a class other than the configured water class.
Related Endpoints
Use the following endpoints to create, correct, and retrieve water data:
- POST /intake/manualWater/{userId} ā š“ šµ Create a water-only manual intake.
- DELETE /intake/manualWater/{userId} ā š“ šµ Remove a quantity from the newest water-only entries.
- GET /history/getIntakesList ā ā« š“ šµ Retrieve intake entries,
is_water, andtotal_water. - GET /intake/{imageId} ā ā« š“ šµ Retrieve the complete details of one created water entry.
- DELETE /intake/{imageId} ā ā« š“ šµ Remove one specific intake by ID instead of subtracting a quantity.
- POST /intake/manualInput/{userId} ā š“ šµ Create a general manual intake, including an equivalent water-only entry when the configured water dish ID is used.
Typical Workflow
- Choose the target user: an APIUser uses their own ID; an APIUserManager uses the ID of an accessible managed user.
- Log water: call POST
/intake/manualWater/\{userId\}with a quantity, or rely on the250 mldefault. - Refresh the tracker: call
GET /history/getIntakesListfor the relevant period and readtotal_water,is_water, and the created entry'simage_id. - Correct by quantity: call DELETE
/intake/manualWater/\{userId\}and usedeleted_quantity,deleted_intake_ids, andedited_intake_idto reconcile the UI. - Correct one exact record when needed: use DELETE
/intake/\{imageId\}instead of the quantity-removal endpoint.
Updated about 2 hours ago
