Documentation Center

delete<TYPE> mutation

Use the deleteTYPE GraphQL mutation to delete entities from the external CRM system.

Mutation syntax

The following code illustrates required format for the GraphQL request, followed by a description of the input values:

mutation {
  deleteTYPE(identity: {
                namespace: "NAMESPACE",
                id: "IDENTIFIER",
                type: "TYPE"
             } ) 
   {
       RESPONSE_FIELD_1
       RESPONSE_FIELD_2
       RESPONSE_FIELD_n
   }
}

Fields and inputs

deleteTYPE
The operation to be performed by the mutation (delete) and the type of entity to be acted upon. The TYPE is the entity type and matches the TYPE value in the identity section.
identity
The identity object is formed from the following field values to uniquely identify the entity to be deleted:
namespace
Where NAMESPACE is that of the external entity.
id
Where IDENTIFIER is the unique identifier provided by the external system.
type
Where TYPE refers to the external entity type.
localId
Where LOCAL_ID can be either a Publication ID or a locale string, such as 'en' or 'sv-se', which identifies a locale-specific variant of the entity.
Response fields
Fields at the end of the request identify data that you want to return in the response following a successful delete operation.

You can use one or more of the previously described identity fields as well as structureType (the type of element in the structure).

Example request and response

The first sample code block illustrates a request to to delete details for a Contact entity. The second code block illustrates the corresponding response with a confirmation of the deleted Contact's identity.

RequestResponse
mutation {
  deleteContact(
    identity: {
      namespace: "salesforce"
      id: "0033Y00002pvAjuQAE"
      type: "Contact"
    } ) 
  {
    id
  }
}
{
  "data": {
    "deleteContact": {
      "id": "0033Y00002pvAjuQAE"
    }
  }
}