Delete a Subscriber List

Deletes a subscriber list. This action doesn’t delete the subscribers on that list. When a list is deleted, no further sends can be conducted with that list.

When you delete a subscriber list, your account also loses all tracking information related to that subscriber list. For this reason, we recommend leaving lists intact and creating new lists via new opt-in procedures.

Use thesee code examples to construct your own API calls.

Sample .NET Code 

1using System;
2using System.Configuration;
3using System.Data;
4using System.Linq;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.HtmlControls;
9using System.Web.UI.WebControls;
10using System.Web.UI.WebControls.WebParts;
11using System.Xml.Linq;
12using etAPI;
13public partial class ListDelete : System.Web.UI.Page
14{
15    //Global Variables
16    private SoapClient client = new SoapClient();
17    protected void Page_Load(object sender, EventArgs e)
18    {
19        //Authenticate
20        client.ClientCredentials.UserName.UserName = System.Configuration.ConfigurationSettings.AppSettings["wsUserName"];
21        client.ClientCredentials.UserName.Password = System.Configuration.ConfigurationSettings.AppSettings["wsPassword"];
22        if (!IsPostBack)
23        {
24        }
25    }
26    protected void btnSubmit_Click(object sender, EventArgs e)
27    {
28        try
29        {
30            //Create List object [Subscribers > My Subscribers > My Lists]
31            List l = new List();
32            l.ID = 1007548;//required
33            l.IDSpecified = true;
34            try
35            {
36                string dRequestID = String.Empty;
37                string dStatus = String.Empty;
38                //Call the Delete method on the List object
39                DeleteResult[] dResults = client.Delete(new DeleteOptions(), new APIObject[] { l }, out dRequestID, out dStatus);
40                //Display Results
41                lblMessage.Text += "Overall Status: " + dStatus;
42                lblMessage.Text += "<br/>";
43                lblMessage.Text += "Number of Results: " + dResults.Length;
44                lblMessage.Text += "<br/>";
45                //Loop through each object returned and display the StatusMessage
46                foreach (DeleteResult ur in dResults)
47                {
48                    lblMessage.Text += "Status Message: " + ur.StatusMessage;
49                    lblMessage.Text += "<br/>";
50                }
51            }
52            catch (Exception ex)
53            {
54                //Set Message
55                lblMessage.Text += "<br/><br/>UPDATE ERROR:<br/>" + ex.Message;
56            }
57        }
58        catch (Exception exc)
59        {
60            //Set Message
61            lblMessage.Text += "<br/><br/>###ERROR<br/>" + exc.Message;
62        }
63    }
64}

SOAP Envelope Example 

1<?xml version="1.0" encoding="utf-8"?>
2<s:Envelope xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
3        <s:Header>
4            <a:Action s:mustUnderstand="1">Delete</a:Action>
5            <a:MessageID>urn:uuid:12345</a:MessageID>
6            <ActivityId CorrelationId="12345" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">123456</ActivityId>
7            <a:ReplyTo>
8                <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
9            </a:ReplyTo>
10            <a:To s:mustUnderstand="1">https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx</a:To>
11    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
12        <o:UsernameToken u:Id="uuid-b82c6428-caa1-49fc-986b-dc613c990c49-1">
13            <o:Username>XXXXX</o:Username>
14            <o:Password>XXXXX</o:Password>
15        </o:UsernameToken>
16    </o:Security>
17        </s:Header>
18        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
19            <DeleteRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
20                <Options></Options>
21                <Objects xmlns:q1="http://exacttarget.com/wsdl/partnerAPI" xsi:type="q1:List">
22                    <q1:ID>12345</q1:ID>
23                    <q1:ObjectID xsi:nil="true"></q1:ObjectID>
24                </Objects>
25            </DeleteRequest>
26        </s:Body>
27</s:Envelope>