Bulk Activities - Clear Contact List

Use this endpoint to create asynchronous background jobs that clear all contacts from an existing contact list.

Methods:

Click a method to view its documentation

POST

DescriptionTOP

Privileges required: contacts:write

This endpoint clears (removes) all contacts from the contact list specified by listId in the lists array in the JSON request body. See the example JSON Request below for details on constructing the JSON payload.

Activity Status

To see the status of an activity, make a GET call to the URI returned in the response's location header:

Location: https://api.constantcontact.com/v2/activities/<activity_id>

Poll this URI to monitor the activity status until the status is either COMPLETE or ERROR, indicating that the activity has completed processing. The response structure for this GET call is detailed here.

See also: Summary Activity Reports API

POST: https://api.constantcontact.com/v2/activities/clearlists

name

type

default

description

api_key

query

REQUIRED; The API key for the application

Example JSON Request BodyTOP

{
   "lists":[
    "2",
    "3"
  ]
}

Response CodesTOP

code

description

201

Request was successful

400

Bad Request; Error in validating a contact

401

Authentication failure

429

We cannot complete your request because you have too many requests in progress.

500

Internal server error occurred

StructureTOP

property

type(max length)

description

lists

array

REQUIRED. An array of listIds that specify the contact lists to clear all contacts from

Response StructureTOP

property

type(max length)

description

contact_count

string

Displays the number of contacts that were processed, and is meaningful only after the activity is completed; the value is not predictable if the activity has not yet been processed. (Read Only)

error_count

string

Displays the number of errors encountered, and is meaningful only after the activity is completed; the value is not predeictable if the activity has not yet been processed. (Read Only)

id

string

Unique ID for the activity (Read Only)

type

string

CLEAR_CONTACTS_FROM_LISTS - removes all contacts from the contactlist(s) specified in the import file (Read Only)

Example ResponseTOP

{
"id": "a07e1il97rdhddlqqv9",
"type": "CLEAR_CONTACTS_FROM_LISTS",
"error_count": 0,
"contact_count": 627
}