Lists are static collections of Marketing Campaigns contacts. This API allows you to interact with the list objects themselves. To add contacts to a list, you must use the Contacts API.
You can also manage your lists using the Contacts menu in the Marketing Campaigns UI. For more information about lists and best practices for building them, see "Building your Contact List".
This endpoint allows you to remove contacts from a given list.
The contacts will not be deleted. Only their list membership will be changed.
Bearer <<YOUR_API_KEY_HERE>>
The ID of the list on which you want to perform the operation.
Comma separated list of contact IDs that you want to remove from the specified contacts list.
1
The removal is accepted and processing.
job_id of the async job
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const id = "ZGkrHSypTsudrGkmdpJJ";5const queryParams = {6contact_ids: "GkrHSypTsudrGkmdpJJ",7};89const request = {10url: `/v3/marketing/lists/${id}/contacts`,11method: "DELETE",12qs: queryParams,13};1415client16.request(request)17.then(([response, body]) => {18console.log(response.statusCode);19console.log(response.body);20})21.catch((error) => {22console.error(error);23});