Delete a Contact List
To remove all contacts that are members on a specified list and delete the list, make a DELETE call to the /contact_lists/{list_id} endpoint. This request updates a contacts list memberships, it does not delete the contact.
Example Request
Delete list requests are processed asynchronously. To track the status of the request, make a GET call to the links URI returned in the response.
https://api.cc.email/v3/contact_lists/{list_id}Endpoint Requirements
User privileges: contacts:lists:writeAuthorization scopes: contact_dataOkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.cc.email/v3/lists/{list_id}")
.method("DELETE", body)
.addHeader("Accept", "*/*")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();Example Responses
The following example response is returned for the asynchronous DELETE request:
{
"activity_id": "dc5b730e-43f5-11ed-938d-158fe26710f1",
"state": "initialized",
"created_at": "2022-10-04T15:04:36Z",
"updated_at": "2022-10-04T15:04:36Z",
"percent_done": 1,
"activity_errors": [],
"status": {
"list_count": 1
},
"_links": {
"self": {
"href": "/v3/activities/04fa57a7-cf55-4185-cc1a-58ed29bf0a6a"
}
}
}To track the status for the activity, you can make a GET call to the href url link or make a GET call to the Get /activities/{activity_id} endpoint and specify the activity_id to use.
The following response shows that the delete list activity completed successfully:
{
"activity_id": "dc5b730e-43f5-11ed-938d-158fe26710f1",
"state": "completed",
"started_at": "2022-10-04T15:04:36Z",
"completed_at": "2022-10-04T15:04:36Z",
"created_at": "2022-10-04T15:04:36Z",
"updated_at": "2022-10-04T15:04:36Z",
"percent_done": 100,
"activity_errors": [],
"status": {
"items_total_count": 1,
"items_completed_count": 1,
"list_count": 1
},
"_links": {
"self": {
"href": "/v3/activities/dc5b730e-43f5-11ed-938d-158fe26710f0"
}
}
}Review our permission policy for more information.