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. For more information about lists and best practices for building them, see "Building your Contact List".
This endpoint returns an array of all of your contact lists.
Bearer <<YOUR_API_KEY_HERE>>
Optional
Maximum number of elements to return. Defaults to 100, returns 1000 max
1
Maximum: 1000
Default: 100
Optional
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const queryParams = {5page_size: 100,6};78const request = {9url: `/v3/marketing/lists`,10method: "GET",11qs: queryParams,12};1314client15.request(request)16.then(([response, body]) => {17console.log(response.statusCode);18console.log(response.body);19})20.catch((error) => {21console.error(error);22});