# Auto-Generator

This endpoint generates a meal plan for a specified period of time. How does it work?

* The daily caloric intake is calculated according to specific fields in the user’s profile, i.e. their height, weight, sex and activity levels
* The meal planner then composes a tailor made meal plan, composed of recipes taken from Whisk’s extensive and varied recipe database

| PUT | `/mealplan/v2/generate` |
| --- | ----------------------- |

More info: <https://api.whisk.com/spec/#/MealPlanAPI/GenerateMealPlan2>

## Meal generation settings

To get and update the meal planner settings for each plan, use the following endpoints:

| GET | `/mealplan/v2/settings` |
| --- | ----------------------- |

More info: <https://api.whisk.com/spec/#/MealPlanAPI/GetMealPlanSettings2>

| PUT | `/mealplan/v2/settings` |
| --- | ----------------------- |

More info: <https://api.whisk.com/spec/#/MealPlanAPI/UpdateMealPlanSettings2>

Meal generation settings can also be specified as part of the [generation request](https://api.whisk.com/spec/#/MealPlanAPI/GenerateMealPlan2), in which case the stored settings will be disregarded and overridden.

## Settings model

| ATTRIBUTE                | TYPE    | DESCRIPTION                                                                                                                                                                                                                                                                    |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| servings                 | nubmer  | The number of servings, i,e, people, for which this meal plan is generated.                                                                                                                                                                                                    |
| calorie\_per\_day        | number  | The daily caloric intake which will be used to generate the meal plan, with a ±100 kcal variance.                                                                                                                                                                              |
| week\_template           | array   | Specifies which meals are to be generated in which daily spot. E.g: Monday: Lunch, slot 2 Tuesday: Breakfast, slot 1 and Lunch, slot 2 Wednesday: Breakfast, slot 1 and Lunch, slot 2 Thursday: Breakfast, slot 1 and Lunch, slot 2 Friday: Dinner, slot 3 Weekend: keep empty |
| replace\_only\_generated | boolean | If set to true, meals that were custom-created using the Add Meal endpoint will not be overridden. Only empty daily slots or automatically generated meals will be filled with the newly generated ones.                                                                       |

## User profile

To get and configure User profile you can use [these endpoints](https://api.whisk.com/spec/#/UserAPI):

| GET | `/user/v2/me` |
| --- | ------------- |

| PATCH | `/user/v2/settings` |
| ----- | ------------------- |

This list of user profile preferences could impact the meal recommendation algorithm:

* Age
* Gender
* Health goals
* Height, Weight
* Activity level
* Dietary Preferences
* Allergies and Intolerance
* Disliked Ingredients
* Cooking Preferences


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.whisk.com/master/api/meal-plans/auto-generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
