EndpointsWater Logs

Water Logs

Function-calling namespace: waterLogs

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

create

Source: backend/endpoints/water-logs/create

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
amountMlintegerYes-
loggedAtintegerNounix-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

FieldTypeRequiredConstraints
idstringYes-
patientIdstringYes-

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

FieldTypeRequiredConstraints
patientIdstringYes-
datestringNoformat: 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

FieldTypeRequiredConstraints
patientIdstringYes-
endDatestringNoformat: 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

FieldTypeRequiredConstraints
patientIdstringYes-
rangestringNo-
datestringNoformat: YYYY-MM-DD
pageintegerNo-
pageSizeintegerNo-

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

FieldTypeRequiredConstraints
idstringYes-
patientIdstringYes-
amountMlintegerYes-

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": {} }