# archiveTag mutation


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

Archives a tag: it can no longer be added, and records that have it keep it. There is no
restore. Archiving an archived tag changes nothing.

#### Permissions

Requires the `tag.manage` permission.

#### Errors

- `NOT_FOUND` when no tag has the code.

## Arguments

- `code`: `String!` · required

## Returns

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

## Example

**Mutation**

```graphql
mutation archiveTag($code: String!) {
  archiveTag(code: $code) {
    code
    name
    description
    archived
    agendas
    group {
      code
      name
      exclusive
      automationOnly
      archived
      description
    }
    colour
    icon
    sortOrder
  }
}
```

**Variables**

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

**Response**

```json
{
  "data": {
    "archiveTag": {
      "code": "example",
      "name": "example",
      "description": "example",
      "archived": true,
      "agendas": [
        "SALES_ORDER"
      ],
      "group": {
        "code": "example",
        "name": "example",
        "exclusive": true,
        "automationOnly": true,
        "archived": true,
        "description": "example"
      },
      "colour": "SLATE",
      "icon": "TAG",
      "sortOrder": 1
    }
  }
}
```

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