Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Get All Lists



API Overview

api-overview page anchor

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

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


Authentication

authentication page anchor
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
page_sizenumber

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

Minimum: 1Maximum: 1000Default: 100

page_tokenstring
200
SchemaExample
resultarray[object]

_metadataobject

Get All Lists

get-all-lists page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_21
const client = require('@sendgrid/client');
_21
client.setApiKey(process.env.SENDGRID_API_KEY);
_21
_21
const queryParams = {
_21
"page_size": 100
_21
};
_21
_21
const request = {
_21
url: `/v3/marketing/lists`,
_21
method: 'GET',
_21
qs: queryParams
_21
}
_21
_21
client.request(request)
_21
.then(([response, body]) => {
_21
console.log(response.statusCode);
_21
console.log(response.body);
_21
})
_21
.catch(error => {
_21
console.error(error);
_21
});


Rate this page: