POST /interaction/v1/interactions/journeyhistory/download
Downloads Journey History as a CSV or a TSV file, for up to the last 30 days. Download more than 10,000 records at a time and select the fields (columns) you need.
Name | Type | Description | Possible Values |
---|---|---|---|
format | string | Desired file format. Defaults to CSV. |
|
columns | string | Comma-seperated list of columns to download. Defaults to:
|
|
Name | Type | Description | Possible Values |
---|---|---|---|
start | string | Query start date and time (ISO 8601). | |
end | string | Query end date and time (ISO 8601). | |
contactKeys | array | List of contact keys to retrieve events. | |
activityTypes | array | List of activity types to retrieve events. |
|
definitionIds | array | List of definition (journey) IDs to retrieve events. | |
statuses | array | List of statuses to retrieve events. |
|
definitionInstanceIds | array | List of definition instance IDs to retrieve events. | |
tags | array | List of tags to retrieve events. | |
activityIds | array | List of activity IDs to retrieve events. |
Please note the x-direct-pipe header. It's mandatory for this download API route and only for this download API route.
Example Request 1
This request downloads all the failed contacts within the given journey between 06:00 and 21:00 UTC.
Example Response 1
Example Request 2
This request downloads a list of contacts that didn’t meet the entry criteria within a specified journey.
Example Response 2
Example Request 3
This request downloads a list of contacts that didn’t meet the entry criteria in all the customer journeys within a specified period of time.
Example Response 3
Example Request 4
This request downloads the list of contacts successfully injected into the given journey.
Example Response 4
Please note the x-direct-pipe header. It's mandatory for this download API route and only for this download API route.
It’s crucial to limit the request as much as possible to only return the results you need to remain performant.
The following best practices should be followed:
-
If you have many journeys in your account instance but are interested only in a single journey’s events, then include its ‘definitionId’ in the request. The same applies to activities: if you’re interested only in a single activity’s events, then include its ‘activityId’.
-
Download only the columns you need to reduce the download file size and time to complete the request.
-
If your request contains filters that limit certain fields to a single value, there is no need to include this column and related columns in the result.
Examples:
- “statuses”:[“failed”] — selects only failed events, therefore the Status column will always be “failed” in each row. Exclude this column from the download.
- “definitionIds”:[“xxxxxxx”] — selects events from only a single journey. Columns DefinitionId and DefinitionName have the same values in each row. Exclude these columns from the download.
- “activityIds“:[”xxxxxxx“] — selects events from only a single activity. That activity belongs to just one journey, too. Columns ActivityId, ActivityName, ActivityType, and by extension DefinitionId and DefinitionName have the same values in each row. Exclude all these columns from the download.
-
Use start and end request parameters to limit the size. Instead of downloading events for an entire journey, download an hour at a time. It results in smaller files that download faster. It also limits your losses if your download fails halfway through. It’s not possible to resume a failed download. Re-downloading a smaller chunk is faster and less wasteful.
-
Before you make the download request, use the Estimate Route to receive the Row Count and Download Size. This gives you an idea of how much data could be downloaded with the request and allows you to make optimizations to remain performant.