Used to trigger a background task to export device or profile data for a specific segment.
Prerequisites: Ensure you have the following:
- An active Xtremepush project
- Export and File Download scopes enabled for your API Client ID
- A valid OAuth 2.0 access token
- The segment_id or segment_title of the segment you want to export
Segment Export Workflow
This API allows you to queue an asynchronous task to export segment data. The segment export process follows these three steps:
1. Call the /segment-export/trigger endpoint to start the export. The response contains a unique task_id.
2. Use the /info/task endpoint with the task_id to monitor the export progress. After the export is complete, a file_id is generated.
3. Call the /file/{fileId}/download endpoint using each file_id from the task result to retrieve your segment data.
Export Capabilities and Restrictions
Before you queue an export, review the following:
- You can only trigger one export per hour for any specific segment.
- You must provide either a segment_id or a segment_title. You cannot provide both in the same request.
- There are two types of export options:
- device - exports device-level records.
- profile - exports user profile records. This type allows you to select specific attributes and subscription preferences to include in the generated file.
The OAuth 2.0 bearer token. Example: Bearer
{
"segment_id": "12345",
"export_type": "profile",
"attributes": [
"user_id",
"email",
"first_name"
],
"preferences": []
}{
"segment_id": "12345",
"export_type": "device",
"attributes": [],
"preferences": []
}The unique identifier of the segment you want to export. You must provide this if you do not provide a segment_title.
The exact name of the segment you want to export. You must provide this if you do not provide a segment_id.
Defines the type of data to export. Use "device" for device-level records or "profile" for profile-level records.
A list of profile attributes to include in profile exports, for example ["user_id", "email", "first_name"]. This field must be null or an empty array for device exports.
A list of subscription preferences to include in profile exports. This field must be null or an empty array for device exports.
Success
{
"success": "True",
"message": "Segment export queued successfully"
}Returns true when the request is successful.
The unique identifier for the export task. Use this ID to check the status of your export.
Bad Request
{
"name": "Bad Request",
"message": "Project is inactive or Validation failed"
}Forbidden
{
"name": "Forbidden",
"message": "Access Denied"
}Not Found
{
"name": "Not Found",
"message": "Segment not found"
}Too Many Requests
{
"name": "Too Many Requests",
"message": "Rate Limit Exceeded"
}