{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customer-io/json-schema/customer-io-import-request-schema.json",
  "title": "import_request",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customer-io-imports-api-openapi.yml#/components/schemas/import_request",
  "x-scalar-ignore": true,
  "oneOf": [
    {
      "title": "people",
      "type": "object",
      "description": "Contains your import parameters.",
      "required": [
        "data_file_url",
        "name",
        "type",
        "identifier"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/import_name"
        },
        "data_file_url": {
          "type": "string",
          "description": "The URL or path to the CSV file you want to import."
        },
        "type": {
          "type": "string",
          "description": "The type of import.",
          "enum": [
            "people"
          ]
        },
        "identifier": {
          "$ref": "#/$defs/import_identifier"
        },
        "data_to_process": {
          "$ref": "#/$defs/data_to_process"
        },
        "description": {
          "$ref": "#/$defs/import_description"
        }
      }
    },
    {
      "title": "event",
      "type": "object",
      "description": "Contains your import parameters.",
      "required": [
        "data_file_url",
        "name",
        "type",
        "identifier"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/import_name"
        },
        "data_file_url": {
          "type": "string",
          "description": "The URL or path to the CSV file you want to import."
        },
        "type": {
          "type": "string",
          "description": "The type of import.",
          "enum": [
            "event"
          ]
        },
        "identifier": {
          "$ref": "#/$defs/import_identifier"
        },
        "data_to_process": {
          "$ref": "#/$defs/data_to_process"
        },
        "description": {
          "$ref": "#/$defs/import_description"
        }
      }
    },
    {
      "title": "relationship",
      "type": "object",
      "description": "Contains your import parameters.",
      "required": [
        "data_file_url",
        "name",
        "type",
        "identifier"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/import_name"
        },
        "data_file_url": {
          "type": "string",
          "description": "The URL or path to the CSV file you want to import."
        },
        "type": {
          "type": "string",
          "description": "The type of import.",
          "enum": [
            "relationship"
          ]
        },
        "identifier": {
          "type": "string",
          "description": "The type of identifier used to identify the person in each relationship—`id`, `email`, or `cio_id`.",
          "enum": [
            "id",
            "email",
            "cio_id"
          ]
        },
        "data_to_process": {
          "$ref": "#/$defs/data_to_process"
        },
        "description": {
          "$ref": "#/$defs/import_description"
        }
      }
    },
    {
      "title": "object",
      "type": "object",
      "description": "Contains your import parameters.",
      "required": [
        "data_file_url",
        "name",
        "type",
        "object_type_id"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/import_name"
        },
        "data_file_url": {
          "type": "string",
          "description": "The URL or path to the CSV file you want to import."
        },
        "object_type_id": {
          "$ref": "#/$defs/object_type_id"
        },
        "type": {
          "type": "string",
          "description": "The type of import.",
          "enum": [
            "object"
          ]
        },
        "data_to_process": {
          "$ref": "#/$defs/data_to_process"
        },
        "description": {
          "$ref": "#/$defs/import_description"
        }
      }
    }
  ],
  "$defs": {
    "data_to_process": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "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`.",
      "enum": [
        "all",
        "only_new",
        "only_existing"
      ]
    },
    "import_description": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "A helpful description that can help you find and recognize your import operation."
    },
    "import_identifier": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "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.",
      "enum": [
        "id",
        "email"
      ]
    },
    "import_name": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "A friendly name for your import. This helps you identify your import."
    },
    "object_type_id": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "The object type an object belongs to—like \"Companies\" or \"Accounts\". Object type IDs are string-formatted integers that begin at `1` and increment for each new type."
    }
  }
}