v1

latestSwagger 2.0Private2026-08-04128286690.5 KB
Bulk Activities

Export Contacts to a File

Use this method to create an activity that exports contacts and contact details to a CSV file. You can choose to export all contacts in your account (default) or you can use parameters to filter on which contacts to export. After Constant Contact finishes processing the activity, use the results link in the response body to retrieve the CSV file.

post/activities/contact_exports

Request body

contact_idsstring[]

Exports up to 500 specific contacts. This property is mutually exclusive with all other filtering criteria except with<code>status</code>.

list_idsstring[]

Exports all of the contacts inside of up to 50 contact lists. This property is mutually exclusive with all other filtering criteria except with either <code>status</code> or <code>exclude</code>.

tag_idsstring[]

Exports contacts assigned one or more of the tags (<code>tag_id</code>) specified. This property is mutually exclusive with all other filtering criteria.

new_subscriberboolean

Set to <code>true</code> to only export contacts that subscribed within the last 30 days. Default setting is <code>false</code>. This property is mutually exclusive with all other filtering criteria except with either <code>list_ids</code> or <code>exclude</code>.

segment_idinteger

Specify the <code>segment_id</code> from which you want to export all contacts that meet the specified <code>segment_criteria</code>. You can only specify one <code>segment_id</code>. This property is mutually exclusive with all other filtering criteria.

fieldsstring[]

By default , all fields are returned. Use this array to only export specific contact fields. You must export <code>email_address</code> to successfully export <code>email_optin_source</code>, <code>email_optin_date</code>, <code>email_optout_source</code>, <code>email_optout_date</code>, or <code>email_optout_reason</code>.

statusstring

Allows you to export only contacts that have a specific status value. This property is mutually exclusive with all other filtering criteria except with either <code>contact_ids</code> or <code>list_ids</code>.

Example request

{
  "contact_ids": [
    "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
  ],
  "list_ids": [
    "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
  ],
  "tag_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "new_subscriber": true,
  "segment_id": 12,
  "fields": [
    "email_address"
  ],
  "status": "unsubscribed",
  "exclude": {
    "contact_ids": [
      "4d88f172-21d1-11ea-b5ae-fa163e56c9b0"
    ]
  }
}

Response

Request successful, queued for processing.

activity_idstring uuid

Unique ID for the activity.

statestring
<p> The state of the request: <ul> <li>initialized - request has been received</li> <li>processing - request is being processed</li> <li>completed - job completed</li> <li>cancelled - request was cancelled</li> <li>failed - job failed to complete</li> <li>timed_out - the request timed out before completing"</li> </ul> </p>
started_atstring date-time

Timestamp showing when we began processing the activity request, in ISO-8601 format.

completed_atstring date-time

Timestamp showing when we completed processing the activity, in ISO-8601 format.

created_atstring date-time

Timestamp showing when we created the activity, in ISO-8601 format.

updated_atstring date-time

Timestamp showing when we last updated the activity, in ISO-8601 format.

percent_doneinteger

Shows the percent done for an activity that we are still processing.

activity_errorsstring[]

Array of messages describing the errors that occurred.

Example response

{
  "activity_id": "86b90820-cc52-11ea-9dad-fa163e3d9194",
  "state": "initialized",
  "started_at": "2016-01-23T13:48:44.108Z",
  "completed_at": "2016-01-23T13:48:44.108Z",
  "created_at": "2016-01-23T13:48:44.108Z",
  "updated_at": "2016-01-23T13:48:44.108Z",
  "percent_done": 75,
  "activity_errors": [
    "Message describing the error condition."
  ],
  "status": {
    "items_total_count": 8751,
    "items_completed_count": 351
  },
  "_links": {
    "self": {
      "href": "/v3/activities/04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
    },
    "results": {
      "href": "/v3/contacts_exports/04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
    }
  }
}