> 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/user-profile/set-program.md).

# Update User's Program

Mutation used to set the current user to a desired 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 %}
