> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-docs-cloudflare-tunnel-self-hosting.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.



## OpenAPI

````yaml /openapi.yaml post /api/v1/imports
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation for the Sure API.
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.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                raw_file_content:
                  type: string
                  description: The raw CSV content as a string
                type:
                  type: string
                  enum:
                    - TransactionImport
                    - TradeImport
                    - AccountImport
                    - MintImport
                    - CategoryImport
                    - RuleImport
                    - 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: Header name for the date column
                amount_col_label:
                  type: string
                  description: Header name for the amount column
                name_col_label:
                  type: string
                  description: Header name for the transaction name column
                category_col_label:
                  type: string
                  description: Header name for the category column
                tags_col_label:
                  type: string
                  description: Header name for the tags column
                notes_col_label:
                  type: string
                  description: Header name for the notes column
                account_col_label:
                  type: string
                  description: Header name for the account column
                qty_col_label:
                  type: string
                  description: Header name for the quantity column (trade imports)
                ticker_col_label:
                  type: string
                  description: Header name for the ticker column (trade imports)
                price_col_label:
                  type: string
                  description: Header name for the price column (trade imports)
                entity_type_col_label:
                  type: string
                  description: Header name for the entity type column (account imports)
                currency_col_label:
                  type: string
                  description: Header name for the currency column
                exchange_operating_mic_col_label:
                  type: string
                  description: Header name for the exchange MIC column (trade imports)
                date_format:
                  type: string
                  description: 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: Number format for parsing amounts
                signage_convention:
                  type: string
                  enum:
                    - inflows_positive
                    - inflows_negative
                  description: How to interpret positive/negative amounts
                col_sep:
                  type: string
                  enum:
                    - ','
                    - ;
                  description: Column separator
                amount_type_strategy:
                  type: string
                  description: Strategy for determining transaction direction
                amount_type_inflow_value:
                  type: string
                  description: >-
                    Value that indicates an inflow when using column-based
                    amount type strategy
        required: true
      responses:
        '201':
          description: import created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResponse'
        '422':
          description: validation error - file too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      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
    ImportDetail:
      type: object
      required:
        - id
        - type
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - TransactionImport
            - TradeImport
            - AccountImport
            - MintImport
            - CategoryImport
            - RuleImport
            - 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
        configuration:
          $ref: '#/components/schemas/ImportConfiguration'
        stats:
          $ref: '#/components/schemas/ImportStats'
    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
        qty_col_label:
          type: string
          nullable: true
        ticker_col_label:
          type: string
          nullable: true
        price_col_label:
          type: string
          nullable: true
        entity_type_col_label:
          type: string
          nullable: true
        currency_col_label:
          type: string
          nullable: true
        exchange_operating_mic_col_label:
          type: string
          nullable: true
        date_format:
          type: string
          nullable: true
        number_format:
          type: string
          nullable: true
        signage_convention:
          type: string
          nullable: true
        col_sep:
          type: string
          nullable: true
        amount_type_strategy:
          type: string
          nullable: true
        amount_type_inflow_value:
          type: string
          nullable: true
    ImportStats:
      type: object
      properties:
        rows_count:
          type: integer
          minimum: 0
        valid_rows_count:
          type: integer
          minimum: 0
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````