# removePartnerExternalRef mutation


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

Removes the partner's reference in an external source. Call it when the partner's record in
your system no longer matches this partner.

- Returns `changed: false` when the partner had no reference in the external source.
- Works for an archived external source too.
- An erased partner's reference can be removed.
- Permissions and `NOT_FOUND` are otherwise as in [`setPartnerExternalRef`](/chameleoon-max/mutation/set-partner-external-ref).

> An error whose path runs below this field does not mean the call failed: the reference was
> removed, so do not retry. See [`Mutation`](/chameleoon-max/mutations).

## Arguments

- `id`: [`UUID!`](/chameleoon-max/type/uuid) · required
- `source`: `String!` · required

## Returns

[`PartnerExternalRefResult!`](/chameleoon-max/type/partner-external-ref-result)

## Example

**Mutation**

```graphql
mutation removePartnerExternalRef($id: UUID!, $source: String!) {
  removePartnerExternalRef(id: $id, source: $source) {
    partner {
      id
      code
      name
      registrationId
      taxId
      vatId
    }
    changed
  }
}
```

**Variables**

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

**Response**

```json
{
  "data": {
    "removePartnerExternalRef": {
      "partner": {
        "id": "00000000-0000-4000-8000-000000000001",
        "code": "example",
        "name": "example",
        "registrationId": "example",
        "taxId": "example",
        "vatId": "example"
      },
      "changed": true
    }
  }
}
```

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