# Export data

You can export data from specific section (People/Deals/etc.) or campaign logs (Email deliveries/clicks or SMS deliveries) based on segment (for sections) as well as based on date of campaign sending or user's click/opening/unsubscription.

POST /api/public/exports/

Attributes Type Required Description
segment integer yes / no A unique identifier for the segment of People/Deals/etc.
(required and possible to use only for sections)
date_from string yes / no Minimum date of the returned data.
(required and possible to use only for logs)
date_to integer yes / no Maximum date of the returned data.
(possible to use only for logs)
filter_by json no Type of the campaign action which is based on the date_from and date_to.
(possible to use only for sections)

Possible values:

- sent_at
(default)
- opened_at
- clicked_at
- unsubscribed_at
- all
type string yes Type of the exported data.
Those can be:

Section
- people
- products
- deals
- companies
- activities

Logs
- email_delivery_logs
- sms_delivery_logs
- email_clicks

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl -X POST
    "https://<your_app_subdomain>.user.com/api/public/api/public/exports/"
    -H 'authorization: Token <your_64_char_api_key>'
    -H 'content-type: application/json'
    -H "Accept: */*; version=2"
    -d '{
    "type": "people",
    "segment": 1
}'

# Response

{
  "filename": "d1d69214-d07f-418f-bd85-27c49fd3398f.csv"
}