Get All Lists



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(link takes you to an external page). For more information about lists and best practices for building them, see "Building your Contact List".


GET/v3/marketing/lists

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

This endpoint returns an array of all of your contact lists.


Property nameTypeRequiredDescription
authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
pageSizenumber

Optional

Maximum number of elements to return. Defaults to 100, returns 1000 max

Default: 100Minimum: 1Maximum: 1000

pageTokenstring

Optional

200
SchemaExample
Property nameTypeRequiredDescriptionChild properties
resultarray[list]

Optional


Metadatametadata

Optional

1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const queryParams = { page_size: 100 };
5
6
const request = {
7
url: `/v3/marketing/lists`,
8
method: "GET",
9
qs: queryParams,
10
};
11
12
client
13
.request(request)
14
.then(([response, body]) => {
15
console.log(response.statusCode);
16
console.log(response.body);
17
})
18
.catch((error) => {
19
console.error(error);
20
});