This endpoint is used to retrieve a set of contacts identified by their IDs.
This can be more efficient endpoint to get contacts than making a series of individual GET
requests to the "Get a Contact by ID" endpoint.
You can supply up to 100 IDs. Pass them into the ids
field in your request body as an array or one or more strings.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
Bearer <<YOUR_API_KEY_HERE>>
application/json
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const data = {5ids: ["1234", "1235"],6};78const request = {9url: `/v3/marketing/contacts/batch`,10method: "POST",11body: data,12};1314client15.request(request)16.then(([response, body]) => {17console.log(response.statusCode);18console.log(response.body);19})20.catch((error) => {21console.error(error);22});