Calorie Logs
Function-calling namespace: calorieLogs
- 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.
addFood
Source: backend/endpoints/calorie-logs/add-food
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
name | string | Yes | - |
calories | number | Yes | min: 0 |
protein | number | No | nullable |
carbs | number | No | nullable |
fat | number | No | unix-ms timestamp; nullable |
fiber | number | No | nullable |
quantity | string | 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": "calorieLogs",
"apiName": "addFood",
"data": {
"stackUserId": "stackuser_123",
"name": "value",
"calories": 1
}
}'Example Response
{ "status": "ok", "data": {} }addFoodsFromAI
Source: backend/endpoints/calorie-logs/add-foods-from-ai
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
foods | array<object> | Yes | min: 1; dive |
Nested Field Structures
foods item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Yes | - |
calories | number | Yes | min: 0 |
protein | number | No | nullable |
carbs | number | No | nullable |
fat | number | No | unix-ms timestamp; nullable |
fiber | number | No | nullable |
quantity | string | 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": "calorieLogs",
"apiName": "addFoodsFromAI",
"data": {
"stackUserId": "stackuser_123",
"foods": [
{
"name": "value",
"calories": 1,
"protein": 1,
"carbs": 1,
"fat": 1710201600000,
"fiber": 1,
"quantity": "value"
}
]
}
}'Example Response
{ "status": "ok", "data": {} }clearTodayLog
Source: backend/endpoints/calorie-logs/clear-today-log
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | 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": "calorieLogs",
"apiName": "clearTodayLog",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }getCalorieHistory
Source: backend/endpoints/calorie-logs/get-calorie-history
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
limit | integer | No | min: 1; max: 365 |
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": "calorieLogs",
"apiName": "getCalorieHistory",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }getCalorieSummary
Source: backend/endpoints/calorie-logs/get-calorie-summary
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | 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": "calorieLogs",
"apiName": "getCalorieSummary",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }getTodayLog
Source: backend/endpoints/calorie-logs/get-today-log
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | 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": "calorieLogs",
"apiName": "getTodayLog",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }getWeeklyCalorieStats
Source: backend/endpoints/calorie-logs/get-weekly-calorie-stats
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | 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": "calorieLogs",
"apiName": "getWeeklyCalorieStats",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }removeFood
Source: backend/endpoints/calorie-logs/remove-food
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
foodIndex | integer | No | min: 0 |
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": "calorieLogs",
"apiName": "removeFood",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }updateDailyGoal
Source: backend/endpoints/calorie-logs/update-daily-goal
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
dailyGoal | number | Yes | gt: 0 |
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": "calorieLogs",
"apiName": "updateDailyGoal",
"data": {
"stackUserId": "stackuser_123",
"dailyGoal": 1
}
}'Example Response
{ "status": "ok", "data": {} }