Update List
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".
PATCH/v3/marketing/lists/{id}
Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)
This endpoint updates the name of a list.
Property nameTypeRequiredDescription
Authorizationstring
required
Default:
Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idstring
required
The ID of the list on which you want to perform the operation.
Encoding type:
application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
namestring
Optional
Your name for your list.
200400404
SchemaExample
Property nameTypeRequiredDescriptionChild properties
idstring
Optional
The generated ID for your list.
Min length:
36
Max length: 36
namestring
Optional
The name you gave your list.
contact_countinteger
Optional
The number of contacts currently stored on the list.
_metadataselfMetadata
Optional
Show _metadata properties
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const id = "id";5const data = {6name: "updated-list-name",7};89const request = {10url: `/v3/marketing/lists/${id}`,11method: "PATCH",12body: data,13};1415client16.request(request)17.then(([response, body]) => {18console.log(response.statusCode);19console.log(response.body);20})21.catch((error) => {22console.error(error);23});