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".
You can create a maximum of 1000 lists.
This endpoint creates a new contacts list.
Once you create a list, you can use the UI to trigger an automation every time you add a new contact to the list.
A link to the newly created object is in _metadata
.
Bearer <<YOUR_API_KEY_HERE>>
application/json
Your name for your list
1
Max length: 100
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 data = {5"name": "list-name"6};78const request = {9url: `/v3/marketing/lists`,10method: 'POST',11body: data12}1314client.request(request)15.then(([response, body]) => {16console.log(response.statusCode);17console.log(response.body);18})19.catch(error => {20console.error(error);21});