> ## 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.

# Create import

> Create a new import from raw CSV content, inline Sure NDJSON content, or an uploaded Sure NDJSON file. CSV content is limited to 10MB.



## OpenAPI

````yaml /openapi.yaml post /api/v1/imports
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/imports:
    post:
      tags:
        - Imports
      summary: Create import
      description: >-
        Create a new import from raw CSV content, inline Sure NDJSON content, or
        an uploaded Sure NDJSON file. CSV content is limited to 10MB.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                raw_file_content:
                  type: string
                  description: >-
                    Raw CSV or Sure NDJSON content as a string. CSV content is
                    limited to 10MB. Required for SureImport unless a multipart
                    file is uploaded.
                file:
                  type: string
                  format: binary
                  description: >-
                    CSV or Sure NDJSON upload when using multipart/form-data.
                    CSV files are limited to 10MB.
                type:
                  type: string
                  enum:
                    - TransactionImport
                    - TradeImport
                    - AccountImport
                    - MintImport
                    - ActualImport
                    - YnabImport
                    - CategoryImport
                    - RuleImport
                    - MerchantImport
                    - PdfImport
                    - QifImport
                    - SureImport
                  description: Import type (defaults to TransactionImport)
                account_id:
                  type: string
                  format: uuid
                  description: Account ID to import into
                publish:
                  type: string
                  description: >-
                    Set to "true" to automatically queue for processing if
                    configuration is valid
                date_col_label:
                  type: string
                  description: CSV imports only. Header name for the date column
                amount_col_label:
                  type: string
                  description: CSV imports only. Header name for the amount column
                name_col_label:
                  type: string
                  description: >-
                    CSV imports only. Header name for the transaction name
                    column
                category_col_label:
                  type: string
                  description: CSV imports only. Header name for the category column
                tags_col_label:
                  type: string
                  description: CSV imports only. Header name for the tags column
                notes_col_label:
                  type: string
                  description: CSV imports only. Header name for the notes column
                account_col_label:
                  type: string
                  description: >-
                    CSV imports only. Header name for the account column when
                    importing rows across multiple accounts
                qty_col_label:
                  type: string
                  description: CSV trade imports only. Header name for the quantity column
                ticker_col_label:
                  type: string
                  description: CSV trade imports only. Header name for the ticker column
                price_col_label:
                  type: string
                  description: CSV trade imports only. Header name for the price column
                entity_type_col_label:
                  type: string
                  description: CSV imports only. Header name for the entity type column
                currency_col_label:
                  type: string
                  description: CSV imports only. Header name for the currency column
                exchange_operating_mic_col_label:
                  type: string
                  description: >-
                    CSV trade imports only. Header name for the exchange
                    operating MIC column
                date_format:
                  type: string
                  description: CSV imports only. Date format pattern (e.g., "%m/%d/%Y")
                number_format:
                  type: string
                  enum:
                    - 1,234.56
                    - 1.234,56
                    - 1 234,56
                    - 1,234
                  description: CSV imports only. Number format for parsing amounts
                signage_convention:
                  type: string
                  enum:
                    - inflows_positive
                    - inflows_negative
                  description: CSV imports only. How to interpret positive/negative amounts
                col_sep:
                  type: string
                  enum:
                    - ','
                    - ;
                  description: CSV imports only. Column separator
                amount_type_strategy:
                  type: string
                  enum:
                    - signed_amount
                    - custom_column
                  description: CSV imports only. Amount parsing strategy
                amount_type_inflow_value:
                  type: string
                  description: >-
                    CSV imports only. Column value that marks an amount as an
                    inflow when using custom_column strategy
          multipart/form-data:
            schema:
              type: object
              properties:
                raw_file_content:
                  type: string
                  description: >-
                    Raw CSV or Sure NDJSON content as a string. CSV content is
                    limited to 10MB. Required for SureImport unless a multipart
                    file is uploaded.
                type:
                  type: string
                  enum:
                    - TransactionImport
                    - TradeImport
                    - AccountImport
                    - MintImport
                    - ActualImport
                    - YnabImport
                    - CategoryImport
                    - RuleImport
                    - MerchantImport
                    - PdfImport
                    - QifImport
                    - SureImport
                  description: Import type (defaults to TransactionImport)
                account_id:
                  type: string
                  format: uuid
                  description: Account ID to import into
                publish:
                  type: string
                  description: >-
                    Set to "true" to automatically queue for processing if
                    configuration is valid
                date_col_label:
                  type: string
                  description: CSV imports only. Header name for the date column
                amount_col_label:
                  type: string
                  description: CSV imports only. Header name for the amount column
                name_col_label:
                  type: string
                  description: >-
                    CSV imports only. Header name for the transaction name
                    column
                category_col_label:
                  type: string
                  description: CSV imports only. Header name for the category column
                tags_col_label:
                  type: string
                  description: CSV imports only. Header name for the tags column
                notes_col_label:
                  type: string
                  description: CSV imports only. Header name for the notes column
                account_col_label:
                  type: string
                  description: >-
                    CSV imports only. Header name for the account column when
                    importing rows across multiple accounts
                qty_col_label:
                  type: string
                  description: CSV trade imports only. Header name for the quantity column
                ticker_col_label:
                  type: string
                  description: CSV trade imports only. Header name for the ticker column
                price_col_label:
                  type: string
                  description: CSV trade imports only. Header name for the price column
                entity_type_col_label:
                  type: string
                  description: CSV imports only. Header name for the entity type column
                currency_col_label:
                  type: string
                  description: CSV imports only. Header name for the currency column
                exchange_operating_mic_col_label:
                  type: string
                  description: >-
                    CSV trade imports only. Header name for the exchange
                    operating MIC column
                date_format:
                  type: string
                  description: CSV imports only. Date format pattern (e.g., "%m/%d/%Y")
                number_format:
                  type: string
                  enum:
                    - 1,234.56
                    - 1.234,56
                    - 1 234,56
                    - 1,234
                  description: CSV imports only. Number format for parsing amounts
                signage_convention:
                  type: string
                  enum:
                    - inflows_positive
                    - inflows_negative
                  description: CSV imports only. How to interpret positive/negative amounts
                col_sep:
                  type: string
                  enum:
                    - ','
                    - ;
                  description: CSV imports only. Column separator
                amount_type_strategy:
                  type: string
                  enum:
                    - signed_amount
                    - custom_column
                  description: CSV imports only. Amount parsing strategy
                amount_type_inflow_value:
                  type: string
                  description: >-
                    CSV imports only. Column value that marks an amount as an
                    inflow when using custom_column strategy
      responses:
        '201':
          description: import created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResponse'
        '422':
          description: validation error or publish rejection
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/ErrorResponseWithImportId'
        '500':
          description: import uploaded but publish enqueue failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseWithImportId'
      security:
        - apiKeyAuth: []
components:
  schemas:
    ImportResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/ImportDetail'
    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.)
    ErrorResponseWithImportId:
      type: object
      required:
        - error
        - import_id
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        import_id:
          type: string
          format: uuid
          description: >-
            Import ID preserved for retry or inspection after upload succeeds
            but publish fails
    ImportDetail:
      type: object
      required:
        - id
        - type
        - status
        - created_at
        - updated_at
        - status_detail
        - configuration
        - stats
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - TransactionImport
            - TradeImport
            - AccountImport
            - MintImport
            - ActualImport
            - YnabImport
            - CategoryImport
            - RuleImport
            - MerchantImport
            - PdfImport
            - QifImport
            - SureImport
        status:
          type: string
          enum:
            - pending
            - complete
            - importing
            - reverting
            - revert_failed
            - failed
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        account_id:
          type: string
          format: uuid
          nullable: true
        error:
          type: string
          nullable: true
        status_detail:
          $ref: '#/components/schemas/ImportStatusDetail'
        configuration:
          $ref: '#/components/schemas/ImportConfiguration'
        stats:
          $ref: '#/components/schemas/ImportStats'
        verification:
          $ref: '#/components/schemas/ImportVerification'
    ImportStatusDetail:
      allOf:
        - $ref: '#/components/schemas/ImportStatusSummary'
        - type: object
          required:
            - cleaned
            - publishable
            - revertable
          properties:
            cleaned:
              type: boolean
            publishable:
              type: boolean
            revertable:
              type: boolean
    ImportConfiguration:
      type: object
      properties:
        date_col_label:
          type: string
          nullable: true
        amount_col_label:
          type: string
          nullable: true
        name_col_label:
          type: string
          nullable: true
        category_col_label:
          type: string
          nullable: true
        tags_col_label:
          type: string
          nullable: true
        notes_col_label:
          type: string
          nullable: true
        account_col_label:
          type: string
          nullable: true
        date_format:
          type: string
          nullable: true
        number_format:
          type: string
          nullable: true
        signage_convention:
          type: string
          nullable: true
    ImportStats:
      type: object
      required:
        - rows_count
        - valid_rows_count
        - invalid_rows_count
        - mappings_count
        - unassigned_mappings_count
      properties:
        rows_count:
          type: integer
          minimum: 0
        valid_rows_count:
          type: integer
          minimum: 0
        invalid_rows_count:
          type: integer
          minimum: 0
        mappings_count:
          type: integer
          minimum: 0
        unassigned_mappings_count:
          type: integer
          minimum: 0
    ImportVerification:
      type: object
      description: SureImport only. Captured at upload and completed after import publish.
      required:
        - expected_record_counts
        - readback
      properties:
        expected_record_counts:
          type: object
          additionalProperties:
            type: integer
        readback:
          $ref: '#/components/schemas/ImportVerificationReadback'
    ImportStatusSummary:
      type: object
      required:
        - uploaded
        - configured
        - terminal
      properties:
        uploaded:
          type: boolean
        configured:
          type: boolean
        terminal:
          type: boolean
    ImportVerificationReadback:
      type: object
      description: >-
        SureImport only. Expected NDJSON counts compared to family-scoped
        database readback after publish.
      properties:
        status:
          type: string
          enum:
            - not_verified
            - matched
            - mismatch
            - failed
            - reverted
        checked_at:
          type: string
          format: date-time
          nullable: true
        expected_record_counts:
          type: object
          additionalProperties:
            type: integer
        before_counts:
          type: object
          additionalProperties:
            type: integer
        after_counts:
          type: object
          additionalProperties:
            type: integer
        actual_delta_counts:
          type: object
          additionalProperties:
            type: integer
        checked_counts:
          type: object
          additionalProperties:
            type: integer
        mismatches:
          type: object
          additionalProperties:
            type: object
            required:
              - expected
              - actual
            properties:
              expected:
                type: integer
              actual:
                type: integer
        error:
          type: string
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````