deleteList

Deletes a List and all of its Contacts.

deleteList

Deletes a List and all of its Contacts.

Top ↑

Syntax

bool deleteList( string api_key, int list_id );

Parameters

api_key (string)

Key required to access the API. See Getting Started for more information.

list_id (int)

The ID of the List to delete.

Return Value

Returns true on success.

Examples

The following example deletes List 1234567 and all of its Contacts from the system.

$list_id = 1234567;     // can be obtained using searchLists()

$api = new Api($url, 'YOURAPIKEY');
$api->invokeMethod('deleteList', $list_id);
{
    "id": 1,
    "method": "deleteList",
    "params": [
        "YOURAPIKEY",
        1234567
    ]
}
{
    "id": 1,
    "result": true,
    "error": null
}

Remarks

Deleting a List will:

  • Permanently remove the List.
  • Delete all related Fields.
  • Delete all Contact information stored within it.
  • Delete all Notes associated with Contacts.
  • Delete any related statistical information.
  • Prevent Contacts from unsubscribing.
  • Delete all associated Web Forms.
  • Cause scheduled sends to this List to fail.

Error Codes

This method may return the following error codes in addition to the standard error codes:

Code Error Description
303 Unable to Load List list_id is not a valid List.
313 Cannot Edit Account Lists list_id is an Account List. Account Lists cannot be deleted.
302 Undefined Error: Unable to delete list An internal error occurred.

See Also