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

# Read import monitoring record by ID

> This endpoint retrieves detailed information about a specific import monitoring record by its ID. Use this to check the status and results of a particular import operation.

**Use Cases:**
- Get detailed status of a specific import
- Download failed records file
- Retrieve import statistics
- Monitor import progress



## OpenAPI

````yaml /openapi/public/openapi-importexport.json get /import-monitoring/{id}
openapi: 3.0.0
info:
  title: MileApp API - ImportExport
  version: 3.0.0
  description: MileApp API Documentation - RESTful API for field operations management.
servers:
  - url: https://apiweb.mile.app/api/v3
security:
  - bearerAuth: []
tags:
  - name: Data Import
    description: >-
      The Data Import module allows users to upload and import data source
      records from Excel or CSV files. Import operations are processed in the
      background via queue system for scalability and can handle large datasets.
      The import process validates data against data type schemas, tracks
      processing status in real-time, and generates detailed reports including
      failed records for review. All import activities can be monitored through
      import-monitoring endpoints with 30-day data retention.
  - name: Export Task
    description: >-
      The Export Task module provides functionality to export task data and data
      source records to various formats (XLSX, JSON). It supports both direct
      export for small datasets and background processing for large exports.
      Users can customize exports using export configurations, filter data by
      multiple criteria, and monitor export operations through export logs.
      Export files are stored securely with 30-day retention period.
  - name: Export Config
    description: >-
      The Export Config module is used to save and manage the specific fields
      that a user wants included in export results. This allows users to
      customize their exported data by selecting only the necessary fields for
      each export, ensuring that the output contains exactly the information
      they need.


      **To see the details of export config object, please follow [this
      link](#tag/export_config_model)**
  - name: Import Config
    description: >-
      The Import Config module saves and manages column mapping presets for bulk
      import features across MileApp. Users can store field-to-Excel-column
      mappings so they can be reused across multiple imports. Each config is
      linked to a specific resource and contains the mapping between its fields
      and Excel header columns.
paths:
  /import-monitoring/{id}:
    get:
      tags:
        - Data Import
      summary: Read import monitoring record by ID
      description: >-
        This endpoint retrieves detailed information about a specific import
        monitoring record by its ID. Use this to check the status and results of
        a particular import operation.


        **Use Cases:**

        - Get detailed status of a specific import

        - Download failed records file

        - Retrieve import statistics

        - Monitor import progress
      operationId: GetImportMonitoringById
      parameters:
        - name: id
          in: path
          required: true
          description: |-
            The import monitoring record ID.
            **Example:** `65f8a4c2d9e3b1234567890a`
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                title: ImportMonitoringDetailResponse
                properties:
                  status:
                    type: boolean
                    description: Status of response.
                  message:
                    description: Message of API response.
                    type: string
                  data:
                    $ref: '#/components/schemas/ImportMonitoringObject'
                example:
                  status: true
                  message: Success
                  data:
                    _id: 65f8a4c2d9e3b1234567890a
                    organizationId: 63c61d865347e356d05e3052
                    type: string
                    hubId: 63c63ab1b6972d3150348172
                    filename: outlets_import.xlsx
                    totalRows: 150
                    totalValid: 145
                    totalInvalid: 5
                    status: partially
                    dataTypeId: 63db2fb476bc679c540369c4
                    dataTypeName: OutletDetail
                    fileTemplate: >-
                      https://staticdev.mile.app/dev-mile/templates/template_OutletDetail.xlsx
                    fileFailedImported: >-
                      https://staticdev.mile.app/dev-mile/failed/failed_outlets_import_65f8a4c2d9e3b1234567890a.xlsx
                    errorMessage: null
                    processedAt: '2024-03-18 10:32:15'
                    processingDuration: 90
                    totalChunks: 3
                    processedChunks: 3
                    createdBy: john.doe@mile.app
                    updatedBy: system
                    createdTime: '2024-03-18 10:30:45'
                    updatedTime: '2024-03-18 10:32:15'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  message:
                    type: string
                  failedCode:
                    type: string
              examples:
                response:
                  value:
                    status: false
                    message: Unauthorized
                    failedCode: auth-001
        '404':
          description: Import monitoring record not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  message:
                    type: string
                  failedCode:
                    type: string
              examples:
                response:
                  value:
                    status: false
                    message: Import monitoring record not found
                    failedCode: import-004
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  message:
                    type: string
                  failedCode:
                    type: string
              examples:
                response:
                  value:
                    status: false
                    message: Internal server error
                    failedCode: import-045
      deprecated: false
      security:
        - bearerAuth: []
      x-code-samples:
        - lang: cURL
          source: >-
            curl -X GET
            "https://apiweb.mile.app/api/v3/import-monitoring/65f8a4c2d9e3b1234567890a"
            \
              -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
components:
  schemas:
    ImportMonitoringObject:
      title: ImportMonitoringObject
      type: object
      description: >-
        Complete import monitoring record with all fields from the
        ImportMonitoring model
      properties:
        _id:
          type: string
          description: >-
            Unique identifier for the import monitoring record generated by
            system.

            **Example:** `65f8a4c2d9e3b1234567890a`
        organizationId:
          type: string
          description: |-
            Organization ID that owns this import.
            **Example:** `63c61d865347e356d05e3052`
        inputType:
          type: string
          description: The input type of the component (e.g., string, number, date, etc.)
        hubId:
          type: string
          description: |-
            Hub ID associated with this import (if applicable).
            **Example:** `63c63ab1b6972d3150348172`
        filename:
          type: string
          description: |-
            Original filename of the uploaded file.
            **Example:** `outlets_import.xlsx`
        totalRows:
          type: integer
          description: |-
            Total number of rows in the imported file (excluding header).
            **Example:** `150`
        totalValid:
          type: integer
          description: |-
            Total number of valid rows successfully imported.
            **Example:** `145`
        totalInvalid:
          type: integer
          description: |-
            Total number of invalid rows that failed validation or import.
            **Example:** `5`
        status:
          type: string
          description: |-
            Current status of the import process.
            - `onprocess`: Import is currently being processed
            - `success`: All rows imported successfully
            - `partially`: Some rows succeeded, some failed
            - `failed`: Import completely failed
            **enum:** `onprocess`, `success`, `partially`, `failed`
            **Example:** `partially`
          enum:
            - onprocess
            - success
            - partially
            - failed
        fileTemplate:
          type: string
          description: >-
            URL to download the template file for this import type. Template is
            generated based on data type schema or flow configuration.

            **Example:**
            `https://staticdev.mile.app/dev-mile/templates/template_OutletDetail.xlsx`
        fileFailedImported:
          type: string
          description: >-
            URL to download file containing failed records. Only available when
            status is 'partially' or 'failed' and there are invalid rows. File
            includes error messages for each failed row.

            **Example:**
            `https://staticdev.mile.app/dev-mile/failed/failed_outlets_import_65f8a4c2d9e3b1234567890a.xlsx`
        dataTypeId:
          type: string
          description: >-
            **[Datasource Import Only]** Data type ID for datasource imports.
            This field is populated only when type='datasource'.

            Use [GET /data-types API](#tag/Data-Type/operation/getDataType) to
            get valid data type IDs.

            **Example:** `63db2fb476bc679c540369c4`
        dataTypeName:
          type: string
          description: >-
            **[Datasource Import Only]** Data type name for datasource imports.
            This field is populated only when type='datasource'.

            **Example:** `OutletDetail`
        flowId:
          type: string
          description: >-
            **[Task Import Only]** Flow ID for task imports. This field is
            populated only when type='task'. Note: Full task import
            implementation may still be in progress.

            Use [GET /flows API](#tag/Flow/operation/getflow) to get valid flow
            IDs.

            **Example:** `63d8c9b0dbd5ef20a627dd86`
        flowName:
          type: string
          description: >-
            **[Task Import Only]** Flow name for task imports. This field is
            populated only when type='task'. Note: Full task import
            implementation may still be in progress.

            **Example:** `Delivery`
        visitTypeId:
          type: string
          description: >-
            **[Visit Import Only - Future]** Visit type ID for visit imports.
            This field will be populated when type='visit'. Feature may be under
            development.

            **Example:** `64a5c8d2e9f1b2345678901c`
        visitTypeName:
          type: string
          description: >-
            **[Visit Import Only - Future]** Visit type name for visit imports.
            This field will be populated when type='visit'. Feature may be under
            development.

            **Example:** `Customer Visit`
        routeConfigId:
          type: string
          description: >-
            **[Route Import Only - Future]** Route configuration ID for route
            imports. This field will be populated when type='route'. Feature may
            be under development.

            **Example:** `65b6d9e3f0a2c3456789012d`
        routeConfigName:
          type: string
          description: >-
            **[Route Import Only - Future]** Route configuration name for route
            imports. This field will be populated when type='route'. Feature may
            be under development.

            **Example:** `Daily Route Config`
        errorMessage:
          type: string
          description: >-
            Error message if the import completely failed. Populated when
            status='failed'.

            **Example:** `File validation failed: Invalid data type ID`
        processedAt:
          type: string
          description: >-
            Timestamp when the import processing was completed. Format: Y-m-d
            H:i:s

            **Example:** `2024-03-18 10:32:15`
        processingDuration:
          type: integer
          description: >-
            Duration of import processing in seconds. Calculated as difference
            between processedAt and createdTime.

            **Example:** `90`
        totalChunks:
          type: integer
          description: >-
            Total number of chunks the file was divided into for processing.
            Large files are processed in chunks for better performance.

            **Example:** `3`
        processedChunks:
          type: integer
          description: >-
            Number of chunks that have been processed. Use this with totalChunks
            to calculate processing progress.

            **Example:** `3`
        createdBy:
          type: string
          description: |-
            Email of the user who initiated the import.
            **Example:** `john.doe@mile.app`
        updatedBy:
          type: string
          description: >-
            Email of the user/system that last updated this record. Usually
            'system' for background processing updates.

            **Example:** `system`
        createdTime:
          type: string
          description: |-
            Timestamp when the import was created. Format: Y-m-d H:i:s
            **Example:** `2024-03-18 10:30:45`
        updatedTime:
          type: string
          description: |-
            Timestamp when the record was last updated. Format: Y-m-d H:i:s
            **Example:** `2024-03-18 10:32:15`
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````