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

# Import what you picked

> Start an import in the background. Poll ``GET /documents/imports/{id}``.



## OpenAPI

````yaml post /api/documents/imports
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/documents/imports:
    post:
      tags:
        - Document imports
      summary: Import what you picked
      description: Start an import in the background. Poll ``GET /documents/imports/{id}``.
      operationId: start_import_api_documents_imports_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api__models__document_source_models__ImportResponse
        '403':
          description: Needs a personal sign-in.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Unknown source, or not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The source isn't set up, or you need to connect (again).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Too Many Requests
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    ImportRequest:
      properties:
        source:
          type: string
          enum:
            - notion
            - sharepoint
            - google_drive
            - onedrive
            - confluence
          title: Source
        items:
          items:
            $ref: '#/components/schemas/ImportPick'
          type: array
          maxItems: 500
          minItems: 1
          title: Items
        subtype:
          anyOf:
            - type: string
              enum:
                - Runbook
                - FAQ
                - Insight
                - Definition
                - Decision
            - type: 'null'
          title: Subtype
          description: DataHub document type for every imported document.
        catalog:
          type: boolean
          title: Catalog
          description: >-
            Add the documents to the shared catalogue (DataHub), as uploads are:
            anyone who can search it can read their text. Off keeps them private
            to you.
          default: true
        enrich:
          type: boolean
          title: Enrich
          description: >-
            Have the enrichment crew suggest a summary, tags, terms and a
            domain. Off by default: any catalogue document can be classified
            later from its page.
          default: false
        ocr:
          type: boolean
          title: Ocr
          description: >-
            Read scanned PDFs with OCR (slower). Without it a scanned PDF is
            imported without text.
          default: false
      type: object
      required:
        - source
        - items
      title: ImportRequest
      description: Start an import.
    api__models__document_source_models__ImportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        source:
          type: string
          enum:
            - notion
            - sharepoint
            - google_drive
            - onedrive
            - confluence
          title: Source
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
          title: Status
        total:
          type: integer
          title: Total
          description: Files and pages found (folders expanded).
        imported:
          type: integer
          title: Imported
          description: New documents, and replaced ones.
        skipped:
          type: integer
          title: Skipped
        failed:
          type: integer
          title: Failed
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Why the whole import stopped.
        options:
          additionalProperties: true
          type: object
          title: Options
        created_at:
          type: string
          format: date-time
          title: Created At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        items:
          items:
            $ref: '#/components/schemas/ImportItemResponse'
          type: array
          title: Items
      type: object
      required:
        - id
        - source
        - status
        - total
        - imported
        - skipped
        - failed
        - created_at
      title: ImportResponse
      description: An import and, on its own page, its items.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    ImportPick:
      properties:
        id:
          type: string
          maxLength: 512
          minLength: 1
          title: Id
        name:
          type: string
          maxLength: 400
          minLength: 1
          title: Name
        container:
          type: boolean
          title: Container
          description: 'A folder, space or database: import what''s inside.'
          default: false
        path:
          type: string
          maxLength: 1000
          title: Path
          default: ''
      type: object
      required:
        - id
        - name
      title: ImportPick
      description: Something the caller chose.
    ImportItemResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        external_id:
          type: string
          title: External Id
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
        status:
          type: string
          enum:
            - queued
            - importing
            - imported
            - updated
            - skipped
            - failed
          title: Status
        document_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Document Id
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Why it failed or was skipped.
        web_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Web Url
      type: object
      required:
        - id
        - external_id
        - name
        - path
        - status
      title: ImportItemResponse
      description: One file or page of an import.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.