Menu

Lists

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".

Delete a list

Delete a list

DELETE /marketing/lists/{id}

This endpoint allows you to deletes a specific list.

Optionally, you can also delete contacts associated to the list. The query parameter, delete_contacts=true, will delete the list and start an asynchronous job to delete associated contacts.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Path Parameters

id
string
required

Query String

delete_contacts
boolean

Flag indicates that all contacts on the list are also to be deleted.

default: False

Responses

object

The delete has been accepted and is processing.

job_id
string

job_id of the async job

string

The delete has been processed.

object
errors
array[object]
required

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.