> ## 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.

# Bulk create data source



## OpenAPI

````yaml /openapi/public/openapi-data.json post /data/bulk
openapi: 3.0.0
info:
  title: MileApp API - Data
  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 Source
    description: >-
      The Data source could help you simplify the process of filling in task
      information based on existing data at MileApp. This data could consist of
      information such as name, number, date, coordinate, and multiple options.
      The Data typically represents entities such as customers, products,
      employees, suppliers, or any other critical data elements that are used
      across the application.


      **To see the details of data source object, please follow [this
      link](#tag/data_source_model)**
  - name: Data Type
    description: >-
      The Data type is the structure of data fields that is customizable to suit
      your business needs. Data type attributes consist of IDs, name, field
      details, type, and primary key. This data type structure will be used at
      Data Source and Flow.


      **To see the details of data type object, please follow [this
      link](#tag/data_type_model)**
paths:
  /data/bulk:
    post:
      tags:
        - Data Source
      summary: Bulk create data source
      operationId: PostDataBulk
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postDataBulkRequest'
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                title: NetworkCreateBulkResponse
                properties:
                  success:
                    description: Total success created data source.
                    type: integer
                  failed:
                    description: Total failed created data source.
                    type: integer
                  data:
                    description: Detail of created data source.
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: boolean
                          description: Status of response.
                        _id:
                          description: Data source ID
                          type: string
                        message:
                          description: Message of create data source
                          type: string
                example:
                  success: 2
                  failed: 0
                  data:
                    - status: true
                      message: Success.
                      _id: 646db91d0d73b6392543fb82
                    - status: true
                      message: Success.
                      _id: 646db91d0d73b6392543fb83
        '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.
        '500':
          description: Server error
          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: Internal server error, please contact support@mile.app.
      deprecated: false
      security:
        - bearerAuth: []
components:
  schemas:
    postDataBulkRequest:
      title: postDataBulkRequest
      example:
        data:
          - dataId: Outlet
            dataTypeId: 63db2fb476bc679c540369c4
            hubId: 63c63ab1b6972d3150348172
            field1: Jack Ward
            field2: Gambir Jakarta
            field3: '-6.230815251,106.75684387'
          - dataId: Cafe
            dataTypeId: 63db2fb476bc679c540369c4
            hubId: 63c63ab1b6972d3150348172
            field1: Jack Ward
            field2: Menteng Jakarta
            field3: '-6.1951689,106.8278573'
      type: object
      properties:
        data:
          type: array
          description: The maximum data for creating multiple data source is 2000 data.
          items:
            type: object
            properties:
              dataId:
                type: string
                description: |-
                  The identifier of fields from data type.
                  **Example**: `Outlet`
              dataTypeId:
                type: string
                description: >-
                  The identifier of data type. Use [GET /data-types
                  API](#tag/Data-Type/operation/getDataType) to get the list of
                  Data Type IDs.

                  **Example**: `63db2fb476bc679c540369c4`
              hubId:
                type: string
                description: >-
                  Fundamental entity within an organization, serving as the
                  central point for managing various operational components. Use
                  **GET /hubs** endpoint to get the list of Hub IDs.
                  **Example:** `634e98498ce07d29474a7e29`
              field1:
                type: string
                description: >-
                  This field's type & value is according to dataType. Use [GET
                  /data-types API](#tag/Data-Type/operation/getDataType) to get
                  fields of dataType.

                  **Example:** `Jack Ward`
              field2:
                type: string
                description: >-
                  This field's type & value is according to dataType. Use [GET
                  /data-types API](#tag/Data-Type/operation/getDataType) to get
                  fields of dataType.

                  **Example:** `Gambir Jakarta`
              field3:
                type: string
                description: >-
                  This field's type & value is according to dataType. Use [GET
                  /data-types API](#tag/Data-Type/operation/getDataType) to get
                  fields of dataType.

                  **Example:** `-6.230815251,106.75684387`
            required:
              - dataId
              - hubId
              - dataTypeId
      required:
        - data
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````