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 name | Nested field - level 1 | Values | Required? | Definition |
---|---|---|---|---|
where | dataSetId | ID | Required | The ID of your audience |
deleteReason | One of the following values: - USER_REQUEST - DEPROVISIONING - RIGHT_TO_BE_FORGOTTEN | Required | The reason why the contact is being deleted | |
keyList | String or array of string | Required | Unique identifiers assigned to the contacts |
Fields
Fields returned by the deleteContacts
mutation
Field | Values | Required? | Definition |
---|---|---|---|
deletedCount | Integer | Required | The number of contacts deleted |
Possible error messages
Error code | Definition |
---|---|
CONTACT_DELETE_FAILED |