Skip to contentSkip to navigationSkip to topbar
On this page

Get Batched Contacts by IDs



Operation overview

operation-overview page anchor

POST/v3/marketing/contacts/batch

Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)

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.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
idsarray[string]required
200401403404500
Schema
Property nameTypeRequiredDescriptionChild properties
resultarray[object]
Get Batched Contacts by IDsLink to code sample: Get Batched Contacts by IDs
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const data = {
5
ids: ["1234", "1235"],
6
};
7
8
const request = {
9
url: `/v3/marketing/contacts/batch`,
10
method: "POST",
11
body: data,
12
};
13
14
client
15
.request(request)
16
.then(([response, body]) => {
17
console.log(response.statusCode);
18
console.log(response.body);
19
})
20
.catch((error) => {
21
console.error(error);
22
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.