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 updates the name of a list.
Bearer <<YOUR_API_KEY_HERE>>
The ID of the list on which you want to perform the operation.
application/json
Your name for your list.
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";5const data = {6"name": "updated-list-name"7};89const request = {10url: `/v3/marketing/lists/${id}`,11method: 'PATCH',12body: data13}1415client.request(request)16.then(([response, body]) => {17console.log(response.statusCode);18console.log(response.body);19})20.catch(error => {21console.error(error);22});