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

> Returns the data types of your organization as a page under `data_types`, newest first. Each carries `v4Only` and, on `/api/v4`, `migration` (the Preparing or unique backfill progress, `null` when none ran).

v4 differences: v3-compatible and v4-only types are both listed, and Master Data extensions are left out unless `withExtensions` is set.

**v3-compatible and v4-only types.** Every data type is one of two kinds, decided by the server: `v4Only` is returned on every read. A type is v4-only when it was created through `/api/v4`, uses a v4-only feature (the field types `title`, `boolean`, `multiOption`, `relation`, a field validation, `unique`, or `uniqueTogether`), was upgraded, or extends a Master Data entity (`extends`). A v4-only type is not shown to the mobile app.

Requires permission `view/dataType`.



## OpenAPI

````yaml /openapi/public/openapi-data.json get /data-types
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-types:
    get:
      tags:
        - Data Type
      summary: Read data types
      description: >-
        Returns the data types of your organization as a page under
        `data_types`, newest first. Each carries `v4Only` and, on `/api/v4`,
        `migration` (the Preparing or unique backfill progress, `null` when none
        ran).


        v4 differences: v3-compatible and v4-only types are both listed, and
        Master Data extensions are left out unless `withExtensions` is set.


        **v3-compatible and v4-only types.** Every data type is one of two
        kinds, decided by the server: `v4Only` is returned on every read. A type
        is v4-only when it was created through `/api/v4`, uses a v4-only feature
        (the field types `title`, `boolean`, `multiOption`, `relation`, a field
        validation, `unique`, or `uniqueTogether`), was upgraded, or extends a
        Master Data entity (`extends`). A v4-only type is not shown to the
        mobile app.


        Requires permission `view/dataType`.
      operationId: getDataType
      parameters:
        - name: page
          in: query
          required: false
          description: |-
            Page number.
            **Default:** `1`
          schema:
            type: integer
        - name: limit
          in: query
          required: false
          description: |-
            Data types per page. `-1` or any value above `2000` returns 2000.
            **Default:** `20`
          schema:
            type: integer
        - name: name
          in: query
          required: false
          description: |-
            Only the data type with exactly this name.
            **Example:** `Outlet`
          schema:
            type: string
        - name: provider
          in: query
          required: false
          description: >-
            Comma-separated providers: `internal`, `external-api`. Without it,
            only `internal` types are returned.

            **Example:** `internal,external-api`
          schema:
            type: string
        - name: withExtensions
          in: query
          required: false
          description: >-
            When `true`, also returns the Master Data extension types (`extends`
            set).
          schema:
            type: boolean
        - name: fields
          in: query
          required: false
          description: >-
            Comma-separated list of data type fields to return. `v4Only` is
            always returned.

            **Example:** `_id,name`
          schema:
            type: string
        - 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: updatedTime
          in: query
          required: false
          description: |-
            Only types updated after this time, `YYYY-MM-DDTHH:mm:ss`.
            **Example:** `2026-11-01T00:00:00`
          schema:
            type: string
        - name: timeBy
          in: query
          required: false
          description: >-
            Date field to filter on, used 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
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  status: true
                  message: Success
                  data_types:
                    current_page: 1
                    data:
                      - _id: 6abcadb6a138a6318d023ec5
                        name: Outlet
                        organizationId: 65c1f4eeca7c4816d94587b2
                        provider: internal
                        providerConfig: null
                        limitUser: false
                        commonData: false
                        v4Only: true
                        fields:
                          - id: dataId
                            title: Outlet Code
                            type: string
                            required: true
                            unique: true
                            show: true
                          - id: outletName
                            title: Outlet Name
                            type: string
                            required: true
                            show: true
                          - id: channel
                            title: Channel
                            type: string
                            required: false
                            show: true
                            optionData:
                              - value: retail
                                label: Retail
                              - value: horeca
                                label: HoReCa
                          - id: region
                            title: Region
                            type: string
                            required: false
                            show: true
                            relation:
                              kind: belongsTo
                              targetKind: dataType
                              target: 6abcadb6a138a6318d023ec9
                              displayField: regionName
                        uniqueTogether: []
                        migration: null
                        createdBy: admin@example.com
                        createdTime: '2026-10-01T03:00:00.000000Z'
                        updatedTime: '2026-10-01T03:00:00.000000Z'
                    per_page: 20
                    total: 1
                    last_page: 1
                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.