Skip to main content
PUT
/
meal-detail
/
{meal_detail_id}
Update Meal Detail
curl --request PUT \
  --url https://api.example.com/meal-detail/{meal_detail_id}
{
  "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>"
      }
    ]
  }
}

Authentication

This endpoint does not require authentication based on the source code.

Path Parameters

meal_detail_id
integer
required
The unique identifier of the meal detail to update

Query Parameters

recipe_id
integer
required
The new recipe ID to assign to this meal detail

Request Example

curl -X PUT "https://api.smarteat.ai/meal-detail/123?recipe_id=45678" \
  -H "Content-Type: application/json"

Response

id
integer
required
ID of the meal detail
recipe_id
integer
required
Recipe ID associated with the meal detail (updated value)
schedule
integer
required
Order of meals (1-6)
status
integer
required
Status of the meal detail (0: pending, 1: completed)
meal_type
string
required
Type of meal. Possible values: breakfast, lunch, dinner, snack
recipe
object
required
Associated recipe details
id
integer
required
Unique identifier for the recipe
name
string
required
Name of the recipe
calories
integer
required
Calorie content (minimum: 0)
protein
integer
required
Protein content in grams (minimum: 0)
carbs
integer
required
Carbohydrate content in grams (minimum: 0)
fat
integer
required
Fat content in grams (minimum: 0)
image_url
string
URL to the recipe image
recipe_url
string
URL to the full recipe details
recipe_id
integer
required
External recipe identifier
ingredients
string
required
Comma-separated list of ingredients
meal_types
array
required
List of applicable meal types
id
integer
required
Category ID
name
string
required
Category name
diet_types
array
required
List of applicable diet types
id
integer
required
Category ID
name
string
required
Category name

Response Example

{
  "id": 123,
  "recipe_id": 45678,
  "schedule": 2,
  "status": 0,
  "meal_type": "lunch",
  "recipe": {
    "id": 45678,
    "name": "Grilled Chicken Salad",
    "calories": 350,
    "protein": 35,
    "carbs": 25,
    "fat": 10,
    "image_url": "https://example.com/grilled-chicken.jpg",
    "recipe_url": "https://example.com/recipe/grilled-chicken",
    "recipe_id": 45678,
    "ingredients": "Chicken breast, mixed greens, cherry tomatoes, olive oil, lemon",
    "meal_types": [
      {
        "id": 2,
        "name": "lunch"
      },
      {
        "id": 3,
        "name": "dinner"
      }
    ],
    "diet_types": [
      {
        "id": 1,
        "name": "high_protein"
      },
      {
        "id": 2,
        "name": "low_carb"
      }
    ]
  }
}

Additional Endpoint: Update Meal Status

You can also update just the status of a meal detail using a different endpoint: API: PUT /meal-detail/{meal_detail_id}/status

Query Parameters

status
integer
required
The new status value (0: pending, 1: completed)

Request Example

curl -X PUT "https://api.smarteat.ai/meal-detail/123/status?status=1" \
  -H "Content-Type: application/json"

Error Responses

404 Not Found
Meal detail with the specified ID not found
{
  "detail": "Meal detail not found"
}
422 Unprocessable Entity
Invalid query parameters
{
  "detail": [
    {
      "loc": ["query", "recipe_id"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}
500 Internal Server Error
An unexpected error occurred on the server
{
  "detail": "Internal server error"
}

Build docs developers (and LLMs) love