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>>
Optional
Must be set to "true"
to delete all contacts.
Optional
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 = {5delete_all_contacts: "true",6};78const request = {9url: `/v3/marketing/contacts`,10method: "DELETE",11qs: queryParams,12};1314client15.request(request)16.then(([response, body]) => {17console.log(response.statusCode);18console.log(response.body);19})20.catch((error) => {21console.error(error);22});
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const queryParams = {5ids: "1, 2",6};78const request = {9url: `/v3/marketing/contacts`,10method: "DELETE",11qs: queryParams,12};1314client15.request(request)16.then(([response, body]) => {17console.log(response.statusCode);18console.log(response.body);19})20.catch((error) => {21console.error(error);22});