Delete an Auto-Suppression List verified

Learn how to delete an Auto-Suppression List in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript). Code snippets include the WSProxy method.

WSProxy

var api = new Script.Util.WSProxy();

var result = api.deleteItem("SuppressionListDefinition", {
    ObjectID: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3"
});
<script runat="server">

    Platform.Load("core", "1");

    var api = new Script.Util.WSProxy();

    try {

        var request = api.retrieve("SuppressionListDefinition", ["ObjectID"], {
            Property: "Name",
            SimpleOperator: "equals",
            Value: "MyNewSuppressionList"
        });

        var id = request.Results[0].ObjectID;

        var result = api.deleteItem("SuppressionListDefinition", {
            ObjectID: id
        });

        Write(Stringify(result));

    } catch (error) {

        Write(Stringify(error));

    }

</script>
{
    "Status": "OK",
    "RequestID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
    "Results": [
        {
            "Object": {
                "Name": null,
                "ObjectID": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
                "Category": 0,
                "Description": null,
                "Contexts": null,
                "Fields": null,
                "SubscriberCount": 0,
                "NotifyEmail": null,
                "Client": null,
                "PartnerKey": null,
                "PartnerProperties": null,
                "CreatedDate": "0001-01-01T00:00:00.000",
                "ModifiedDate": null,
                "ID": 0,
                "CustomerKey": null,
                "Owner": null,
                "CorrelationID": null,
                "ObjectState": null,
                "IsPlatformObject": false
            },
            "StatusCode": "OK",
            "StatusMessage": "SuppressionListDefinition deleted",
            "OrdinalID": 0,
            "ErrorCode": 0,
            "RequestID": null,
            "ConversationID": null,
            "OverallStatusCode": null,
            "RequestType": "Synchronous",
            "ResultType": null,
            "ResultDetailXML": null
        }
    ]
}

Reference

Ressources and references related to the current methods.

SOAP object

Last Updated: