Meal Entries
Function-calling namespace: mealEntries
- 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/meal-entries/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
foodId | string | Yes | - |
mealType | string | Yes | - |
servingId | string | Yes | - |
quantity | number | Yes | - |
consumedAt | 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": "mealEntries",
"apiName": "create",
"data": {
"patientId": "patient_123",
"foodId": "food_123",
"mealType": "general",
"servingId": "serving_123",
"quantity": 1
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/meal-entries/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": "mealEntries",
"apiName": "delete",
"data": {
"id": "id_123",
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }getTodayDashboard
Source: backend/endpoints/meal-entries/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": "mealEntries",
"apiName": "getTodayDashboard",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }getWeeklyDashboard
Source: backend/endpoints/meal-entries/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": "mealEntries",
"apiName": "getWeeklyDashboard",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }listToday
Source: backend/endpoints/meal-entries/list-today
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": "mealEntries",
"apiName": "listToday",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/meal-entries/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
patientId | string | Yes | - |
servingId | string | Yes | - |
quantity | number | 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": "mealEntries",
"apiName": "update",
"data": {
"id": "id_123",
"patientId": "patient_123",
"servingId": "serving_123",
"quantity": 1
}
}'Example Response
{ "status": "ok", "data": {} }