# updateTagGroup mutation


`updateTagGroup` is a GraphQL mutation of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Changes a live tag group, named by its code. Fields you leave out stay as they are.

#### Permissions

Requires the `tag.manage` permission.

#### Errors

- `NOT_FOUND` when no tag group has the code.
- `VALIDATION` as in [`createTagGroup`](/chameleoon-max/mutation/create-tag-group).
- `CONFLICT` with reason `TAG_GROUP_CONFLICT` when `exclusive` turns `true` while records hold two
  of the group's tags. The message says how many; take one off first.

## Arguments

- `code`: `String!` · required
- `input`: [`UpdateTagGroupInput!`](/chameleoon-max/type/update-tag-group-input) · required

## Returns

[`TagGroup!`](/chameleoon-max/type/tag-group)

## Example

**Mutation**

```graphql
mutation updateTagGroup($code: String!, $input: UpdateTagGroupInput!) {
  updateTagGroup(code: $code, input: $input) {
    code
    name
    exclusive
    automationOnly
    archived
    description
    agendas
    sortOrder
  }
}
```

**Variables**

```json
{
  "code": "example",
  "input": {}
}
```

**Response**

```json
{
  "data": {
    "updateTagGroup": {
      "code": "example",
      "name": "example",
      "exclusive": true,
      "automationOnly": true,
      "archived": true,
      "description": "example",
      "agendas": [
        "SALES_ORDER"
      ],
      "sortOrder": 1
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
