# Update User's Program

Use the `updateUserProgram` mutation to update the information of the user's program.

A list of all programs can be obtained using the [program ](/graphql/query/queries/program/programs.md#all-programs)query.

### Required Argument

| Argument    | Type | Description                                                       |
| ----------- | ---- | ----------------------------------------------------------------- |
| `programId` | ID   | The ID of a [program](/graphql/query/queries/program/programs.md) |

## Examples

### GraphQL Example

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

```graphql
mutation {
  updateUserProgram(
    programId: "UHJvZ3JhbTowYWQ0ZTc3YS04ZWRhLTRlOWItYWM4ZS0xYzg0YTJlOGJiNDI="
  ) {
    success
    message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "updateUserProgram": {
      "success": true,
      "message": "User's program was successfully updated"
    }
  }
}
```

{% endtab %}
{% endtabs %}

### cURL Example (with API Token)

```javascript
curl/-XPOST 'https://production.suggestic.com/graphql' \
-H 'Authorization: Token <API-Token>' \
-H 'SG-User: <user-id>' \
-H 'Content-Type: application/json' \
--data-raw {"query":"mutation {updateUserProgram(programId:\"<PROGRAM ID>\"){ success message } }"}
```

### cURL Example (with Bearer Token)

{% tabs %}
{% tab title="curl Example" %}

```java
curl -XPOST 'https://production.suggestic.com/graphql' \
  -H 'Authorization: Bearer <User-JWT>' \
  -H 'Content-Type: application/json' \
  --data-raw {"query":"mutation {updateUserProgram(programId:\"<PROGRAM ID>\"){ success message } }"}

```

{% endtab %}
{% endtabs %}


---

# 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.suggestic.com/graphql/query/mutations/user-profile/set-program.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.
