Our v3 API is now available! Learn more by visiting the v3 developer portal.

Bulk Activities - Export Contacts Endpoint

Use this endpoint to create asynchronous background jobs that exports the members of a specified contact list to a comma separated value (CSV) file.

Methods:

Click a method to view its documentation

POST

DescriptionTOP

Privileges required: contacts:write

Export the members of a contact list to a RFC 4180 compliant .CSV file. In the JSON request body you need to specify the following properties:

  • lists array
  • file_type
  • sort_by
  • export_date_added
  • export_added_by
  • column_names

See the Structure section for details and values for these properties.

column_names array

The column_names array lists the contact properties to include in the exported file. See the JSON Structure table below for valid column names to use. If the first contact does not have a valid email address, then the request fails and no contacts are exported. "Email" must be included in column_names, or the activity will fail.  

Deprecated column_names

The following columns names have been deprecated for export as of the May 5, 2014 update:

  • SUB ZIP/POSTAL CODE
  • MIDDLE NAME
  • US STATE/CA PROVINCE

Existing integrations using these column names will not return errors, but the API ignores these columns.

Export system generated lists

You can export the following system generated contact lists that are filtered by contact status by specifying them as follows in the lists array (include only a single list in the array):

  • active
  • opted-out
  • removed

View contact status definitions here.

Activity status

You can poll the URI returned in the response's location header to monitor the status of the export activity. You must include the access_token and api_key when making a GET call to the activity status report endpoint:

https://api.constantcontact.com/v2/activities/<activity_id>?api_key=<api_key>

The activity has finished once the status is returned as either COMPLETE or ERROR. The activity status response structure is detailed here

How to get the exported file

Once the activity completes processing (status = COMPLETE or ERROR in the activity status report), the status report will also include the file_name property, which is the URL where the file is hosted. The value of this property is a URI that points to the location of the exported file. To retrieve the file, make a GET call to the URI, be sure to include the access_token and api_key in the call. 

GET <file_name>?api_key=<api_key>

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

Example JSON Request BodyTOP


Example ResponseTOP