---
title: "Export Contacts to a File"
method: POST
path: "/activities/contact_exports"
tags: ["Bulk Activities"]
---

# Export Contacts to a File

`POST /activities/contact_exports`

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.

## Request body

- ContactsExport — Export contact objects to a CSV file. By default, all contacts in the user's account are exported unless a filtering parameter is specified.
  - `contact_ids` string[] — Exports up to 500 specific contacts. This property is mutually exclusive with all other filtering criteria except with<code>status</code>.
  - `list_ids` string[] — 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_ids` string[] — 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_subscriber` boolean — 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_id` integer — 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.
  - `fields` string[] — 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>.
  - `status` string — 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>.
  - `exclude` object
    - `contact_ids` string[] — Excludes up to 50 specified contacts (<code>contact_id</code>) from being exported. This property is mutually exclusive with all other filtering criteria except with either <code>list_ids</code> or <code>new_subscriber</code> .

## Response `201`

Request successful, queued for processing.

- ActivityExportStatus — Activity status for contact_exports activity
  - `activity_id` string, uuid — Unique ID for the activity.
  - `state` string — <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_at` string, date-time — Timestamp showing when we began processing the activity request, in ISO-8601 format.
  - `completed_at` string, date-time — Timestamp showing when we completed processing the activity, in ISO-8601 format.
  - `created_at` string, date-time — Timestamp showing when we created the activity, in ISO-8601 format.
  - `updated_at` string, date-time — Timestamp showing when we last updated the activity, in ISO-8601 format.
  - `percent_done` integer — Shows the percent done for an activity that we are still processing.
  - `activity_errors` string[] — Array of messages describing the errors that occurred.
  - `status` object
    - `items_total_count` integer — The total number of contacts to export.
    - `items_completed_count` integer — The number of contacts processed for export.
  - `_links` ActivityStatusExportLink
    - `self` object — HATEOS-style link to the activity status (this object).
      - `href` string
    - `results` object — Link to an activity result resource; as an example, for file_export, the link to the exported contacts file.
      - `href` string

## Other responses

- `400` — Bad request. Either the JSON was malformed or there was a data validation error.
- `401` — The Access Token used is invalid.
- `403` — Forbidden request. You lack the necessary scopes, you lack the necessary user privileges, or the application is deactivated.
- `404` — The requested resource was not found.
- `429` — Too many requests. You exceeded 1,000 queued activities for this user account.
- `500` — There was a problem with our internal service.
- `503` — Our internal service is temporarily unavailable.

---

[API](https://skmtc.net/cc/apis/appconnect-v3.md) · [All operations](https://skmtc.net/cc/apis/appconnect-v3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cc/appconnect-v3/revisions/4b4a534c818d/schema)
