Documentation Index

Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt

Use this file to discover all available pages before exploring further.

Trigger Segment Export

Prev Next
Post
/segment-export/trigger

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.

Header parameters
Authorization
stringRequired

The OAuth 2.0 bearer token. Example: Bearer

Body parameters
Profile export
{
  "segment_id": "12345",
  "export_type": "profile",
  "attributes": [
    "user_id",
    "email",
    "first_name"
  ],
  "preferences": []
}
Device export
{
  "segment_id": "12345",
  "export_type": "device",
  "attributes": [],
  "preferences": []
}
object
segment_id
integer

The unique identifier of the segment you want to export. You must provide this if you do not provide a segment_title.

segment_title
string

The exact name of the segment you want to export. You must provide this if you do not provide a segment_id.

export_type
string Required

Defines the type of data to export. Use "device" for device-level records or "profile" for profile-level records.

attributes
Array of string

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.

string
preferences
Array of integer

A list of subscription preferences to include in profile exports. This field must be null or an empty array for device exports.

integer
Responses
202

Success

Result
{
  "success": "True",
  "message": "Segment export queued successfully"
}
Expand All
object
success
boolean

Returns true when the request is successful.

Defaulttrue
message
string
Default"Segment export queued successfully"
data
object
task_id
integer

The unique identifier for the export task. Use this ID to check the status of your export.

400

Bad Request

Result
{
  "name": "Bad Request",
  "message": "Project is inactive or Validation failed"
}
object
name
string
Default"Bad Request"
message
string
Default"Project is inactive or Validation failed"
403

Forbidden

Result
{
  "name": "Forbidden",
  "message": "Access Denied"
}
object
name
string
Default"Forbidden"
message
string
Default"Access Denied"
404

Not Found

Result
{
  "name": "Not Found",
  "message": "Segment not found"
}
object
name
string
Default"Not Found"
message
string
Default"Segment not found"
429

Too Many Requests

Result
{
  "name": "Too Many Requests",
  "message": "Rate Limit Exceeded"
}
object
name
string
Default"Too Many Requests"
message
string
Default"Rate Limit Exceeded"