> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpanel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Event Stream Import

> Create a new warehouse import for event data.

Event stream imports sync event data from your warehouse table to Mixpanel.
Each row in your table becomes an event in Mixpanel.

### Sync Modes

- **time_based**: Incrementally syncs new rows based on an insert time column
- **mirror_mode**: Detects changes in the source table and mirrors them to Mixpanel
- **full_sync**: Re-syncs all data on each run
- **one_time**: Syncs data once and does not repeat

### Required Column Mappings

You must specify either:
- `event_name`: A static event name for all rows
- `event_column_name`: The column containing the event name

For B2B projects, `company_column_name` is also required.

### Scheduling

- **run_every** (integer): Sync frequency in nanoseconds. Allowed values:
  - Trigger via API: `0`
  - Hourly: `3600000000000` (60 * 60 * 10^9)
  - Daily: `86400000000000` (24 * 60 * 60 * 10^9)
  - Weekly: `604800000000000` (7 * 24 * 60 * 60 * 10^9)
- **databricks_params** (object): Databricks-specific cluster configuration (only for Databricks sources)




## OpenAPI

````yaml openapi/warehouse-connectors.openapi.yaml POST /projects/{projectId}/warehouse-sources/imports/event-stream
openapi: 3.0.2
info:
  title: Warehouse Connectors API
  description: >
    Connect an external warehouse to import events, users, groups, and lookup
    tables.


    This API allows you to manage warehouse imports from external data
    warehouses including

    BigQuery, Snowflake, Redshift, Databricks, and PostgreSQL.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
  contact:
    url: https://mixpanel.com/get-support
servers:
  - url: https://{regionAndDomain}.com/api/app
    description: Mixpanel's application API server.
    variables:
      regionAndDomain:
        default: mixpanel
        enum:
          - mixpanel
          - eu.mixpanel
          - in.mixpanel
        description: |
          The server location to be used:
            * `mixpanel` - The default (US) servers used for most projects
            * `eu.mixpanel` - EU servers if you are enrolled in EU Data Residency
            * `in.mixpanel` - India servers if you are enrolled in India Data Residency
security:
  - ServiceAccount: []
tags:
  - name: Warehouse Imports
    description: Manage warehouse data imports
paths:
  /projects/{projectId}/warehouse-sources/imports/event-stream:
    post:
      tags:
        - Warehouse Imports
      summary: Create an event stream import
      description: >
        Create a new warehouse import for event data.


        Event stream imports sync event data from your warehouse table to
        Mixpanel.

        Each row in your table becomes an event in Mixpanel.


        ### Sync Modes


        - **time_based**: Incrementally syncs new rows based on an insert time
        column

        - **mirror_mode**: Detects changes in the source table and mirrors them
        to Mixpanel

        - **full_sync**: Re-syncs all data on each run

        - **one_time**: Syncs data once and does not repeat


        ### Required Column Mappings


        You must specify either:

        - `event_name`: A static event name for all rows

        - `event_column_name`: The column containing the event name


        For B2B projects, `company_column_name` is also required.


        ### Scheduling


        - **run_every** (integer): Sync frequency in nanoseconds. Allowed
        values:
          - Trigger via API: `0`
          - Hourly: `3600000000000` (60 * 60 * 10^9)
          - Daily: `86400000000000` (24 * 60 * 60 * 10^9)
          - Weekly: `604800000000000` (7 * 24 * 60 * 60 * 10^9)
        - **databricks_params** (object): Databricks-specific cluster
        configuration (only for Databricks sources)
      operationId: create-event-stream-import
      parameters:
        - in: path
          name: projectId
          schema:
            type: integer
          required: true
          description: 'Your project id (eg: 12345)'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEventStreamImportRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: '"ok" if the request succeeded, "error" otherwise.'
                    example: ok
                    enum:
                      - ok
                  results:
                    $ref: '#/components/schemas/WarehouseImportDetail'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Details about the error that occurred
                  status:
                    type: string
                    enum:
                      - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Details about the error that occurred
                  status:
                    type: string
                    enum:
                      - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Details about the error that occurred
                  status:
                    type: string
                    enum:
                      - error
components:
  schemas:
    CreateEventStreamImportRequest:
      type: object
      required:
        - import_type
        - warehouse_source_id
        - table_params
        - time_column_name
        - sync_mode
      properties:
        import_type:
          type: string
          enum:
            - event_stream
        warehouse_source_id:
          type: integer
        table_params:
          $ref: '#/components/schemas/TableParams'
        event_name:
          type: string
        event_column_name:
          type: string
        time_column_name:
          type: string
        user_column_name:
          type: string
        company_column_name:
          type: string
          description: >-
            Required for B2B projects. The column containing the company
            identifier.
        device_column_name:
          type: string
          nullable: true
        json_properties_column_name:
          type: string
          nullable: true
        sync_mode:
          $ref: '#/components/schemas/SyncMode'
        run_every:
          $ref: '#/components/schemas/SyncFrequency'
        insert_time_column_name:
          type: string
          nullable: true
        property_mappings:
          $ref: '#/components/schemas/PropertyMappings'
        databricks_params:
          $ref: '#/components/schemas/DatabricksParams'
    WarehouseImportDetail:
      allOf:
        - $ref: '#/components/schemas/WarehouseImport'
        - type: object
          properties:
            event_name:
              type: string
              nullable: true
            event_column_name:
              type: string
              nullable: true
            time_column_name:
              type: string
              nullable: true
            user_column_name:
              type: string
              nullable: true
            insert_time_column_name:
              type: string
              nullable: true
            property_mappings:
              $ref: '#/components/schemas/PropertyMappings'
            group_key:
              type: string
              nullable: true
            group_id_column:
              type: string
              nullable: true
            databricks_params:
              $ref: '#/components/schemas/DatabricksParams'
    TableParams:
      type: object
      description: Table location parameters (structure depends on warehouse type)
    SyncMode:
      type: string
      enum:
        - time_based
        - mirror_mode
        - full_sync
        - one_time
    SyncFrequency:
      type: integer
      description: |
        Sync frequency in nanoseconds. Only these values are accepted:
        - `0` - API-triggered only (use the manual-sync endpoint to trigger)
        - `3600000000000` - Hourly
        - `86400000000000` - Daily
        - `604800000000000` - Weekly
      enum:
        - 0
        - 3600000000000
        - 86400000000000
        - 604800000000000
    PropertyMappings:
      type: object
      nullable: true
      additionalProperties:
        type: string
    DatabricksParams:
      type: object
      nullable: true
      properties:
        export_cluster_config:
          $ref: '#/components/schemas/DatabricksClusterConfig'
    WarehouseImport:
      type: object
      properties:
        id:
          type: integer
        import_type:
          $ref: '#/components/schemas/ImportType'
        sync_mode:
          $ref: '#/components/schemas/SyncMode'
        created:
          type: string
          format: date-time
        creator_id:
          type: integer
        creator_name:
          type: string
        creator_email:
          type: string
        warehouse_source_id:
          type: integer
        table_params:
          $ref: '#/components/schemas/TableParams'
        paused:
          type: boolean
        run_every:
          allOf:
            - $ref: '#/components/schemas/SyncFrequency'
        last_dispatch:
          type: integer
          nullable: true
        is_deleted:
          type: boolean
    DatabricksClusterConfig:
      type: object
      nullable: true
      additionalProperties: false
      properties:
        spark_version:
          type: string
          description: Spark runtime version (e.g., '15.4.x-scala2.12')
        node_type_id:
          type: string
          description: Instance type for worker nodes (e.g., 'n2-standard-4' for GCP)
        driver_node_type_id:
          type: string
          nullable: true
          description: Instance type for driver node (defaults to node_type_id if not set)
        num_workers:
          type: integer
          minimum: 0
          description: Fixed number of worker nodes
        autoscale:
          type: object
          nullable: true
          additionalProperties: false
          description: Autoscaling configuration (overrides num_workers if set)
          properties:
            min_workers:
              type: integer
              minimum: 0
            max_workers:
              type: integer
              minimum: 1
        spark_conf:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Spark configuration key-value pairs
        spark_env_vars:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Environment variables (PYSPARK_PYTHON is always included)
        data_security_mode:
          type: string
          nullable: true
          enum:
            - USER_ISOLATION
            - SINGLE_USER
            - NONE
            - LEGACY_TABLE_ACL
            - LEGACY_PASSTHROUGH
            - LEGACY_SINGLE_USER
            - LEGACY_SINGLE_USER_STANDARD
          description: Data security mode for the cluster
        single_user_name:
          type: string
          nullable: true
          description: Required if data_security_mode is SINGLE_USER
        custom_tags:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Custom tags (provider=mixpanel is always added)
        policy_id:
          type: string
          nullable: true
          description: Cluster policy ID
        instance_pool_id:
          type: string
          nullable: true
          description: Instance pool ID for worker nodes
        driver_instance_pool_id:
          type: string
          nullable: true
          description: Instance pool ID for driver node
        enable_elastic_disk:
          type: boolean
          nullable: true
          description: Enable autoscaling local storage
        runtime_engine:
          type: string
          nullable: true
          enum:
            - STANDARD
            - PHOTON
          description: Runtime engine (STANDARD or PHOTON)
        aws_attributes:
          type: object
          nullable: true
          description: AWS-specific cluster configuration
        azure_attributes:
          type: object
          nullable: true
          description: Azure-specific cluster configuration
        gcp_attributes:
          type: object
          nullable: true
          description: GCP-specific cluster configuration
        init_scripts:
          type: array
          nullable: true
          items:
            type: object
          description: Cluster initialization scripts
    ImportType:
      type: string
      enum:
        - event_sync
        - event_stream
        - people
        - groups
        - lookup_table
  securitySchemes:
    ServiceAccount:
      type: http
      scheme: basic
      description: Service Account

````