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

# Update data source by hubId, dataTypeName, dataId



## OpenAPI

````yaml /openapi/public/openapi-data.json put /data/hub/{hub_id}/type/{dataTypeName}/{dataId}
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/hub/{hub_id}/type/{dataTypeName}/{dataId}:
    put:
      tags:
        - Data Source
      summary: Update data source by hubId, dataTypeName, dataId
      operationId: putDataByDataId
      parameters:
        - $ref: '#/components/parameters/hubIdInPath'
        - name: dataTypeName
          in: path
          required: true
          description: >-
            Name of data type.

            Use [GET /data-types API](#tag/Data-Type/operation/getDataType) to
            get the list of dataType Name.

            **Example:** `Pegawai`
          schema:
            type: string
        - name: dataId
          in: path
          required: true
          description: >-
            Primary key data of the data type.

            Use [GET /data API](#tag/Data-Source/operation/getData) to get the
            list primary key data of dataType.

            **Example:** `anas`
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataRequestUpdateByDataId'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                title: NetworkPutDataIDResponse
                properties:
                  status:
                    type: boolean
                    description: Status of response.
                  message:
                    description: Message of API response.
                    type: string
                  data:
                    description: Detail of object data source.
                    type: object
                    additionalProperties: true
                example:
                  status: true
                  message: Success
                  data:
                    _id: 6433acd3fc7786708b7567ad
                    dataTypeId: 642d165e6a88ff136c692853
                    hubId: 63daffabc5a95d7d475eb7a6
                    address: Jakarta
                    golongan: A
                    dataId: anas
                    createdBy: husni+1@paket.id
                    organizationId: 63daff70a483b40ae5586e02
                    updatedTime: '2023-04-10 06:24:21'
                    createdTime: '2023-04-10 06:24:21'
                    data_type:
                      _id: 642d165e6a88ff136c692853
                      name: Pagawai
        '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.
        '404':
          description: Data not found
          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: Data not found
        '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:
  parameters:
    hubIdInPath:
      name: hubId
      in: path
      required: true
      schema:
        type: string
      description: >-
        Fundamental entity within an organization, serving as the central point
        for managing various operational components. Use Use [**GET
        /hubs**](#tag/Hub/operation/getHubs) endpoint to get the list of Hub
        IDs.

        **Example:** `634e98498ce07d29474a7e29`
  schemas:
    DataRequestUpdateByDataId:
      title: DataRequestUpdateByDataId
      example:
        dataId: anas
        dataTypeId: 642d165e6a88ff136c692853
        hubId: 63daffabc5a95d7d475eb7a6
        address: jakarta
        golongan: A
      type: object
      properties:
        dataId:
          type: string
          description: |-
            The identifier of fields from data type.
            **Example**: `anas`
        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**: `642d165e6a88ff136c692853`
        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`
        address:
          type: string
          description: >-
            The dynamic field, address. Use [GET /data-types
            API](#tag/Data-Type/operation/getDataType) to get detail fields of
            data source. 

            **Example**: `jakarta`
        golongan:
          type: string
          description: >-
            The dynamic field, golongan. Use [GET /data-types
            API](#tag/Data-Type/operation/getDataType) to get detail fields of
            data source.

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

````