Skip to content

Customers – export from selected segment

Use these methods to export selected customer data from any segment.

POST /exports/customers – request data export

This method allows you to request data export. You’ll get the request status and exportId needed to download the data.

Endpoint

The endpoint (server address) for this request is https://api.ecdp.app/exports/customers

Request parameters

ParameterLocationTypeRequiredDescription
x-api-keyheaderstringyesAPI key for authentication
Content-TypeheaderstringyesRequest content type
segmentIdbodyInteger($int32)yesID of the segment from which you want to export customer data. You’ll find the segment ID in ECDP > Customers > Segmentation > “ID” column.
systemAttributesbodystringnoSee System attribute item.
customAttributesbodystringnoSee Custom attribute item.
consentsbodystringnoSee Consent item.

The systemAttributes, customAttributes, and consents parameters aren’t required, but the request will be rejected if you don’t fill in at least one field.

System attribute item

ParameterLocationTypeRequiredDescription
namebodystringnoSystem attribute name.
allbodybooleannoEnter true if you want to export all attributes. Otherwise, leave the field empty.

Custom attribute item

ParameterLocationTypeRequiredDescription
idbodyinteger($int32)noID of the customer attribute created in Settings > Customers > Custom attributes.
namebodystringnoCustom attribute name.
allbodybooleannoEnter true if you want to export all attributes. Otherwise, leave the field empty.
ParameterLocationTypeRequiredDescription
idbodyinteger($int32)noID of the customer attribute created in Settings > Consents > Consents.
namebodystringnoConsent name.
allbodybooleannoEnter true if you want to export all consents. Otherwise, leave the field empty.

How to handle duplicate fields

If you request all attributes (using ‘all: true’) and specify several specific attributes from the same group in your request, we’ll simply export all attributes. The system ignores redundant information to avoid duplicates.

Sample requests

Required request format: JSON

Exporting all customers data from a segment

You’re exporting customer data from segment ID 1, including all system attributes, customer attributes, and consents.

Request body:

{
  "segmentId": 1,
  "data": {
    "customAttributes": [
      {"all": true}
    ],
    "systemAttributes": [
      {"all": true}
    ],
    "consents": [
      {"all": true}
    ]
  }
}

Exporting customers data from a segment including specific attributes

You’re exporting customer data from segment ID 158, including:

  • custom attribute named contest consent.
  • system attribute named Email.
  • system attribute with ID 4.
  • consent with ID 6.
  • consent named consent.

Request body:

{
  "segmentId": 158,
  "data": {
    "customAttributes": [
      {"name": "contest consent"}
    ],
    "systemAttributes": [
      {"name": "Email"},
      {"id": 4}
    ],
    "consents": [
      {"id": 6},
      {"name": "consent"}
    ]
  }
}

Exporting all custom attributes and one system attribute from a segment

You’re exporting customer data from segment ID 12, including:

  • all custom attributes.
  • one system attribute named ID.

Request body:

{
  "segmentId": 12,
  "data": {
    "customAttributes": [
      {"all": true}
    ],
    "systemAttributes": [
      {"name": "ID"}
    ]
  }
}

Responses

200: Success

After sending the request, you’ll receive a response containing the exportId and export request status. The Queued status means the accepted request is waiting in the queue for processing.

Sample response:

{
  "exportId": "12",
  "status": "Queued"
}

401: Unauthorized

The request was missing an API key, or you’re requesting access to information you don’t have permissions for.

GET /exports/{identifier} – check export results

With this method you can download the requested data. You’ll receive a link to download a CSV file or raw data file.

Endpoint

When data export is complete, you can download the file in two ways. Choose the endpoint that better fits your needs:

  1. Standard CSV file for analysis

Endpoint: https://api.ecdp.app/exports/customers/{exportId}

The CSV file contains column headers and is suitable for viewing data in MS Excel or Google Sheets, or for importing into systems that require standard CSV format.

  1. Raw data file for advertising platforms

Endpoint: https://api.ecdp.app/exports/{exportId}

The raw data file is specially prepared for import into external tools – for example, to create Custom Audiences in advertising systems like Google Ads or Meta Ads (Facebook).

Request parameters

ParameterLocationTypeRequiredDescription
exportIdbodyinteger($int32)Yes, for both endpointsExport ID number that was returned in the response to the POST request.

Responses

200: Success

After export is completed, you’ll receive a response with a download link for the file. The file is active for 24 hours from the moment it’s generated. After this time, the file is deleted from the server, and the next attempt to download it will result in an error.

Sample response:

{
  "exportId": 12,
  "status": "Finished",
  "file_url": "https://api.dev.ecdp/exports/12?apiKey=ls22fChPm5orIuT2bDt9"
}

401: Unauthorized

The request was missing an API key, or you’re requesting access to information you don’t have permissions for.

Export statuses

The response can contain one of four statuses:

  1. Queued – the request has been accepted and is waiting in the queue for processing.
  2. InProgress – the export is being processed.
  3. Finished – the export completed successfully. In the same response, you’ll get a link to the data file.
  4. Error – failed to export data from the specified segment.