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

# Import tasks from file

> Creates tasks from a spreadsheet in the background. The first sheet is read; its first row is the header and the columns match the fields of the task type. The response returns the import record with `status: onprocess`; follow it with `GET /tasks/import-monitoring`.
Send `multipart/form-data`: `file` (csv, xls or xlsx, at most 20 MB), `flow` (task type name; `Handover` is not allowed) and `hubId`. An unknown task type or hub returns 400.
Any signed-in user can call this.



## OpenAPI

````yaml /openapi/public/openapi-importexport.json post /tasks/import
openapi: 3.0.0
info:
  title: API - ImportExport
  version: 3.0.0
  description: 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 the app. 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:
  /tasks/import:
    post:
      tags:
        - Data Import
      summary: Import tasks from file
      description: >-
        Creates tasks from a spreadsheet in the background. The first sheet is
        read; its first row is the header and the columns match the fields of
        the task type. The response returns the import record with `status:
        onprocess`; follow it with `GET /tasks/import-monitoring`.

        Send `multipart/form-data`: `file` (csv, xls or xlsx, at most 20 MB),
        `flow` (task type name; `Handover` is not allowed) and `hubId`. An
        unknown task type or hub returns 400.

        Any signed-in user can call this.
      operationId: importTasksFromFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  description: 'Spreadsheet: csv, xls or xlsx, at most 20 MB.'
                  type: string
                  format: binary
                flow:
                  description: |-
                    Task type name.
                    **Example:** `Delivery`
                  type: string
                hubId:
                  description: |-
                    Hub to create the tasks in.
                    **Example:** `64d9932e2beb9037735ff022`
                  type: string
              required:
                - file
                - flow
                - hubId
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  status: true
                  message: File uploaded, processing in background
                  data:
                    _id: 670f9a1b2c3d4e5f6a7b8c9d
                    organizationId: 64d99303be0ad015c461c932
                    flowName: Delivery
                    hubId: 64d9932e2beb9037735ff022
                    filename: tasks-16-oct.xlsx
                    totalRows: 120
                    totalValid: 0
                    totalInvalid: 0
                    status: onprocess
                    fileFailedImported: null
                    createdTime: '2026-10-16T03:00:00.000000Z'
                    updatedTime: '2026-10-16T03:00:00.000000Z'
                additionalProperties: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Shows if the request was successful.
                  message:
                    type: string
                    description: A short message explaining what went wrong.
                example:
                  status: false
                  message: Bad request - invalid parameters provided.
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````

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