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

# Fetch import

> Retrieve the status and associated details of an import

# How to use it

After pushing data to Qobra with the [Record ingestion route](./ingest_records),
you’ll receive an `import_id`. Since Qobra record ingestion is performed as a
background task, you’ll have to fetch your import details to verify it went
successfully.


## OpenAPI

````yaml get /v1/imports/{import_id}
openapi: 3.0.2
info:
  version: 1.0.0
  title: Qobra API
  description: API documentation for Qobra
servers:
  - url: https://api.qobra.co
    description: API
security: []
paths:
  /v1/imports/{import_id}:
    get:
      tags:
        - public_api
        - v1
        - imports
      summary: Fetch import
      description: Retrieve the status and associated details of an import
      operationId: GET_/v1/imports/(import_id)
      parameters:
        - name: import_id
          in: path
          required: true
          schema:
            type: string
            format: ObjectId
          description: Used to identify the import
      responses:
        '200':
          description: Success operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportModelResponseSuccess'
              examples:
                import-success:
                  $ref: '#/components/examples/ImportModelResponseSuccessExample'
      security:
        - api_key: []
components:
  schemas:
    ImportModelResponseSuccess:
      type: object
      properties:
        data_import:
          $ref: '#/components/schemas/ImportModel'
      required:
        - data_import
      title: ImportModelResponse
    ImportModel:
      description: >-
        Each import contains information about their status, progress and
        potential errors. Note that imports stack together, meaning that a
        single import can show data about several data tables.
      type: object
      properties:
        data_tables_details:
          title: Data Tables Details
          description: Detailed information for each data table imported
          type: array
          items:
            $ref: '#/components/schemas/ImportConfigModel'
        id:
          title: Id
          description: Id of the import
          type: string
          format: ObjectId
        created_at:
          title: Created At
          description: Import creation time
          type: string
          format: date-time
        launched_at:
          title: Launched At
          description: Import launch time if started, null otherwise
          type: string
          format: date-time
        finished_at:
          title: Finished At
          description: Import finish time if started, null otherwise
          type: string
          format: date-time
        progress:
          title: Progress
          description: Indicates the progress percentage of your import
          type: string
        error:
          title: Error
          description: Whether an error happened during the import
          type: boolean
        status:
          $ref: '#/components/schemas/ImportStatus'
      required:
        - id
        - created_at
        - progress
        - error
        - status
        - data_tables_details
      title: ImportModel
    ImportConfigModel:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ImportTypes'
        status:
          $ref: '#/components/schemas/ImportStatus'
        error:
          $ref: '#/components/schemas/ImportConfigErrorModel'
        data_table_key:
          title: Data Table Key
          description: >-
            API key used to identify the data table (the one you used to forge
            the url for record ingestion).
          type: string
        progress:
          title: Progress
          description: Indicates the progress percentage for the given data table.
          type: string
        number_of_records:
          title: Number Of Records
          description: Number of records imported, can be null.
          type: integer
      required:
        - type
        - status
        - progress
      title: ImportConfigModel
    ImportStatus:
      title: ImportStatus
      description: Status of the import
      enum:
        - finished
        - scheduled
        - started
      type: string
    ImportTypes:
      title: ImportTypes
      description: >-
        Origin of the import. All the imports coming from your api calls will be
        labeled api
      enum:
        - api
        - csv
        - integration
      type: string
    ImportConfigErrorModel:
      title: ImportConfigErrorModel
      description: Details about the error that have occurred for the data tables
      type: object
      properties:
        title:
          title: Title
          description: Error title
          type: string
        description:
          title: Description
          description: Error description
          type: string
        parsing_error_details:
          title: Error by line
          description: Detail of the error that happened for each line of the import.
          type: array
          items:
            $ref: '#/components/schemas/ParsingErrorImportLineModel'
    ParsingErrorImportLineModel:
      title: ParsingErrorImportLineModel
      type: object
      properties:
        line_number:
          title: Line Number
          description: Import line where the error occurred
          type: integer
        row:
          title: Row
          description: Row that was input when the error occurred
          type: object
        details:
          title: Details
          description: More details about the stacktrace of the error.
          type: string
  examples:
    ImportModelResponseSuccessExample:
      value:
        data_import:
          id: 647a13fe875af4b4eb7133c2
          created_at: '2024-06-25T09:58:32Z'
          launched_at: '2024-06-25T10:03:27Z'
          finished_at: '2024-06-25T10:14:12Z'
          status: finished
          progress: 100
          data_tables_details:
            - type: api
              status: finished
              data_table_key: companies
              progress: 100
              number_of_records: 122
              error: null
            - type: api
              status: finished
              data_table_key: opportunities
              progress: 100
              number_of_records: null
              error:
                title: ParsingError
                description: Can't parse 'AAAAA' as float for user attribute amount
                parsing_error_details:
                  - line_number: 1
                    row:
                      id: '1'
                      name: Great opportunity
                      user: user@example.fr
                      amount: AAAAA
                    details: 'ValueError: could not convert string to float: ''AAAAA'''
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header

````