Water Logs
Function-calling namespace: waterLogs
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
create
Source: backend/endpoints/water-logs/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
amountMl | integer | Yes | - |
loggedAt | integer | No | unix-ms timestamp |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "waterLogs",
"apiName": "create",
"data": {
"patientId": "patient_123",
"amountMl": 1
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/water-logs/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
patientId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "waterLogs",
"apiName": "delete",
"data": {
"id": "id_123",
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }getTodayDashboard
Source: backend/endpoints/water-logs/get-today-dashboard
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
date | string | No | format: YYYY-MM-DD |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "waterLogs",
"apiName": "getTodayDashboard",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }getWeeklyDashboard
Source: backend/endpoints/water-logs/get-weekly-dashboard
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
endDate | string | No | format: YYYY-MM-DD |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "waterLogs",
"apiName": "getWeeklyDashboard",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }listHistory
Source: backend/endpoints/water-logs/list-history
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
range | string | No | - |
date | string | No | format: YYYY-MM-DD |
page | integer | No | - |
pageSize | integer | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "waterLogs",
"apiName": "listHistory",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/water-logs/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
patientId | string | Yes | - |
amountMl | integer | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "waterLogs",
"apiName": "update",
"data": {
"id": "id_123",
"patientId": "patient_123",
"amountMl": 1
}
}'Example Response
{ "status": "ok", "data": {} }