# Meal Plan Settings Object

Meal Plan Settings contain all the essential information based on which your meal plan is created. The Meal Plan API provides you with endpoints to [Get](https://docs.whisk.com/api/meal-plans/get-meal-plan-settings/get-meal-plan-settings) and [Update](https://docs.whisk.com/api/meal-plans/get-meal-plan-settings/update-meal-plan-settings) the settings as needed.

This is how the data structure of a Meal Plan `settings` object looks like:

```javascript
"settings": {
  "servings": 2,
  "calorie_per_day": 4000,
  "included_days": [
    "DAY_OF_WEEK_INVALID"
  ],
  "included_meal_types": [
    "MEAL_TYPE_INVALID"
  ],
  "enabled_auto_generation": true,
  "week_template": [
    ...
  ],
  "replace_only_generated": true,
  "week_start": "DAY_OF_WEEK_MONDAY",
  "generation_algorithm": "GENERATION_ALGORITHM_3_MEAL",
  "food_settings": {
    ...
  },
  "custom_labels": {
    ...
  }
}
```

The following attributes define the core of the `settings` object:

| Attribute                 | Type    | Description                                                                                                                                 | Example Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `servings`                | integer | The number of people to serve meals in the meal plan.                                                                                       | `2`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `calorie_per_day`         | integer | The number of daily calories (with a ±100 kcal variance) that are expected to be served by the meal plan.                                   | `4000`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `included_days`           | string  | This attribute is deprecated and has been replaced by the `week_template` attribute.                                                        | \_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `included_meal_types`     | string  | This attribute is deprecated and has been replaced by the `week_template` attribute.                                                        | \_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `enabled_auto_generation` | boolean | Agreement to generate the meal plan automatically. This attribute has no impact on the auto-generation algorithm irrespective of its value. | <ul><li><code>true</code></li><li><code>false</code></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `week_template`           | array   | The schedule settings of the meal plan. It includes information on preferred days and slots for meals assignment.                           | See [`week_template`](#week_template).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `replace_only_generated`  | boolean | Controls the replacement of manually added meals with new auto-generated meals in the meal plan.                                            | <ul><li>The attribute is set as <code>true</code>, If the meals that were manually added to the meal plan are retained, and the new meals are only assigned to the empty slots (if any), or they replace the existing auto-generated meals in the plan. </li><li>The attribute is set as <code>false</code>, If all the existing meals and empty slots are replaced with new meals.</li></ul>                                                                                                                                                                                          |
| `week_start`              | string  | The starting day of the week in the meal plan schedule.                                                                                     | <ul><li><code>DAY\_OF\_WEEK\_MONDAY</code></li><li><code>DAY\_OF\_WEEK\_TUESDAY</code></li><li><code>DAY\_OF\_WEEK\_WEDNESDAY</code></li><li><code>DAY\_OF\_WEEK\_THURSDAY</code></li><li><code>DAY\_OF\_WEEK\_FRIDAY</code></li><li><code>DAY\_OF\_WEEK\_SATURDAY</code></li><li><code>DAY\_OF\_WEEK\_SUNDAY</code></li></ul>                                                                                                                                                                                                                                                         |
| `generation_algorithm`    | string  | The meal generation algorithm.                                                                                                              | <ul><li><code>GENERATION\_ALGORITHM\_3\_MEAL</code>: It performs casual filtering of recipes irrespective of the user's nutrition preferences. Though it does prefer including recipes that match the preferences, still it may also include the ones that are not a good match.</li><li><code>GENERATION\_ALGORITHM\_3\_MEAL\_NUTRITION\_BALANCE</code>: It performs strict filtering to include only those recipes that match the user's nutrition preferences. <br><strong>Note</strong>: This is the default algorithm utilized by Whisk to auto-generate the meal plan.</li></ul> |
| `food_settings`           | array   | User's preferences related settings for filtering recipes.                                                                                  | See [`food_settings`](#food_settings).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `custom_labels`           | array   | A list of labels for filtering recipes.                                                                                                     | See [`custom_labels`](#custom_labels).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

Each array contains additional attributes as described below.

#### `week_template`

```javascript
"week_template": [
  {
    "day": "DAY_OF_WEEK_SUNDAY",
    "meal_templates": [
      {
        "meal_type": "MEAL_TYPE_BREAKFAST",
        "day_slot": 3
      },
      {
        "meal_type": "MEAL_TYPE_LUNCH",
        "day_slot": 4
      },
      {
        "meal_type": "MEAL_TYPE_DINNER",
        "day_slot": 5
      }
    ]
  },
  ...
],
```

| Attribute        | Type   | Description                                                                                                                                                                                     | Example Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `day`            | string | Represents a day of the week.                                                                                                                                                                   | <ul><li><code>DAY\_OF\_WEEK\_MONDAY</code></li><li><code>DAY\_OF\_WEEK\_TUESDAY</code></li><li><code>DAY\_OF\_WEEK\_WEDNESDAY</code></li><li><code>DAY\_OF\_WEEK\_THURSDAY</code></li><li><code>DAY\_OF\_WEEK\_FRIDAY</code></li><li><code>DAY\_OF\_WEEK\_SATURDAY</code></li><li><code>DAY\_OF\_WEEK\_SUNDAY</code></li></ul>                                                                                                                                                                            |
| `meal_templates` | array  | Includes mapping details of different meal-types with day slots, which means what type of meals should be generated to which slot in a day. For more information, see the array break-up below. | <p><code>"meal\_templates": \[</code> <br>   <code>{</code> <br>     <code>"meal\_type": "MEAL\_TYPE\_BREAKFAST",</code>          <br>     <code>"day\_slot": 3</code> <br>   <code>},</code> <br>   <code>{</code> <br>     <code>"meal\_type": "MEAL\_TYPE\_LUNCH",</code> <br>     <code>"day\_slot": 4</code></p><p>   <code>},</code><br>   <code>{</code> <br>     <code>"meal\_type": "MEAL\_TYPE\_DINNER",</code> <br>     <code>"day\_slot": 5</code><br>   <code>}</code><br><code>]</code></p> |

The **`meal_templates`** array contains the following attributes:

| Attribute   | Type    | Description                                                                                                                                                                                                                                                                                                                                | Example Value                                                                                                                       |
| ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `meal_type` | string  | The different types of meal that you may have during the day. These meal-types are independent of day slots and can be assigned to any day slot as required. Additionally, the meal-types are also independent of recipe labels, which means you can have a meal-type as Lunch but inside it, you can use a Breakfast recipe for the meal. | <ul><li><code>MEAL\_TYPE\_BREAKFAST</code></li><li><code>MEAL\_TYPE\_LUNCH</code></li><li><code>MEAL\_TYPE\_DINNER</code></li></ul> |
| `day_slot`  | integer | Indicates a slot within the day to consume a meal. As part of your meal plan, you can as many as 7 slots in a day dedicated to different meal-types.                                                                                                                                                                                       | `3`                                                                                                                                 |

#### `food_settings`

```javascript
"food_settings": {
  "labels": [
    {
      "label": {
        "diet": "DIET_VEGETARIAN",
        "category": [
          "CATEGORY_QUICK_AND_EASY",
          "CATEGORY_HEALTHY_RECIPES",
          "CATEGORY_HOLIDAYS_AND_EVENTS"
        ],
        "avoidance": "AVOIDANCE_ALCOHOL",
        "cuisine": [
          "CUISINE_EUROPEAN",
          "CUISINE_WORLD_CUISINE"
        ],
        "meal_type": [
          "MEAL_TYPE_BREAKFAST",
          "MEAL_TYPE_BRUNCH",
          "MEAL_TYPE_DESSERTS",
          "MEAL_TYPE_DINNER"
        ],
        "nutrition": "NUTRITION_HEALTHY",
        "feature": "video",
        "holiday": "HOLIDAY_INVALID",
        "seasonality": "SEASONALITY_INVALID"
      },
      "boost": true
    }
  ],
  "include_ingredients": {
    "raw_ingredients": [
      {
        "name": "Tomato"
      }
    ],
    "min_ingredients_should_match": 1
  },
  "health_score": {
    "from": 4
  }
}
```

| Attribute             | Type  | Description                                                                                                                                                                                                                                                                                                                                                                                              | Example Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `labels`              | array | Labels specific to the user's preferences for filtering recipes. For more information, see the array break-up below.                                                                                                                                                                                                                                                                                     | <p><code>"labels": \[</code><br>  <code>{</code> <br>    <code>"label": {</code> <br>      <code>"diet": "DIET\_VEGETARIAN",</code><br>      <code>"category": "CATEGORY\_QUICK\_AND\_EASY",</code> <br>      <code>"avoidance": "AVOIDANCE\_ALCOHOL",</code> <br>      <code>"cuisine": "CUISINE\_EUROPEAN",</code><br>      <code>"meal\_type": "MEAL\_TYPE\_BREAKFAST",</code> <br>      <code>"nutrition": "NUTRITION\_HEALTHY",</code><br>      <code>"feature": "video",</code> <br>      <code>"holiday": "HOLIDAY\_THANKSGIVING\_DAY",</code> <br>      <code>"seasonality": "SEASONALITY\_WINTER"</code><br>  <code>},</code> <br>  <code>"boost": true</code> <br><code>}</code></p> |
| `include_ingredients` | array | Includes information on any specific ingredients and the number of ingredients to be considered for filtering recipes for the meal plan. For more information, see the array break-up below.                                                                                                                                                                                                             | <p><code>"include\_ingredients": {</code> <br>    <code>"raw\_ingredients": \[</code><br>        <code>{</code> <br>          <code>"name": "Tomato"</code> <br>        <code>}</code><br>     <code>],</code><br><code>"min\_ingredients\_should\_match": 1</code> <br><code>},</code></p>                                                                                                                                                                                                                                                                                                                                                                                                    |
| `health_score`        | array | <p>Includes the minimum health score to be considered for filtering recipes for the meal plan. <br>Health Scores are calculated on a 2 to 10 scale based on nutrient density and USDA recommendations for a healthy diet. A higher Health Score means healthier food. For more information, see <a href="../../../resources/health-score-glycemic-index-glycemic-load#health-score">Heath Score</a>.</p> | <p><code>"health\_score": {</code> <br>     <code>"from": 4</code> <br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

The **`labels`** array contains the following attributes:

| Attribute | Type    | Description                                                                                                                           | Example Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `label`   | array   | A list of labels of different categories.  For more information, see [Labels](https://docs.whisk.com/resources/recipe-labels#labels). | <p><code>"label": {</code> <br>      <code>"diet": "DIET\_VEGETARIAN",</code><br>      <code>"category": "CATEGORY\_QUICK\_AND\_EASY",</code> <br>      <code>"avoidance": "AVOIDANCE\_ALCOHOL",</code> <br>      <code>"cuisine": "CUISINE\_EUROPEAN",</code><br>      <code>"meal\_type": "MEAL\_TYPE\_BREAKFAST",</code> <br>      <code>"nutrition": "NUTRITION\_HEALTHY",</code><br>      <code>"feature": "video",</code> <br>      <code>"holiday": "HOLIDAY\_THANKSGIVING\_DAY",</code> <br>      <code>"seasonality": "SEASONALITY\_WINTER"</code><br>  <code>},</code></p> |
| `boost`   | boolean | Controls the filtering approach.                                                                                                      | <ul><li>The attribute is set as <code>true</code> to casually filter the recipes based on the specified labels. This means that the recipes that match with the specified labels would be preferred over the others but the final results would include both matched and unmatched recipes.</li><li>The attribute is set as<code>false</code> to strictly filter only those recipes that match with the specified labels. </li></ul>                                                                                                                                                 |

The **`include_ingredients`** array contains the following attributes:

| Attribute                      | Type    | Description                                                                                                                                                                                                                                                                                                                             | Example Value                                                                                                                              |
| ------------------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `raw_ingredients`              | string  | A name of a particular ingredient to match while filtering recipes.                                                                                                                                                                                                                                                                     | <p><code>"raw\_ingredients": \[</code><br>  <code>{</code> <br>   <code>"name": Tomato"</code> <br>  <code>}</code><br><code>],</code></p> |
| `min_ingredients_should_match` | integer | <p>Indicates the minimum number of ingredients that must match while filtering recipes.<br>If the value specified is greater than <code>0</code>, the result includes recipes, which have at least the specified number of ingredients. And, if it is set as <code>0</code>, recipes with more matched ingredients are prioritized.</p> | `0`                                                                                                                                        |

#### **`custom_labels`**

```javascript
"custom_labels": {
  "everywhere": {
    "in": [
      {
        "group": "",
        "label": ""
      }
    ],
    "boost_in": [
      {
        "group": "",
        "label": ""
      }
    ],
    "all": [
      {
        "group": "",
        "label": ""
      }
    ],
    "not": [
      {
        "group": "",
        "label": ""
      }
    ]
  },
  "in_recipe": {
    ...
  },
  "in_ingredients": {
    ...
  },
  "in_instruction_steps": {
    ...
  }
}
```

{% hint style="info" %}
**Note**: These labels are generally created in the **Whisk Studio** application and are left blank while managing meal plan settings using the Whisk API.
{% endhint %}

To learn how to pull or update meal plan settings, read the following endpoints' documentation:

{% content-ref url="get-meal-plan-settings/get-meal-plan-settings" %}
[get-meal-plan-settings](https://docs.whisk.com/api/meal-plans/get-meal-plan-settings/get-meal-plan-settings)
{% endcontent-ref %}

{% content-ref url="get-meal-plan-settings/update-meal-plan-settings" %}
[update-meal-plan-settings](https://docs.whisk.com/api/meal-plans/get-meal-plan-settings/update-meal-plan-settings)
{% endcontent-ref %}
