# 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 for the sections and to use for deals' stage changes)
date_from string no Minimum date of the returned data.
(possible to use only for logs)
date_to integer no Maximum date of the returned data.
(possible to use only for logs)
filter_by json no Type of the email actions which is based on the date_from and date_to.

Possible values:
    - sent_at (default)
    - opened_at
    - clicked_at
    - unsubscribed_at
    - all
event_id integer yes / no ID of the specific event.
(required and possible to use only for the event occurrences export)
deal_id integer no ID of the specific deal.
(possible to use only for the deal occurrences export)
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
            - events
            - deals_stage_changes

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl -X POST
    "https://<your_app_subdomain>.user.com/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"
}