Endpoint
Authentication
This endpoint requires authentication via Bearer token.Request Body
Date of the meal in YYYY-MM-DD format (e.g., “2024-03-15”)
Meal data object
Type of meal:
breakfast, lunch, dinner, or snackTime of the meal in HH:MM format (e.g., “08:30”)
Array of foods consumed (minimum 1 food required)
Food database ID
Name of the food
Portion description (e.g., “1 cup”, “2 slices”)
Quantity in grams
Mark this food as potentially problematic
Additional notes about the meal (max 500 characters)
Response
Indicates if the meal was successfully created
The created diary entry
Entry ID (MongoDB ObjectId)
User ID who created the entry
Entry date in YYYY-MM-DD format
Entry type (always “meal” for this endpoint)
Complete meal data including all provided fields
Timestamp when the entry was created
Timestamp when the entry was last updated
Examples
Log a breakfast meal
Log a lunch with potentially problematic food
Log a simple snack
Meal Types
| Type | Description |
|---|---|
breakfast | Morning meal |
lunch | Midday meal |
dinner | Evening meal |
snack | Light meal between main meals |