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 = {5"ids": [6"1234",7"1235"8]9};1011const request = {12url: `/v3/marketing/contacts/batch`,13method: 'POST',14body: data15}1617client.request(request)18.then(([response, body]) => {19console.log(response.statusCode);20console.log(response.body);21})22.catch(error => {23console.error(error);24});