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

# Initialize upload session

> Creates a new session or reports an existing one. Returns `409` if a session is already active.



## OpenAPI

````yaml /connector-api/openapi.json post /uploading/initialize-session
openapi: 3.1.0
info:
  title: Connector API
  version: 0.1.0
servers:
  - url: https://etl-api-dev2.datawiz.io/api/v1
    description: Connector API
security: []
paths:
  /uploading/initialize-session:
    post:
      tags:
        - Uploading
      summary: Initialize upload session
      description: >-
        Creates a new session or reports an existing one. Returns `409` if a
        session is already active.
      operationId: initialize_session_api_v1_uploading_initialize_session_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitializeSessionCreatedResponse'
        '400':
          description: >-
            Missing Client-Id header. Body: `{"detail": "Client-ID header is
            missing"}`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
        '401':
          description: >-
            Invalid or missing access token. Body: `{"detail": "User not
            authenticated"}`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
        '409':
          description: >-
            Active session already exists (`already_exists`) or ETL is running
            (`workflow_running`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitializeSessionConflictResponse'
        '413':
          description: >-
            Request body exceeds size limit (32 MB for ingest, 1 MB for other
            requests).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
        '503':
          description: Rate limit or concurrent connection limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
      security:
        - Authorization: []
          Client-Id: []
components:
  schemas:
    InitializeSessionCreatedResponse:
      properties:
        status:
          type: string
          const: created
          title: Status
          description: Session was created.
        upload_uuid:
          type: string
          title: Upload Uuid
          description: Identifier of the active upload session.
        message:
          type: string
          title: Message
          description: Human-readable result message.
        previous_upload_uuid:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Upload Uuid
          description: >-
            Previous session UUID when a completed session was replaced with a
            new one.
      type: object
      required:
        - status
        - upload_uuid
        - message
      title: InitializeSessionCreatedResponse
    ErrorDetailResponse:
      properties:
        detail:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
          title: Detail
          description: Error message or structured error object.
      type: object
      required:
        - detail
      title: ErrorDetailResponse
    InitializeSessionConflictResponse:
      properties:
        status:
          type: string
          enum:
            - already_exists
            - workflow_running
          title: Status
          description: Reason the session was not created.
        session_status:
          type: string
          title: Session Status
          description: Current status of the existing session.
        upload_uuid:
          type: string
          title: Upload Uuid
          description: Identifier of the existing upload session.
        message:
          type: string
          title: Message
          description: Human-readable explanation.
      type: object
      required:
        - status
        - session_status
        - upload_uuid
        - message
      title: InitializeSessionConflictResponse
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization
    Client-Id:
      type: apiKey
      in: header
      name: Client-Id

````