> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787365312803.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create import session

> Create or idempotently retrieve a multi-file SureImport session keyed by client_session_id.



## OpenAPI

````yaml /openapi.yaml post /api/v1/import_sessions
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation generated from executable request specs.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/import_sessions:
    post:
      tags:
        - Import Sessions
      summary: Create import session
      description: >-
        Create or idempotently retrieve a multi-file SureImport session keyed by
        client_session_id.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - SureImport
                  description: Import session type. Only SureImport is supported.
                client_session_id:
                  type: string
                  nullable: true
                  description: Client-provided idempotency key for the full import session.
                expected_chunks:
                  type: integer
                  minimum: 1
                  nullable: true
                  description: Expected number of ordered chunks before publish is allowed.
      responses:
        '201':
          description: import session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportSessionResponse'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: client session conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    ImportSessionResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/ImportSession'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
        errors:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Validation error messages (alternative to details used by trades,
            valuations, etc.)
    ImportSession:
      type: object
      required:
        - id
        - type
        - status
        - chunks_count
        - summary
        - chunks
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - SureImport
        status:
          type: string
          enum:
            - pending
            - importing
            - complete
            - failed
        client_session_id:
          type: string
          nullable: true
        expected_chunks:
          type: integer
          nullable: true
          minimum: 1
        chunks_count:
          type: integer
          minimum: 0
        summary:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
        error:
          type: object
          additionalProperties: true
          nullable: true
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/ImportSessionChunk'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ImportSessionChunk:
      type: object
      required:
        - id
        - sequence
        - status
        - rows_count
        - summary
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        sequence:
          type: integer
          minimum: 1
        client_chunk_id:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - pending
            - importing
            - complete
            - failed
        rows_count:
          type: integer
          minimum: 0
        summary:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
        error:
          type: object
          additionalProperties: true
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````