v1.0.0
OpenAPI 3.1.0

Import items in bulk

US region

Client Libraries

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.

Body
application/json
  • import
    required

    Contains your import parameters.

    • data_file_url
      Type: string
      required

      The URL or path to the CSV file you want to import.

    • identifier
      Type: stringenum
      required

      The type of identifier you want to use to identify people in your sheet—id or email. At least one column in the CSV must contain an identifier.

      values
      • id
      • email
    • name
      Type: string
      required

      A friendly name for your import. This helps you identify your import.

    • type
      enum
      const:  
      people
      required

      The type of import.

      values
      • people
    • data_to_process
      Type: stringenum

      Controls whether your import adds and updates all rows, adds only new rows, or updates only existing rows. Defaults to all. Event imports support only all and only_existing. Formerly called people_to_process.

      values
      • all
      • only_new
      • only_existing
    • description
      Type: string

      A helpful description that can help you find and recognize your import operation.

Responses
  • application/json
  • 429

    Your request is over the 10-per-second limit.

Request Example for post/v1/imports
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."
  }
}