Download exported data
You can download an export file by its name. The response is the CSV file: standard fields first, then your custom attributes (under their names), then tags, company_name, company_id, lists, segments and status.
The name of a file might be returned in response to started export or from the list of exported data.
Attributes
Optional unless marked required
- file_name
- Whole name of the exported file with its extension.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/exports/:file_name/download/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
- 423 Locked
key,id,user_id,assigned_to,last_contacted,last_heard_from,avatar,email,gender,first_name,last_name,phone_number,first_seen,last_seen,page_views,last_ip,hostname,referrer,timezone,country,region,city,os_type,browser,browser_language,browser_version,resolution,current_url,score,facebook_url,linkedin_url,twitter_url,google_url,unsubscribed,whatsapp_unsubscribed,spambounced,softbounced,hardbounced,notifications,created_at,updated_at,lt_opened_email,lt_clicked_email,most_active_time,is_active,email_opt_in,email_tracking_optin,Loyalty tier,tags,company_name,company_id,lists,segments,status
g7lvoickax9e,1924,jane-doe,,,,,johndoe@example.com,unknown,John,Doe,+48123456789,2026-11-10T14:20:02Z,2026-11-17T09:12:44Z,12,,,,Europe/Warsaw,Poland,,Warsaw,Windows,Chrome,en,,1920x1080,https://example.com/,0,,,,,False,False,False,False,False,True,2026-11-10T14:20:02Z,2026-11-17T09:12:44Z,,,,True,,,Gold,Newsletter,,,,,user
{
"error": "File not found"
}
{
"message": "Export not finished yet."
}
The 423 comes back while the file is still being built. A large export can take a long time, so check status in Get all exported files or retry with growing pauses instead of a tight loop. The 404 comes back when no export file has that name. A file can be downloaded more than once; the first download sets downloaded to true in Get all exported files.
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.