# setPrintTemplateArchived mutation


`setPrintTemplateArchived` 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 or restores a print template. Call it to take a template out of use without deleting
it.

- Requires the `company.write` permission on an API key that no legal-entity scope narrows.
- An archived template leaves the list and is never the default. When it was the default, the
  MAX built-in template prints in its place.
- A restored template is not made the default again.
- The name of an archived template does not block a new template.
- `CONFLICT` with reason `DUPLICATE_NAME` when you restore a template whose name an active
  template now has.

## Arguments

- `input`: [`SetPrintTemplateArchivedInput!`](/chameleoon-max/type/set-print-template-archived-input) · required

## Returns

[`PrintTemplate!`](/chameleoon-max/type/print-template)

## Example

**Mutation**

```graphql
mutation setPrintTemplateArchived($input: SetPrintTemplateArchivedInput!) {
  setPrintTemplateArchived(input: $input) {
    id
    kind
    syntax
    output
    language
    name
    isDefault
    bodyBytes
    body
    archivedAt
    createdAt
    updatedAt
  }
}
```

**Variables**

```json
{
  "input": {
    "id": "00000000-0000-4000-8000-000000000001",
    "archived": true
  }
}
```

**Response**

```json
{
  "data": {
    "setPrintTemplateArchived": {
      "id": "00000000-0000-4000-8000-000000000001",
      "kind": "SALES_ORDER",
      "syntax": "JSON",
      "output": "PDF",
      "language": "example",
      "name": "example",
      "isDefault": true,
      "bodyBytes": 1,
      "body": "example",
      "archivedAt": "2026-01-01T00:00:00Z",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```

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