Authenticated hydration logs, daily goals, and date-range history.
Water Intake provides client-scoped hydration logging and daily goal tracking for authenticated users. The request hostname selects the client, and the Water Intake module must be available for that client.
Send a Firebase ID token in the Authorization header:
Authorization: Bearer <firebase-id-token>Logs and settings are restricted to the authenticated user. Do not put the Firebase token in a URL.
/api/water-intake/logsCreates a water intake log.
| Field | Type | Required | Description |
|---|---|---|---|
amountMl | integer 1–5000 | Yes | Amount in millilitres. |
date | YYYY-MM-DD string | No | Log date; defaults to today in Hong Kong time. |
{
"amountMl": 250,
"date": "2026-03-17"
}{
"logId": "log-001",
"clientId": "gofa",
"userId": "user-001",
"amountMl": 250,
"date": "2026-03-17",
"createdAt": "2026-03-17T10:30:00.000Z"
}/api/water-intake/logsReturns the user's logs for one date with a daily total and current goal.
| Query parameter | Type | Default | Description |
|---|---|---|---|
date | YYYY-MM-DD string | Today in Hong Kong time | Date to retrieve. |
{
"date": "2026-03-17",
"totalMl": 1250,
"goalMl": 2000,
"logs": [
{
"id": "log-001",
"amountMl": 250,
"timestamp": "2026-03-17T10:30:00.000Z"
},
{
"id": "log-002",
"amountMl": 500,
"timestamp": "2026-03-17T08:15:00.000Z"
},
{
"id": "log-003",
"amountMl": 500,
"timestamp": "2026-03-17T07:00:00.000Z"
}
]
}/api/water-intake/logs/[logId]Deletes a water intake log owned by the authenticated user.
{
"success": true
}The route returns 403 for a log owned by another user and 404 when the log
does not exist.
/api/water-intake/historyReturns user-scoped logs and daily totals for an inclusive date range. Both
parameters are required, use YYYY-MM-DD, and from must be on or before
to.
GET /api/water-intake/history?from=2026-03-01&to=2026-03-07
Authorization: Bearer <firebase-id-token>{
"from": "2026-03-01",
"to": "2026-03-07",
"average": 1250,
"dailyTotals": [
{ "date": "2026-03-01", "totalMl": 1000 },
{ "date": "2026-03-02", "totalMl": 1500 }
],
"logs": [
{
"id": "log-001",
"amountMl": 250,
"date": "2026-03-01",
"timestamp": "2026-03-01T10:30:00.000Z"
}
]
}average is the rounded average across every day in the requested range,
including days with no logs.
/api/water-intake/settingsReturns the user's daily hydration goal:
{
"dailyGoalMl": 2000
}/api/water-intake/settingsUpdates the user's daily hydration goal. The only accepted field is
dailyGoalMl, an integer from 500 through 10000.
{
"dailyGoalMl": 2500
}{
"dailyGoalMl": 2500
}This page documents user-scoped hydration routes. Admin record queries and other operator surfaces are outside this external integration reference.