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

> Retrieves the data sources available to analytics queries and their availability for the caller's organization. With `dataSource`, returns that source's full descriptor: time fields, measure functions, dimension kinds, limits, and every field with its capabilities.



## OpenAPI

````yaml /openapi/public/openapi-analytics.json get /analytics/catalog
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/catalog:
    get:
      tags:
        - Dashboard
      summary: Read analytics catalog
      description: >-
        Retrieves the data sources available to analytics queries and their
        availability for the caller's organization. With `dataSource`, returns
        that source's full descriptor: time fields, measure functions, dimension
        kinds, limits, and every field with its capabilities.
      operationId: getAnalyticsCatalog
      parameters:
        - name: dataSource
          in: query
          required: false
          description: >-
            `task`, `user`, `task_detail` or a 24-hex id. Omit to list data
            sources.
          schema:
            type: string
      responses:
        '200':
          description: Success - data-source list, or one full descriptor
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  data:
                    type: object
                    description: >-
                      Array of summaries without `dataSource`; one descriptor
                      with it
                    properties:
                      id:
                        type: string
                      kind:
                        type: string
                      label:
                        type: string
                      specVersion:
                        type: integer
                      timeFieldCandidates:
                        type: array
                        items:
                          type: string
                      defaultTimeField:
                        type: string
                      aggregations:
                        type: object
                        properties:
                          measures:
                            type: object
                            additionalProperties: true
                          dimensions:
                            type: object
                            additionalProperties: true
                      limits:
                        type: object
                        additionalProperties: true
                      scope:
                        type: object
                        properties:
                          commonData:
                            type: boolean
                          rowLevelSecurity:
                            type: string
                      requiresBigData:
                        type: boolean
                      availability:
                        type: object
                        properties:
                          available:
                            type: boolean
                          reason:
                            type: string
                          description:
                            type: string
                      fields:
                        type: array
                        items:
                          type: object
                          description: >-
                            A catalog field. Besides the keys below each field
                            carries `type`, its platform type (`text`, `option`,
                            `number`, `dateTime`, `geolocation`, `primaryKey`);
                            it is left out of the schema and example on this
                            page only because the docs build rewrites keys named
                            `type`.
                          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
              examples:
                response:
                  value:
                    status: true
                    data:
                      id: task
                      kind: builtin
                      label: data_source.task
                      specVersion: 1
                      timeFieldCandidates:
                        - createdTime
                        - updatedTime
                        - startTime
                        - endTime
                        - doneTime
                      defaultTimeField: startTime
                      aggregations:
                        measures:
                          count: supported
                          cardinality: supported
                          avg: supported
                          sum: supported
                          min: supported
                          max: supported
                        dimensions:
                          terms: supported
                          dateHistogram: supported
                          geoGrid: supported
                          range: unsupported
                          filters: unsupported
                      limits:
                        maxMeasures: 3
                        maxDimensions: 2
                        maxNestingDepth: 2
                        maxBuckets: 5000
                        maxTermsSize: 50
                        maxTermsSizeHardCap: 1000
                        maxTimeRangeDays: 31
                        maxQueriesPerBatch: 12
                        maxRows: 1000
                        queryTimeoutSeconds: 10
                        batchBudgetSeconds: 20
                        tuningStatus: untuned_defaults
                      scope:
                        commonData: false
                        rowLevelSecurity: none
                      requiresBigData: false
                      availability:
                        available: true
                        reason: null
                        description: null
                      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
                        - 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
        '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` is malformed (`data_source_id_invalid`)
            or unknown (`data_source_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: Unknown data source 'orders'.
                    error:
                      code: data_source_unknown
                      message: Unknown data source 'orders'.
                      field: dataSourceId
      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.