Skip to content

Health Tracking

import { Aside, Tabs, TabItem } from ‘@astrojs/starlight/components’;

Beyond synced wearable data, VitaSync provides manual health tracking APIs for mood, nutrition, medications, and symptoms. These self-reported data points enrich AI analytics and correlation analysis.

Log daily mood with scores, energy levels, stress, and tags.

Terminal window
curl -X POST http://localhost:3001/v1/users/$USER_ID/mood \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mood": "happy",
"score": 8,
"energy": 7,
"stress": 3,
"tags": ["exercise", "good_sleep"],
"notes": "Great morning run, felt energized all day"
}'
FieldTypeRequiredDescription
moodstringYesMood label (e.g. happy, anxious, neutral, tired)
scorenumberYesOverall mood score (1–10)
energynumberNoEnergy level (1–10)
stressnumberNoStress level (1–10)
tagsstring[]NoContext tags (max 10)
factorsstring[]NoContributing factors (max 10)
notesstringNoFree-text notes (max 2000 chars)
recordedAtISO 8601NoDefaults to now
MethodPathDescription
GET/v1/users/:userId/moodList mood logs (filter by from, to, mood)
POST/v1/users/:userId/moodCreate a mood entry
GET/v1/users/:userId/mood/statsMood statistics for a period (days param, default 30)
{
"averageScore": 7.2,
"averageEnergy": 6.8,
"averageStress": 4.1,
"moodDistribution": { "happy": 12, "neutral": 8, "anxious": 3 },
"topTags": ["exercise", "good_sleep", "social"],
"trend": "improving"
}

Log meals with full macronutrient breakdown and get daily/weekly summaries.

Terminal window
curl -X POST http://localhost:3001/v1/users/$USER_ID/nutrition \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mealType": "lunch",
"description": "Grilled chicken salad",
"calories": 520,
"proteinG": 42,
"carbsG": 30,
"fatG": 22,
"fiberG": 8,
"waterMl": 500
}'
FieldTypeRequiredDescription
mealTypestringYesbreakfast, lunch, dinner, snack, supplement
descriptionstringNoMeal description (max 500 chars)
caloriesnumberNoTotal calories
proteinGnumberNoProtein in grams
carbsGnumberNoCarbohydrates in grams
fatGnumberNoFat in grams
fiberGnumberNoFiber in grams
sugarGnumberNoSugar in grams
sodiumMgnumberNoSodium in milligrams
waterMlnumberNoWater intake in milliliters
loggedAtISO 8601NoDefaults to now
MethodPathDescription
GET/v1/users/:userId/nutritionList nutrition logs (filter by from, to, mealType)
POST/v1/users/:userId/nutritionLog a meal
GET/v1/users/:userId/nutrition/:logIdGet a specific log
PUT/v1/users/:userId/nutrition/:logIdUpdate a log
DELETE/v1/users/:userId/nutrition/:logIdDelete a log
GET/v1/users/:userId/nutrition/summary/dailyDaily macro totals (date param)
GET/v1/users/:userId/nutrition/summary/weeklyWeekly averages

Track prescriptions, supplements, and adherence.

Terminal window
curl -X POST http://localhost:3001/v1/users/$USER_ID/medications \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Vitamin D3",
"dosage": "5000 IU",
"frequency": "daily",
"timeOfDay": ["morning"],
"startDate": "2025-01-01T00:00:00Z"
}'
Terminal window
curl -X POST http://localhost:3001/v1/users/$USER_ID/medications/$MED_ID/log \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "taken",
"scheduledAt": "2025-03-18T08:00:00Z",
"takenAt": "2025-03-18T08:15:00Z"
}'
StatusDescription
takenMedication was taken
missedDose was missed
skippedIntentionally skipped
MethodPathDescription
GET/v1/users/:userId/medicationsList medications (activeOnly filter, default true)
POST/v1/users/:userId/medicationsAdd a medication
GET/v1/users/:userId/medications/:medIdGet medication details
PUT/v1/users/:userId/medications/:medIdUpdate a medication
DELETE/v1/users/:userId/medications/:medIdDelete a medication
POST/v1/users/:userId/medications/:medId/logLog adherence
GET/v1/users/:userId/medications/:medId/logsList adherence logs
GET/v1/users/:userId/medications/:medId/statsAdherence stats (days param, default 30)

Log symptoms with severity, body location, triggers, and relief measures. The system also analyzes patterns over time.

Terminal window
curl -X POST http://localhost:3001/v1/users/$USER_ID/symptoms \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"symptomName": "Headache",
"severity": 6,
"bodyLocation": "frontal",
"triggers": ["poor_sleep", "screen_time"],
"reliefMeasures": ["ibuprofen", "rest"],
"notes": "Started after 4 hours of continuous screen time"
}'
FieldTypeRequiredDescription
symptomNamestringYesName of the symptom (max 200 chars)
severitynumberYesSeverity scale (1–10)
bodyLocationstringNoBody area affected (max 100 chars)
durationstringNoDuration description (max 100 chars)
triggersstring[]NoKnown triggers (max 10)
reliefMeasuresstring[]NoMeasures tried (max 10)
notesstringNoFree-text notes (max 2000 chars)
occurredAtISO 8601NoDefaults to now
MethodPathDescription
GET/v1/users/:userId/symptomsList symptom logs (filter by from, to, symptom)
POST/v1/users/:userId/symptomsLog a symptom
GET/v1/users/:userId/symptoms/:logIdGet a specific log
DELETE/v1/users/:userId/symptoms/:logIdDelete a log
GET/v1/users/:userId/symptoms/topTop symptoms by frequency (days param, default 30)
GET/v1/users/:userId/symptoms/patternsPattern analysis (days param, default 90)