Skip to main content
POST/events/import/

Bulk events import

You can import your events from CSV files using REST API. The CSV file requires the usage of standardized attribute names for the header row, or you can use column mapping to map your custom column names. You can check the progress of your import with a GET request.

Maximum file size: 400MB

Preparing the file

For the columns you can use for events, the required ones and how to format values, see How to Import Events from CSV/XLSX and CSV/XLSX Import Formatting Rules.

Parameters​

ParameterDescription
separatorAllows to choose separator type in CSV file during import. Available options: comma (default), tab, semicolon. Example usage: ?separator=semicolon

Attributes

Optional unless marked required

input_filefilerequired
A valid CSV file
column_mappingjson
Optional parameter to map CSV column names to different field names during import. Example: {"timestamp": "datetime", "event_type": "event_name"}

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/events/import/?trigger_automations=false" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-F "input_file=@path/to/file.csv"

Response examples​

{
"success": true,
"data": {
"import_id": "186dd245-475c-4a18-ba3e-046ad8fd3585"
}
}

Response fields​

Fields returned in the 200 OK response body.

successboolean
true when the file was accepted; the import itself runs in the background.
dataobject
A valid json object with additional data.
data.import_idstring
ID of the import; pass it as import_id to Check import status and Check all import errors.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.