Weight Logs
Function-calling namespace: weightLogs
- 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/weight-logs/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
weightKg | number | Yes | - |
notes | string | No | - |
imageUrl | string | No | - |
recordedAt | 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": "weightLogs",
"apiName": "create",
"data": {
"patientId": "patient_123",
"weightKg": 1
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/weight-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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
period | string | No | - |
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": "weightLogs",
"apiName": "getAnalytics",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }getLatest
Source: backend/endpoints/weight-logs/get-latest
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
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": "weightLogs",
"apiName": "getLatest",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }listHistory
Source: backend/endpoints/weight-logs/list-history
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
range | string | No | - |
date | string | No | format: YYYY-MM-DD |
startDate | string | No | format: YYYY-MM-DD |
endDate | 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": "weightLogs",
"apiName": "listHistory",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/weight-logs/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
patientId | string | Yes | - |
weightKg | number | Yes | - |
notes | string | No | - |
imageUrl | string | No | - |
recordedAt | 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": "weightLogs",
"apiName": "update",
"data": {
"id": "id_123",
"patientId": "patient_123",
"weightKg": 1
}
}'Example Response
{ "status": "ok", "data": {} }