# removeInvoiceTag mutation


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

Takes a tag off the invoice. The tag is named by its code, as in [`addInvoiceTag`](/chameleoon-max/mutation/add-invoice-tag);
every tag on the invoice with that code is taken off, an archived one too.

#### Permissions

Requires the `invoice.read` and `invoice.write` permissions.

#### Repeated calls

A tag the invoice does not have, or a code no tag has, changes nothing and returns
`changed: false`.

#### Errors

- `VALIDATION` when the code is blank.
- `NOT_FOUND` when the invoice does not exist or your API key cannot see it.

## Arguments

- `ref`: [`InvoiceRefInput!`](/chameleoon-max/type/invoice-ref-input) · required
- `tag`: `String!` · required

## Returns

[`InvoiceTagsResult!`](/chameleoon-max/type/invoice-tags-result)

## Example

**Mutation**

```graphql
mutation removeInvoiceTag($ref: InvoiceRefInput!, $tag: String!) {
  removeInvoiceTag(ref: $ref, tag: $tag) {
    invoice {
      id
      direction
      kind
      status
      failureReason
      source
    }
    changed
  }
}
```

**Variables**

```json
{
  "ref": {
    "id": "00000000-0000-4000-8000-000000000001"
  },
  "tag": "example"
}
```

**Response**

```json
{
  "data": {
    "removeInvoiceTag": {
      "invoice": {
        "id": "00000000-0000-4000-8000-000000000001",
        "direction": "ISSUED",
        "kind": "INVOICE",
        "status": "PENDING",
        "failureReason": "example",
        "source": "example"
      },
      "changed": true
    }
  }
}
```

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