# Create Meal Plan Template

Use the `createMealPlanTemplate` mutation to create a meal plan template depending on your custom dietary requirements.

{% hint style="info" %}
It is required to use only the `Authorization: Token <api-token>` to execute this query.&#x20;
{% endhint %}

### Meal Plan templates types

There are 3 options to create a meal plan template:

* [`customOptions`](https://docs.suggestic.com/graphql/query/mutations/meal-plan/create-meal-plan-template/custom-options): Send the parameters in the same way as if the `customMealPlan` sends. The meal plan generated is saved in this template.
* [`fromDays`](https://docs.suggestic.com/graphql/query/mutations/meal-plan/create-meal-plan-template/from-days): Copy an existing meal plan which has a user assigned. Send a `profileId` and user's meal plan days required to be copied and saved in the template.
* [`fromScratch`](https://docs.suggestic.com/graphql/query/mutations/meal-plan/create-meal-plan-template/from-scratch): Send a complete meal plan and define the number of days of it. All the parameters such as **days**, **recipes**, etc., have to be introduced manually. All this information is later saved as a template.

### How a meal plan template works:

* Create a meal plan template according to your requirements. You can choose any of the 3 types o meal templates mentioned above.
* [List all available meal plan templates](https://docs.suggestic.com/graphql/query/search/meal-plan-template-search) to get its id to either assign it to a user or generate a meal plan based on its id.
* [Assign](https://docs.suggestic.com/graphql/query/mutations/assign-a-meal-plan-template-to-a-user#required-arguments) a meal plan template to a user.
* [Generate a meal plan](https://docs.suggestic.com/graphql/query/mutations/meal-plan/generate-meal-plan#generate-a-meal-plan-based-on-a-meal-plan-template) based on a meal plan template created.

### Available arguments

<table><thead><tr><th align="center">Argument Name</th><th width="231" align="center">Type</th><th width="150" align="center">Is Required?</th><th>Description</th></tr></thead><tbody><tr><td align="center"><strong>Argument Name</strong></td><td align="center"><strong>Type</strong></td><td align="center"><strong>Is required?</strong></td><td><strong>Description</strong></td></tr><tr><td align="center"><code>coach</code></td><td align="center">Id</td><td align="center">no</td><td>Unique Id of the Coach. Use this if the third party has access to the Coaching Portal</td></tr><tr><td align="center"><code>customOption</code></td><td align="center"><a href="https://docs.suggestic.com/graphql/objects/meal-plan/meal-plan-template#mptcustomoptionsinput-object">MPTCustomOptionsInput</a></td><td align="center">no</td><td>Object that sends the parameters as if it were using the customMealPlan</td></tr><tr><td align="center"><code>description</code></td><td align="center">String</td><td align="center">yes</td><td>Introduce the description of the meal plan template. It can be an empty string.</td></tr><tr><td align="center"><code>fromDays</code></td><td align="center"><a href="https://docs.suggestic.com/graphql/objects/meal-plan/meal-plan-template#mptfromdaysinput-object">MPTFromDaysInput</a></td><td align="center">no</td><td>Object that includes all the required fields to copy an existing meal plan.</td></tr><tr><td align="center"><code>fromScratch</code></td><td align="center"><a href="https://docs.suggestic.com/graphql/objects/meal-plan/meal-plan-template#mptfromscratchinput-object">MPTFromScratchInput</a></td><td align="center">no</td><td>Object that includes all the fields to create a meal plan from scratch.</td></tr><tr><td align="center"><code>isPublic</code></td><td align="center">Boolean</td><td align="center">no</td><td>True if a coach wants to make the template visible to other coaches. Use this field if the third party has access to the coaching portal</td></tr><tr><td align="center"><code>name</code></td><td align="center">String</td><td align="center">yes</td><td>Name of the meal plan template.  It can be an empty string.</td></tr></tbody></table>

###
