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

# Read data

> Returns records as a page under `data`, newest first, across every data type the caller can read unless `dataTypeId` or `dataTypeName` narrows it. Records under Limit Data by User are only those shared with the caller, unless `limitUser` is `false`. Fields hidden from the caller's role are left out.

**Search.** `q` matches the Title on a v3-compatible data type, and any value on a v4-only type (field values, relation display values, creator, dates as `YYYY-MM-DD`), case-insensitive.

v4 differences: `dataTypeName` is resolved before the hub filter, and records of v4-only data types are included.

Requires permission `view/data`.



## OpenAPI

````yaml /openapi/public/openapi-data.json get /data
openapi: 3.0.0
info:
  title: API - Data
  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 Source
    description: >-
      The Data source could help you simplify the process of filling in task
      information based on existing data in the app. 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:
    get:
      tags:
        - Data Source
      summary: Read data
      description: >-
        Returns records as a page under `data`, newest first, across every data
        type the caller can read unless `dataTypeId` or `dataTypeName` narrows
        it. Records under Limit Data by User are only those shared with the
        caller, unless `limitUser` is `false`. Fields hidden from the caller's
        role are left out.


        **Search.** `q` matches the Title on a v3-compatible data type, and any
        value on a v4-only type (field values, relation display values, creator,
        dates as `YYYY-MM-DD`), case-insensitive.


        v4 differences: `dataTypeName` is resolved before the hub filter, and
        records of v4-only data types are included.


        Requires permission `view/data`.
      operationId: getData
      parameters:
        - name: dataTypeId
          in: query
          required: false
          description: |-
            Only records of this data type.
            **Example:** `6abcadb6a138a6318d023ec5`
          schema:
            type: string
        - name: dataTypeName
          in: query
          required: false
          description: |-
            Only records of the data type with this name.
            **Example:** `Outlet`
          schema:
            type: string
        - name: hubId
          in: query
          required: false
          description: >-
            Only records of this hub, or several separated by commas. Must be a
            hub the caller belongs to. Ignored for a data type without hub
            scope.

            **Example:** `65c1f68ea735b522d370ea25`
          schema:
            type: string
        - name: dataId
          in: query
          required: false
          description: |-
            Only records with these Titles, separated by commas.
            **Example:** `OUT-0012,OUT-0013`
          schema:
            type: string
        - name: q
          in: query
          required: false
          description: |-
            Search text, see above.
            **Example:** `sumber rejeki`
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: |-
            Page number.
            **Default:** `1`
          schema:
            type: integer
        - name: limit
          in: query
          required: false
          description: |-
            Records per page. `-1` or any value above `2000` returns 2000.
            **Default:** `20`
          schema:
            type: integer
        - name: sortBy
          in: query
          required: false
          description: |-
            Field to sort by.
            **Default:** `createdTime`
          schema:
            type: string
        - name: sortOrder
          in: query
          required: false
          description: |-
            Sort direction.
            **Default:** `desc`
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: fields
          in: query
          required: false
          description: |-
            Comma-separated list of record keys to return.
            **Example:** `dataId,outletName,hubId`
          schema:
            type: string
        - name: limitUser
          in: query
          required: false
          description: >-
            Set `false` to skip the Limit Data by User filter, where the
            caller's role allows it.

            **Default:** `true`
          schema:
            type: boolean
        - name: updatedTime
          in: query
          required: false
          description: >-
            Only records updated after this time, `YYYY-MM-DD HH:mm:ss`. The
            response then adds `deletedData`, the records deleted since.

            **Example:** `2026-11-01 00:00:00`
          schema:
            type: string
        - name: timeBy
          in: query
          required: false
          description: >-
            Date field to filter on, with `timeFrom` and `timeTo` (`YYYY-MM-DD
            HH:mm:ss`).

            **Example:** `createdTime`
          schema:
            type: string
        - name: timeFrom
          in: query
          required: false
          description: Start of the `timeBy` window.
          schema:
            type: string
        - name: timeTo
          in: query
          required: false
          description: End of the `timeBy` window.
          schema:
            type: string
        - name: count
          in: query
          required: false
          description: When `true`, returns only `count`, the number of matching records.
          schema:
            type: boolean
        - name: lazyLoad
          in: query
          required: false
          description: >-
            Set `1` for cursor paging by `_id` instead of pages: pass the last
            `_id` you received as `cursor`.
          schema:
            type: integer
        - name: cursor
          in: query
          required: false
          description: With `lazyLoad=1`, the `_id` after which to continue.
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  status: true
                  message: Success
                  data:
                    current_page: 1
                    data:
                      - _id: 6aec2e6974e959b1f2094655
                        dataTypeId: 6abcadb6a138a6318d023ec5
                        hubId: 65c1f68ea735b522d370ea25
                        dataId: OUT-0012
                        outletName: Toko Sumber Rejeki
                        channel: retail
                        region: 6abcadb6a138a6318d02a001
                        limitUser:
                          - all
                        organizationId: 65c1f4eeca7c4816d94587b2
                        createdBy: admin@example.com
                        createdTime: '2026-11-05 07:21:13'
                        updatedTime: '2026-11-05 07:21:13'
                        data_type:
                          _id: 6abcadb6a138a6318d023ec5
                          name: Outlet
                    per_page: 20
                    total: 1
                    last_page: 1
                  dataVersion: '1795063011'
                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.
        '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: []
      servers:
        - url: https://apiweb.mile.app/api/v4
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.