Schedules an export based on the provided segment. The progress and results of the export can be fetched from the operations API.
Segment Export is an Enterprise pricing tier add-on. See pricing page for more details.
Method: POST
URI: /segments/v1/exports
Parameters
Name | Type | Description |
---|---|---|
segmentId | string | Required. An Id for a segment as returned from the list segments API endpoint. This can include built-in segment Ids such as the "everyone" segment. |
type | string | Required. Which kind of data to export. TYPE_EVENT will export the event data for the corresponding segment and TYPE_INDIVIDUAL will export individuals in the segment. |
format | string | Required. Determines the data format of the export. Options are FORMAT_JSON , FORMAT_CSV , and FORMAT_NDJSON . Note: If using CSV format, it is highly recommended that fields are also explicitly provided. Since new fields will be added as FullStory adds more features, providing explicit fields will result in deterministic headers. For a single version of the API, fields will never be removed or renamed. |
timeRange | TimeRange | Required. Restricts the exported data to the provided time range. For TYPE_EVENT exports, this is based on the EventStart time. For TYPE_INDIVIDUAL , only users that performed events within the provided time range are exported.Note: this does not have any effect on the underlying segment's time range. |
segmentTimeRange | TimeRange | Optional. Overrides the time range for the provided segment. |
timezone | string | Optional. IANA time zone that should be used to calculate relative dates. Defaults to UTC |
fields | array of strings | Optional. Restricts the set of fields that are included in the export. If unspecified, all fields will be exported. Custom variables (such as user variables and custom event variables) can also be specified. These should be specified like user_MyUserVar_str or evt_MyEventVar_int . You can also get all of these by specifying them as like: user_* or evt_* . (Note: this is not a general glob pattern, just a special value) |
eventDetails | EventDetails | Optional. Only applies to exports with type TYPE_EVENT . |
TimeRange
object parameters
Name | Type | Description |
---|---|---|
start | string | UTC RFC 3339 timestamp or an empty string. If an empty string, this will be interpreted as "forever in the past". |
end | string | UTC RFC 3339 timestamp or an empty string. If an empty string, this will be interpreted as "up to the time of the request". |
EventDetails
object parameters
Name | Type | Description |
---|---|---|
scope | string | Specifies "scope" of the events to be exported relative to the events matching the segment’s event filters. Options are SCOPE_EVENTS , SCOPE_INDIVIDUALS , SCOPE_SESSIONS , and SCOPE_PAGES . Defaults to SCOPE_EVENTS . |
Request Headers
Authorization: Basic {YOUR_API_KEY}
Status Codes
200
: A successful response.
Response Fields
Name | Type | Description |
---|---|---|
operationId | string | This id can be used with the operations API to track the status of the export. |
Two types of segment-related data are available: individuals and events.
Individual Exports
An individual export will contain information about each of the individuals that match the provided segment. The fields that are available through this export are documented here.
Event Exports
An event export will contain events performed by individuals that match the provided segment. The fields that are available through this export are documented here.
Events are selected based on the scope
parameter. In order of increasing scope:
SCOPE_EVENT
: only events that match the segment's event criteria.SCOPE_PAGES
: all events from each page where users performed matching event criteria.SCOPE_SESSIONS
: all events from each session where users performed matching event criteria.SCOPE_INDIVIDUAL
: all events for each individual who performed matching event criteria.