Import items in bulk
This endpoint lets you upload a CSV file containing people, events, objects, or relationships. It provides a handy way of adding and updating them in bulk. Uploading people, objects, or relationships is like performing an identify call for each row in your CSV; uploading events is like performing a track call.
You'll need to provide us the public URL of your CSV as a part of this operation. We recommend that you host your CSVs from short-lived URLs. Ideally, your URLs will expire 2 hours after you initiate an import so that your customers' information doesn't remain publicly available after you've uploaded it to us.
Check out the CSV requirements based on what you're importing: people, events, and objects or relationships.
This endpoint performs some basic validation on the request and then queues the import for processing. The import happens in multiple stages after your request, and may even fail. You'll need to lookup the status of the import to check on its progress.
Records in your CSV might result in errors or warnings during the import. We make the errors and warnings available in CSV files that you can download via our export endpoints. Lookup your import to get download URLs for error and warning reports.
- importrequired
Contains your import parameters.
- dataType: string
_file _url requiredThe URL or path to the CSV file you want to import.
- identifierType: stringenumrequired
The type of identifier you want to use to identify people in your sheet—
idoremail. At least one column in the CSV must contain an identifier.values- id
- email
- nameType: stringrequired
A friendly name for your import. This helps you identify your import.
- typeenumconst:peoplerequired
The type of import.
values- people
- dataType: stringenum
_to _process Controls whether your import adds and updates all rows, adds only new rows, or updates only existing rows. Defaults to
all. Event imports support onlyallandonly_existing. Formerly calledpeople_to_process.values- all
- only
_new - only
_existing
- descriptionType: string
A helpful description that can help you find and recognize your import operation.
- application/json
- 429
Your request is over the 10-per-second limit.
curl https://api.customer.io/v1/imports \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"import": {
"name": "",
"data_file_url": "",
"type": "people",
"identifier": "id",
"data_to_process": "all",
"description": ""
}
}'
{
"import": {
"id": 30,
"name": "account-object-import",
"description": "importing accounts",
"created_at": 1706081641,
"updated_at": 1706081645,
"rows_to_import": 3,
"rows_imported": 3,
"state": "imported",
"type": "object",
"data_to_process": "all",
"people_to_process": "all",
"object_type_id": 1,
"error": "possible error - The specified Object Type does not exist."
}
}Returns an import payload.