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

# Queue a CSV or Shopify Capability import



## OpenAPI

````yaml /openapi-v2.json post /host/ais/{aiId}/capability-imports
openapi: 3.1.0
info:
  title: Darwin API v2
  version: 2.0.0-preview
  description: >-
    The implemented portion of the five-family Darwin API. Operations are added
    only after runtime and contract verification.
servers:
  - url: https://api.darwin.so/api/v2
    description: Production — use live `darwin_…` keys.
  - url: https://api.dev.darwin.so/api/v2
    description: Sandbox — use isolated `darwin_test_…` keys.
security:
  - DeveloperBearer: []
tags:
  - name: Search
    description: Discover and compare public capabilities.
  - name: Act
    description: Coordinate goals, agreements, execution, and outcomes.
  - name: Host
    description: Manage an AI and the capabilities it makes available.
  - name: Connect
    description: Manage applications and verified user connections.
  - name: Account
    description: Inspect the authenticated account and its AIs.
paths:
  /host/ais/{aiId}/capability-imports:
    post:
      tags:
        - Host
      summary: Queue a CSV or Shopify Capability import
      operationId: createCapabilityImport
      parameters:
        - name: aiId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: A caller-generated key, unique to this operation and payload.
          schema:
            type: string
            minLength: 1
            maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCapabilityImportRequest'
      responses:
        '202':
          description: The durably queued import.
          headers:
            Location:
              description: Canonical URL for polling the queued operation.
              schema:
                type: string
                format: uri
            Operation-Location:
              description: Canonical URL for polling the queued operation.
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                type: object
                required:
                  - capabilityImport
                  - statusUrl
                properties:
                  capabilityImport:
                    $ref: '#/components/schemas/CapabilityImport'
                  statusUrl:
                    type: string
                    format: uri
components:
  schemas:
    CreateCapabilityImportRequest:
      type: object
      required:
        - kind
      additionalProperties: false
      properties:
        kind:
          type: string
          enum:
            - CSV
            - SHOPIFY
        sourceId:
          type: string
        objectKey:
          type: string
        mapping:
          type: object
          additionalProperties: true
        defaults:
          type: object
          additionalProperties: true
    CapabilityImport:
      type: object
      required:
        - id
        - aiId
        - kind
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        aiId:
          type: string
        kind:
          type: string
          enum:
            - CSV
            - SHOPIFY
        status:
          type: string
          enum:
            - QUEUED
            - VALIDATING
            - READY
            - IMPORTING
            - COMPLETED
            - PARTIAL
            - FAILED
            - CANCELED
        processedRows:
          type: integer
          minimum: 0
        successfulRows:
          type: integer
          minimum: 0
        failedRows:
          type: integer
          minimum: 0
        errorObjectKey:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    DeveloperBearer:
      type: http
      scheme: bearer
      bearerFormat: Darwin API key
      description: >-
        Production keys begin with `darwin_`. Isolated sandbox keys begin with
        `darwin_test_`. Create keys in Developer settings.

````