Overview

You can use this request to delete a specific list.

The Method

API-Method
RESTDELETEhttps://[Your URL]/api/2.0/lists/id
XML-RPCCalllists.DeleteList

Your method must be structured as follows:

Parameters

PropertyTypeDescriptionRequired
$idintegerThe ID of the list you need to delete.yes

Responses

Large lists are deleted asynchronously, the API will return a status code of 202 (Accepted) and a false result. Smaller lists are deleted immediately and will return a status code of 204 (No Content) on success.

TypeDescription
booleanWhether or not the list was successfully deleted.

Code Samples

PHP (using REST API):

$url = '(Your URL)/api/2.0/lists/list_id';
$method = 'DELETE';
$cSession = curl_init();
$headers = array();
$auth = base64_encode($username . ':' . $apikey);
$headers[] = 'Authorization: Basic ' . $auth;
curl_setopt($cSession, CURLOPT_URL, $url);
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));
curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($cSession);
curl_close($cSession);