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 data about a specific list.
Setting the optional parameter contact_sample=true
returns the contact_sample
in the response body. Up to 50 of the most recent contacts uploaded or attached to a list will be returned.
The full contact count is also returned.
Bearer <<YOUR_API_KEY_HERE>>
The ID of the list on which you want to perform the operation.
Setting this parameter to the true will cause the contact_sample to be returned
false
The generated ID for your list.
36
Max length: 36
The name you gave your list.
The number of contacts currently stored on the list.
1const client = require('@sendgrid/client');2client.setApiKey(process.env.SENDGRID_API_KEY);34const id = "ZGkrHSypTsudrGkmdpJJ";56const request = {7url: `/v3/marketing/lists/${id}`,8method: 'GET',910}1112client.request(request)13.then(([response, body]) => {14console.log(response.statusCode);15console.log(response.body);16})17.catch(error => {18console.error(error);19});