This endpoint can be used to delete one or more contacts.
The query parameter ids
must set to a comma-separated list of contact IDs for bulk contact deletion.
The query parameter delete_all_contacts
must be set to "true"
to delete all contacts.
You must set either ids
or delete_all_contacts
.
Deletion jobs are processed asynchronously.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
Bearer <<YOUR_API_KEY_HERE>>
Must be set to "true"
to delete all contacts.
A comma-separated list of contact IDs.
The deletion job has been accepted and is being processed.
The deletion job ID.
1const client = require('@sendgrid/client');2client.setApiKey(process.env.SENDGRID_API_KEY);34const queryParams = {5"delete_all_contacts": "true"6};78const request = {9url: `/v3/marketing/contacts`,10method: 'DELETE',11qs: queryParams12}1314client.request(request)15.then(([response, body]) => {16console.log(response.statusCode);17console.log(response.body);18})19.catch(error => {20console.error(error);21});
1const client = require('@sendgrid/client');2client.setApiKey(process.env.SENDGRID_API_KEY);34const queryParams = {5"ids": "1, 2"6};78const request = {9url: `/v3/marketing/contacts`,10method: 'DELETE',11qs: queryParams12}1314client.request(request)15.then(([response, body]) => {16console.log(response.statusCode);17console.log(response.body);18})19.catch(error => {20console.error(error);21});