Skip to contentSkip to navigationSkip to topbar
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 (The Twilio SendGrid v3 API)

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
authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
contactIdstring
required

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

Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
identifierTypeenum<string>
required

The type of identifier you are removing from the contact.

Possible values:
EMAILPHONENUMBERIDEXTERNALIDANONYMOUSID

identifierValuestring
required

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
jobIdobject

Optional

The deletion job ID.

Delete a Contact IdentifierLink to code sample: Delete a Contact Identifier
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const contact_id = "contact_id";
5
const data = {
6
identifier_type: "PHONENUMBERID",
7
identifier_value: "15555555555",
8
};
9
10
const request = {
11
url: `/v3/marketing/contacts/${contact_id}/identifiers`,
12
method: "DELETE",
13
body: data,
14
};
15
16
client
17
.request(request)
18
.then(([response, body]) => {
19
console.log(response.statusCode);
20
console.log(response.body);
21
})
22
.catch((error) => {
23
console.error(error);
24
});