EndpointsWeight Logs

Weight Logs

Function-calling namespace: weightLogs

  • 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/weight-logs/create

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
weightKgnumberYes-
notesstringNo-
imageUrlstringNo-
recordedAtintegerNounix-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": "weightLogs",
  "apiName": "create",
  "data": {
    "patientId": "patient_123",
    "weightKg": 1
  }
}'

Example Response

{ "status": "ok", "data": {} }

delete

Source: backend/endpoints/weight-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": "weightLogs",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "patientId": "patient_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getAnalytics

Source: backend/endpoints/weight-logs/get-analytics

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
periodstringNo-
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": "weightLogs",
  "apiName": "getAnalytics",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getLatest

Source: backend/endpoints/weight-logs/get-latest

Input Fields

FieldTypeRequiredConstraints
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": "weightLogs",
  "apiName": "getLatest",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

listHistory

Source: backend/endpoints/weight-logs/list-history

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
rangestringNo-
datestringNoformat: YYYY-MM-DD
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: 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": "weightLogs",
  "apiName": "listHistory",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

update

Source: backend/endpoints/weight-logs/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
patientIdstringYes-
weightKgnumberYes-
notesstringNo-
imageUrlstringNo-
recordedAtintegerNounix-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": "weightLogs",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "patientId": "patient_123",
    "weightKg": 1
  }
}'

Example Response

{ "status": "ok", "data": {} }