To delete a contact from an audience, use the deleteContacts mutation. This operation is permanent and irreversible. All data associated with the contact will be deleted.

mutation deleteContact {
  deleteContacts(
    where: {
      dataSetId: "4fe4136f-c007-44a3-b38f-92220xxxxxxxx"
      keyList: "PISCX-098724242434"
      deleteReason: RIGHT_TO_BE_FORGOTTEN
    }
  ) {
    deletedCount
  }
}
{
  "data": {
    "deleteContacts": {
      "deletedCount": 1
    }
  }
}

Use an array to delete multiple contacts simultaneously.

mutation deleteContacts {
  deleteContacts(
    where: {
      dataSetId: "4fe4136f-c007-44a3-b38f-92220xxxxxxxx"
      keyList: ["PISCX-098724242434", "PISCX-098724242433", "PISCX-0987240000220"]
      deleteReason: USER_REQUEST
    }
  ) {
    deletedCount
  }
}
{
  "data": {
    "deleteContacts": {
      "deletedCount": 3
    }
  }
}

Arguments

Arguments supported by the deleteContacts mutation

Argument nameNested field - level 1ValuesRequired?Definition
wheredataSetIdIDRequiredThe ID of your audience
deleteReasonOne of the following values:

- USER_REQUEST
- DEPROVISIONING
- RIGHT_TO_BE_FORGOTTEN
Required The reason why the contact is being deleted
keyListString or array of string RequiredUnique identifiers assigned to the contacts

Fields

Fields returned by the deleteContacts mutation

FieldValuesRequired?Definition
deletedCountIntegerRequiredThe number of contacts deleted

Possible error messages

Error codeDefinition
CONTACT_DELETE_FAILED