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

# Read analytics field metadata

> Retrieves the catalog fields of one data source, each compared with what the search index actually stores (`storage.status`). If the index cannot be reached, the call still succeeds with `verified: false`.



## OpenAPI

````yaml /openapi/public/openapi-analytics.json get /analytics/field-metadata
openapi: 3.0.0
info:
  title: MileApp API - Analytics
  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: Dashboard
    description: >-
      Dashboard lets a user compose their own dashboard from any number of
      cards, start from a template, duplicate a dashboard, share it with roles,
      and save it back as an organization template. Each card owns its own
      widget row (a chart type plus a query spec), cloned from the widget
      catalogue (built-in widgets plus the organization's custom widgets), so
      renaming or editing a card never touches the catalogue or another
      dashboard. Dashboards are owned by their creator: roles they are shared
      with can view, duplicate and save as template, but only the owner can edit
      or delete. Every write reuses the dashboard permission family (view, add,
      edit and delete dashboard).


      The numbers behind each card come from one generic aggregation endpoint
      instead of one endpoint per chart: the client sends a batch of up to 12
      declarative query specs, the server injects the caller's organization, hub
      and soft-delete scope from the session, runs each spec read-only, and
      returns a flat columns and rows table per item. The catalog endpoints
      describe the data sources, fields and limits a client may use.
paths:
  /analytics/field-metadata:
    get:
      tags:
        - Dashboard
      summary: Read analytics field metadata
      description: >-
        Retrieves the catalog fields of one data source, each compared with what
        the search index actually stores (`storage.status`). If the index cannot
        be reached, the call still succeeds with `verified: false`.
      operationId: getAnalyticsFieldMetadata
      parameters:
        - name: dataSource
          in: query
          required: true
          description: '`task` or `user` (or a 24-hex id)'
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      dataSource:
                        type: string
                      indices:
                        type: array
                        items:
                          type: string
                      verified:
                        type: boolean
                        description: '`false` when `_field_caps` could not be read'
                      fields:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              description: Logical field name used in specs
                            label:
                              type: string
                              description: i18n key
                            optionData:
                              type: array
                              items:
                                type: string
                            isArray:
                              type: boolean
                            unit:
                              type: string
                            capability:
                              type: object
                              properties:
                                filterable:
                                  type: boolean
                                groupable:
                                  type: boolean
                                metricable:
                                  type: boolean
                                distinctCountable:
                                  type: boolean
                                timeFieldEligible:
                                  type: boolean
                                sortable:
                                  type: boolean
                            valuePicker:
                              type: string
                            valuePickerField:
                              type: string
                            cardinality:
                              type: string
                            fanOut:
                              type: boolean
                            availability:
                              type: object
                              properties:
                                available:
                                  type: boolean
                                blockedReason:
                                  type: string
                            quality:
                              type: object
                              properties:
                                level:
                                  type: string
                                note:
                                  type: string
                                fillRate:
                                  type: number
                                zeroRate:
                                  type: number
                                measuredAt:
                                  type: string
                                sampleSize:
                                  type: integer
                            storage:
                              type: object
                              properties:
                                esType:
                                  type: string
                                  description: Type the catalog expects
                                storedAs:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    Types Elasticsearch reports; `null` when
                                    absent
                                status:
                                  type: string
                                  enum:
                                    - confirmed
                                    - not_in_index
                                    - type_mismatch
                                    - type_conflict
                                    - unverified
              examples:
                response:
                  value:
                    status: true
                    data:
                      dataSource: task
                      indices:
                        - simpletask.2026
                      verified: true
                      fields:
                        - name: status
                          label: field.task.status
                          optionData:
                            - UNASSIGNED
                            - ONGOING
                            - DONE
                          isArray: false
                          unit: null
                          capability:
                            filterable: true
                            groupable: true
                            metricable: false
                            distinctCountable: true
                            timeFieldEligible: false
                            sortable: true
                          valuePicker: list
                          valuePickerField: null
                          cardinality: low
                          fanOut: false
                          availability:
                            available: true
                            blockedReason: null
                          quality:
                            level: ok
                            fillRate: null
                            zeroRate: null
                            measuredAt: null
                            sampleSize: null
                            note: null
                          storage:
                            esType: keyword
                            storedAs:
                              - keyword
                            status: confirmed
                        - name: travelDuration
                          label: field.task.travelDuration
                          optionData: null
                          isArray: false
                          unit: duration
                          capability:
                            filterable: true
                            groupable: false
                            metricable: true
                            distinctCountable: true
                            timeFieldEligible: false
                            sortable: true
                          valuePicker: none
                          valuePickerField: null
                          cardinality: high
                          fanOut: false
                          availability:
                            available: true
                            blockedReason: null
                          quality:
                            level: unverified
                            fillRate: null
                            zeroRate: null
                            measuredAt: null
                            sampleSize: null
                            note: field_quality.unverified
                          storage:
                            esType: float
                            storedAs:
                              - float
                            status: confirmed
        '401':
          description: >-
            Unauthorized - no valid token (`auth-034`), or an authenticated user
            with no organization
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    description: Human-readable reason
                  failedCode:
                    type: string
                    description: Structured error code, see Status Codes
              examples:
                response:
                  value:
                    status: false
                    message: Unauthenticated.
                    failedCode: auth-034
        '403':
          description: Forbidden - the caller's role lacks `view/dashboard`
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    description: Human-readable reason
                  failedCode:
                    type: string
                    description: Structured error code, see Status Codes
              examples:
                response:
                  value:
                    status: false
                    message: >-
                      Access denied. You do not have permission for view
                      dashboard. Please contact your admin to request access.
                    failedCode: sys-035
        '422':
          description: >-
            Unprocessable - `dataSource` missing (`data_source_missing`),
            malformed or unknown
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Descriptive string code, e.g. `batch_too_large`,
                          `field_unknown`, `hub_not_allowed`
                      message:
                        type: string
                      field:
                        type: string
                        description: Offending key, when known
              examples:
                response:
                  value:
                    status: false
                    message: Query parameter 'dataSource' is required.
                    error:
                      code: data_source_missing
                      message: Query parameter 'dataSource' is required.
                      field: dataSource
      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.