Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Delete a Contact Identifier



Operation overview

operation-overview page anchor

DELETE/v3/marketing/contacts/{contact_id}/identifiers

Base url: https://api.sendgrid.com

This endpoint can be used to delete one identifier from a contact.

Deletion jobs are processed asynchronously.

Note this is different from deleting a contact. If the contact has only one identifier, the asynchronous request will fail. All contacts are required to have at least one identifier.

The request body field identifier_type must have a valid value of "EMAIL", "PHONENUMBERID", "EXTERNALID", or "ANONYMOUSID".


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
contact_idstringrequired

Must be set to the contact_id of the contact you want to remove the identifier from.

SchemaExample
Property nameTypeRequiredDescriptionChild properties
identifier_typestringrequired

A type of the following: EMAIL, PHONENUMBERID, EXTERNALID, or ANONYMOUSID.


identifier_valuestringrequired

The value of the identifier you want to remove from the contact.

202400401403404500

Indicates that the deletion is queued for processing. Check the job status with the Import Contacts Status endpoint.

Schema
Property nameTypeRequiredDescriptionChild properties
job_idobject

The deletion job ID.

Delete a Contact Identifier

delete-a-contact-identifier page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_23
const client = require('@sendgrid/client');
_23
client.setApiKey(process.env.SENDGRID_API_KEY);
_23
_23
const contact_id = "ZGkrHSypTsudrGkmdpJJ";
_23
const data = {
_23
"identifier_type": "PHONENUMBERID",
_23
"identifier_value": "+15555555555"
_23
};
_23
_23
const request = {
_23
url: `/v3/marketing/contacts/${contact_id}/identifiers`,
_23
method: 'DELETE',
_23
body: data
_23
}
_23
_23
client.request(request)
_23
.then(([response, body]) => {
_23
console.log(response.statusCode);
_23
console.log(response.body);
_23
})
_23
.catch(error => {
_23
console.error(error);
_23
});


Rate this page: