---
title: "Export contacts"
method: POST
path: "/contacts/export"
tags: ["Contacts"]
---

# Export contacts

`POST /contacts/export`

It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.

## Request body

- RequestContactExport
  - `exportAttributes` string[] — List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email'].
  - `customContactFilter` RequestContactExportCustomContactFilter, required — Set the filter for the contacts to be exported.
    - `actionForContacts` 'allContacts' | 'subscribed' | 'unsubscribed' | 'unsubscribedPerList' — Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only.
    - `actionForEmailCampaigns` 'openers' | 'nonOpeners' | 'clickers' | 'nonClickers' | 'unsubscribed' | 'hardBounces' | 'softBounces' — Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s).
    - `actionForSmsCampaigns` 'hardBounces' | 'softBounces' | 'unsubscribed' — Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns.
    - `listId` integer — Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter.
    - `emailCampaignId` integer — Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter.
    - `smsCampaignId` integer — Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter.
  - `notifyUrl` string, url — Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479

## Response `202`

Contact export request has been accepted

- CreatedProcessId
  - `processId` integer, required — Id of the process created

## Other responses

- `400` — bad request

---

[API](https://skmtc.net/getbrevo/apis/brevo-api.md) · [All operations](https://skmtc.net/getbrevo/apis/brevo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbrevo/brevo-api/versions/2aec3cf66501/schema)
