# createTagGroup mutation


`createTagGroup` 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).

Creates a tag group: a set of tags with shared settings.

- `exclusive`: a record holds at most one of the group's tags; adding another replaces it.
- `automationOnly`: people in MAX cannot add or remove its tags; API keys and integrations can.
- `agendas` default to sales orders, purchase orders and the three invoice registers; the
  group's tags take them.

#### Permissions

Requires the `tag.manage` permission.

#### Errors

- `VALIDATION` on `input.name` or `input.code` when blank, malformed or already used by a live
  group; on `input.agendas` when empty.

## Arguments

- `input`: [`CreateTagGroupInput!`](/chameleoon-max/type/create-tag-group-input) · required

## Returns

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

## Example

**Mutation**

```graphql
mutation createTagGroup($input: CreateTagGroupInput!) {
  createTagGroup(input: $input) {
    code
    name
    exclusive
    automationOnly
    archived
    description
    agendas
    sortOrder
  }
}
```

**Variables**

```json
{
  "input": {
    "name": "example"
  }
}
```

**Response**

```json
{
  "data": {
    "createTagGroup": {
      "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.
