curl --request POST \
--url https://api.example.com/plan/ \
--header 'Content-Type: application/json' \
--data '
{
"daily_menus": [
{
"day_of_week": 123,
"plan_id": 123,
"meal_details": [
{
"recipe_id": 123,
"schedule": 123,
"status": 123,
"meal_type": "<string>"
}
]
}
]
}
'{
"id": 123,
"user_id": 123,
"active": true,
"created_at": {},
"updated_at": {},
"daily_menus": [
{
"id": 123,
"day_of_week": 123,
"meal_details": [
{
"id": 123,
"recipe_id": 123,
"schedule": 123,
"status": 123,
"meal_type": "<string>",
"recipe": {
"id": 123,
"name": "<string>",
"calories": 123,
"protein": 123,
"carbs": 123,
"fat": 123,
"image_url": "<string>",
"recipe_url": "<string>",
"recipe_id": 123,
"ingredients": "<string>",
"meal_types": [
{
"id": 123,
"name": "<string>"
}
],
"diet_types": [
{
"id": 123,
"name": "<string>"
}
]
}
}
]
}
]
}Create a new meal plan for the authenticated user
curl --request POST \
--url https://api.example.com/plan/ \
--header 'Content-Type: application/json' \
--data '
{
"daily_menus": [
{
"day_of_week": 123,
"plan_id": 123,
"meal_details": [
{
"recipe_id": 123,
"schedule": 123,
"status": 123,
"meal_type": "<string>"
}
]
}
]
}
'{
"id": 123,
"user_id": 123,
"active": true,
"created_at": {},
"updated_at": {},
"daily_menus": [
{
"id": 123,
"day_of_week": 123,
"meal_details": [
{
"id": 123,
"recipe_id": 123,
"schedule": 123,
"status": 123,
"meal_type": "<string>",
"recipe": {
"id": 123,
"name": "<string>",
"calories": 123,
"protein": 123,
"carbs": 123,
"fat": 123,
"image_url": "<string>",
"recipe_url": "<string>",
"recipe_id": 123,
"ingredients": "<string>",
"meal_types": [
{
"id": 123,
"name": "<string>"
}
],
"diet_types": [
{
"id": 123,
"name": "<string>"
}
]
}
}
]
}
]
}Authorization: Bearer <token>
breakfast, lunch, dinner, snack{
"daily_menus": [
{
"day_of_week": 1,
"plan_id": 1,
"meal_details": [
{
"recipe_id": 12345,
"schedule": 1,
"status": 0,
"meal_type": "breakfast"
},
{
"recipe_id": 12346,
"schedule": 2,
"status": 0,
"meal_type": "lunch"
}
]
},
{
"day_of_week": 2,
"plan_id": 1,
"meal_details": [
{
"recipe_id": 12347,
"schedule": 1,
"status": 0,
"meal_type": "breakfast"
}
]
}
]
}
breakfast, lunch, dinner, snack{
"id": 1,
"user_id": 42,
"active": true,
"created_at": "2026-03-01T10:00:00Z",
"updated_at": "2026-03-01T10:00:00Z",
"daily_menus": [
{
"id": 1,
"day_of_week": 1,
"meal_details": [
{
"id": 1,
"recipe_id": 12345,
"schedule": 1,
"status": 0,
"meal_type": "breakfast",
"recipe": {
"id": 1,
"name": "Spaghetti Carbonara",
"calories": 400,
"protein": 20,
"carbs": 50,
"fat": 15,
"image_url": "https://example.com/image.jpg",
"recipe_url": "https://example.com/recipe",
"recipe_id": 12345,
"ingredients": "Spaghetti, eggs, pancetta, parmesan cheese, black pepper",
"meal_types": [
{
"id": 1,
"name": "lunch"
}
],
"diet_types": [
{
"id": 1,
"name": "high_protein"
}
]
}
},
{
"id": 2,
"recipe_id": 12346,
"schedule": 2,
"status": 0,
"meal_type": "lunch",
"recipe": {
"id": 2,
"name": "Caesar Salad",
"calories": 250,
"protein": 15,
"carbs": 20,
"fat": 12,
"image_url": "https://example.com/salad.jpg",
"recipe_url": "https://example.com/recipe/salad",
"recipe_id": 12346,
"ingredients": "Romaine lettuce, croutons, parmesan, caesar dressing",
"meal_types": [
{
"id": 2,
"name": "lunch"
}
],
"diet_types": [
{
"id": 3,
"name": "low_calorie"
}
]
}
}
]
}
]
}
{
"detail": "Not authenticated"
}
{
"detail": [
{
"loc": ["body", "daily_menus", 0, "day_of_week"],
"msg": "ensure this value is greater than or equal to 1",
"type": "value_error.number.not_ge"
}
]
}
{
"detail": "Internal server error"
}