> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/mutations/wellness-plans/update-user-supplement-plan.md).

# Update user supplement plan

Use `updateSupplementPlan` to update user supplement plan.

## Required Arguments

| Argument                                    | Type                      | Description                                                                         |
| ------------------------------------------- | ------------------------- | ----------------------------------------------------------------------------------- |
| `name`                                      | String!                   | Supplement plan name.                                                               |
| `isActive`                                  | Boolean!                  | ***True*** sets the supplement plan active for the user, otherwise ***False***.     |
| `visibility`                                | Boolean!                  | ***True*** makes the supplement plan visible for the user, otherwise ***False***.   |
| `coach`                                     | ID!                       | Id of Coach.                                                                        |
| `startDate`                                 | Date!                     | Sets the starting date for the supplement plan. YYYY-MM-DD                          |
| `nutrition`                                 | String                    | Open text field.                                                                    |
| `resources`                                 | String                    | Open text field.                                                                    |
| `overview`                                  | String                    | Open text field.                                                                    |
| `exercise`                                  | String                    | Open text field.                                                                    |
| `supplements`                               | \[Supplements]            | Supplement or list of supplements.                                                  |
| `supplements.supplementId`                  | ID!                       | Id of supplement.                                                                   |
| `supplements.length`                        | Int!                      | Length duration of supplement.                                                      |
| `supplements.directionsOfUse`               | SupplementDirection!      | Direction of use for supplement.                                                    |
| `supplements.directionsOfUse.quantity`      | Float!                    | Supplement quantity.                                                                |
| `supplements.directionsOfUse.timeOfDay`     | TimeOfDay!                | enum TimeOfDay { AT\_BEDTIME AT\_WAKING WITH\_BREAKFAST WITH\_DINNER WITH\_LUNCH }. |
| `supplements.<DAYOFWEEK>`                   | Boolean!                  | Can be any day of the week ex. `sunday: true`                                       |
| `updateProtocols`                           | \[SupplementPlanProtocol] | Protocol or list of protocols.                                                      |
| `updateProtocols.protocolId`                | ID!                       | Id of Protocol.                                                                     |
| `updateProtocols.isActive`                  | Boolean!                  | ***True*** sets the protocol active for the user, otherwise ***False***.            |
| `updateProtocols.directionsOfUse`           | SupplementDirection!      | Direction of use for protocol.                                                      |
| `updateProtocols.directionsOfUse.quantity`  | Float!                    | Protocol quantity.                                                                  |
| `updateProtocols.directionsOfUse.timeOfDay` | TimeOfDay                 | enum TimeOfDay { AT\_BEDTIME AT\_WAKING WITH\_BREAKFAST WITH\_DINNER WITH\_LUNCH }. |
| `updateProtocols.<DAYOFWEEK>`               | Boolean!                  | Can be any day of the week ex. `sunday: true`                                       |

## Example

{% tabs %}
{% tab title="Query" %}

```graphql
mutation {
  updateSupplementPlan (
    input:{
      id:"U3VwcGxlbWVudFBsYW46MTY2NTc1"
      name:"Suggestic updated plan"
      isActive: false
      visibility: true
      coach:"Q29hY2g6NTA0Mw=="
      startDate:"2024-06-01"
      nutrition:"Placeholder Text"
      resources:"Placeholder Text"
      overview:"New Placeholder Text"
      exercise:"New Placeholder Text"
      updateProtocols:{protocolId:"UHJvdG9jb2w6MzA1NTc0" isActive:true directionsOfUse:{quantity:10 timeOfDay:AT_WAKING} wednesday:true monday: true}
      setSupplements:[{
        supplementId:"U3VwcGxlbWVudDo3OTEwNmQ1OC0zOTliLTRmODUtYjM4Yi1mNWM4NTFjMjViM2I="
	length:30
        directionsOfUse:{quantity:10 timeOfDay:WITH_BREAKFAST}
        saturday:true
      },{
        supplementId:"U3VwcGxlbWVudDpjYzI1YzZkNC0wNzYwLTRmNzItYTU4MS0xYmJhZmViYWY3Zjg="
	length:10
        directionsOfUse:{quantity:5 timeOfDay:WITH_DINNER}
        monday: true
        wednesday: true
        friday: false
      }],
    }
  ){
    success
    message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "updateSupplementPlan": {
      "success": true,
      "message": "Supplement plan updated"
    }
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/wellness-plans/update-user-supplement-plan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
