> For the complete documentation index, see [llms.txt](https://docs.whisk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.whisk.com/api/meal-plans/get-meal-plan-settings/get-meal-plan-settings.md).

# Get Meal Plan Settings

If you ever want to fetch and see all the crucial configuration based on which your meal plan is being generated, you must use the following endpoint as described here.

The Meal Plan API provides you two endpoints that allow you to get the meal plan settings. The only difference between the two is that one of them requires a `{meal_plan_id}` and the other doesn't. This arrangement has been made for a future planned feature of supporting multiple meal plans for every user.

While at the moment, since Whisk only supports a single meal plan per user, the  `{meal_plan_id}` has been kept optional for both endpoints. You can leave it blank and it would be directly derived from the user token being used for API authentication.

## Meal Plan Settings

<mark style="color:blue;">`GET`</mark> `https://api.whisk.com/mealplan/v2/settings`

This endpoint allows you to get the meal plan settings.

#### Path Parameters

| Name           | Type   | Description                                                                                                                              |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| meal\_plan\_id | string | The meal-plan identifier. You can leave it blank and it would be directly derived from the user token being used for API authentication. |

{% tabs %}
{% tab title="200 This how a successful get meal plan settings response looks like. To understand its data structure, see the Meal Plan Settings topic." %}

```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": {
    ...
  }
}
```

{% endtab %}

{% tab title="400 This failed response appears when specific error codes are found in the endpoint description." %}

```javascript
{
  "error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
  "message": "Additional details about error are not static and can be changed"
}
```

{% endtab %}

{% tab title="401 This failed response appears when API authentication gets failed. The possible error codes that may appear are: auth.tokenNotFound auth.tokenExpired auth.tokenInvalid auth.tokenRequired" %}

```javascript
{
  "code": "auth.tokenNotFound"
}
```

{% endtab %}

{% tab title="500 This failed response appears when something is not right at Whisk's end." %}

```javascript
This is unexpected response, something is wrong on our side, please contact: help@whisk.com
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note**: Whisk provides its APIs on the Swagger interface for you to try it out. You can call this endpoint [here](https://api.whisk.com/spec/#/MealPlanAPI/MealPlanAPI_GetMealPlanSettings2).
{% endhint %}

## Meal Plan Settings

<mark style="color:blue;">`GET`</mark> `https://api.whisk.com/mealplan/v2/{meal_plan_id}/settings`

This endpoint allows you to get the meal plan settings.

#### Path Parameters

| Name           | Type   | Description               |
| -------------- | ------ | ------------------------- |
| meal\_plan\_id | string | The meal-plan identifier. |

{% tabs %}
{% tab title="200 This how a successful get meal plan settings response looks like. To understand its data structure, see the Meal Plan Settings topic." %}

```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": {
    ...
  }
}
```

{% endtab %}

{% tab title="400 This failed response appears when specific error codes are found in the endpoint description." %}

```javascript
{
  "error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
  "message": "Additional details about error are not static and can be changed"
}
```

{% endtab %}

{% tab title="401 This failed response appears when API authentication gets failed. The possible error codes that may appear are: auth.tokenNotFound auth.tokenExpired auth.tokenInvalid auth.tokenRequired" %}

```javascript
{
  "code": "auth.tokenNotFound"
}
```

{% endtab %}

{% tab title="500 This failed response appears when something is not right at Whisk's end." %}

```javascript
This is unexpected response, something is wrong on our side, please contact: help@whisk.com
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note**: Whisk provides its APIs on the Swagger interface for you to try it out. You can call this endpoint [here](https://api.whisk.com/spec/#/MealPlanAPI/MealPlanAPI_GetMealPlanSettings).
{% endhint %}

#### Curl Call Example

```bash
curl -X GET "https://api.whisk.com/mealplan/v2/settings" 
     -H "accept: application/json" 
     -H "Authorization: Bearer <Access-Token>"
```
