# updatePrintTemplate mutation


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

Updates a print template's name, language, body or default flag. Call it to change a template
of your own. A field you omit keeps its value.

- Requires the `company.write` permission on an API key that no legal-entity scope narrows.
- `NOT_FOUND` when the template does not exist.
- `VALIDATION` with reason `ARCHIVED` when the template is archived. Restore it with
  [`setPrintTemplateArchived`](/chameleoon-max/mutation/set-print-template-archived) first.
- The `body` is checked as in [`createPrintTemplate`](/chameleoon-max/mutation/create-print-template), with the same errors.
- `CONFLICT` with reason `DUPLICATE_NAME` or `DEFAULT_TAKEN`, as in
  [`createPrintTemplate`](/chameleoon-max/mutation/create-print-template).

## Arguments

- `input`: [`UpdatePrintTemplateInput!`](/chameleoon-max/type/update-print-template-input) · required

## Returns

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

## Example

**Mutation**

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

**Variables**

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

**Response**

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