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

# Publish import session

> Queue ordered chunk processing for a SureImport session. Later chunks can reference source IDs mapped by earlier chunks.



## OpenAPI

````yaml /openapi.yaml post /api/v1/import_sessions/{id}/publish
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/{id}/publish:
    parameters:
      - name: id
        in: path
        required: true
        description: Import session ID
        schema:
          type: string
    post:
      tags:
        - Import Sessions
      summary: Publish import session
      description: >-
        Queue ordered chunk processing for a SureImport session. Later chunks
        can reference source IDs mapped by earlier chunks.
      responses:
        '202':
          description: import session publish queued
          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'
        '404':
          description: import session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: missing expected chunks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: max_row_count_exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: enqueue failed
          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.

````