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

# Read an object's analytics dashboard: panels, field roles, the strip's collapsed flag, the named view's own dashboard (if any), and the fields panels may bucket on (synthetic $createdAt / $location last)

> Read an object's analytics dashboard: panels, field roles, the strip's collapsed flag, the named view's own dashboard (if any), and the fields panels may bucket on (synthetic $createdAt / $location last).



## OpenAPI

````yaml /api-reference/openapi.json get /crm/objects/{objectName}/analytics
openapi: 3.1.0
info:
  title: Dench API
  version: 1.0.0
  description: >-
    Versioned Dench workspace API. The operation registry is shared with the
    Dench CLI parity layer, so every CLI command maps to an endpoint here.
servers:
  - url: https://www.dench.com/api/v1
security: []
tags:
  - name: agent-config
    description: Agent Config operations.
  - name: approvals
    description: Approvals operations.
  - name: apps
    description: Apps operations.
  - name: auth
    description: Auth operations.
  - name: billing
    description: Billing operations.
  - name: browser
    description: Browser operations.
  - name: campaigns
    description: Campaigns operations.
  - name: chat
    description: Chat operations.
  - name: crm
    description: Crm operations.
  - name: email
    description: Email operations.
  - name: files
    description: Files operations.
  - name: gateway
    description: Gateway operations.
  - name: lists
    description: Lists operations.
  - name: local
    description: Local operations.
  - name: meetings
    description: Meetings operations.
  - name: members
    description: Members operations.
  - name: memory
    description: Memory operations.
  - name: meta
    description: Meta operations.
  - name: notifications
    description: Notifications operations.
  - name: routines
    description: Routines operations.
  - name: workspace
    description: Workspace operations.
paths:
  /crm/objects/{objectName}/analytics:
    get:
      tags:
        - crm
      summary: >-
        Read an object's analytics dashboard: panels, field roles, the strip's
        collapsed flag, the named view's own dashboard (if any), and the fields
        panels may bucket on (synthetic $createdAt / $location last)
      description: >-
        Read an object's analytics dashboard: panels, field roles, the strip's
        collapsed flag, the named view's own dashboard (if any), and the fields
        panels may bucket on (synthetic $createdAt / $location last).
      operationId: crm_analytics_get
      parameters:
        - name: objectName
          in: path
          required: true
          schema:
            type: string
        - name: viewName
          in: query
          required: false
          schema:
            description: >-
              Also return this saved view's own dashboard (viewAnalytics) when
              it has one.
            type: string
          description: >-
            Also return this saved view's own dashboard (viewAnalytics) when it
            has one.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  objectName:
                    type: string
                  analytics:
                    anyOf:
                      - type: object
                        properties:
                          panels:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: >-
                                    Stable id (template panels use
                                    `tpl:<template>:<slug>`).
                                title:
                                  type: string
                                type:
                                  type: string
                                  enum:
                                    - stat
                                    - bar
                                    - line
                                    - area
                                    - donut
                                    - funnel
                                    - leaderboard
                                    - forecast
                                    - map
                                metric:
                                  type: string
                                  enum:
                                    - count
                                    - sum
                                    - avg
                                    - min
                                    - max
                                metricField:
                                  description: >-
                                    Numeric field for sum/avg/min/max. Ignored
                                    for count.
                                  type: string
                                groupBy:
                                  description: >-
                                    Bucketing field
                                    (enum/user/relation/boolean/text, or
                                    $location). On a time-series panel it splits
                                    the series into one line per value.
                                  type: string
                                dateField:
                                  description: >-
                                    Date field for line/area/forecast bucketing
                                    (or $createdAt).
                                  type: string
                                dateBucket:
                                  type: string
                                  enum:
                                    - day
                                    - week
                                    - month
                                    - quarter
                                filters:
                                  description: >-
                                    Panel-scoped FilterGroup, same shape as
                                    saved-view filters.
                                  type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties: {}
                                size:
                                  description: Deprecated; ignored for layout. Use `span`.
                                  type: string
                                  enum:
                                    - sm
                                    - md
                                    - lg
                                span:
                                  description: >-
                                    Card width on the 6-track dashboard grid: 2
                                    = a third, 3 = half, 4 = two thirds, 6 =
                                    full row. Defaults: funnel 4; map and
                                    leaderboard 2; bar/donut grouped by a user
                                    field 2, by anything else 4; trends 3.
                                  anyOf:
                                    - type: number
                                      const: 2
                                    - type: number
                                      const: 3
                                    - type: number
                                      const: 4
                                    - type: number
                                      const: 6
                                hidden:
                                  description: >-
                                    Hide from the strip above the table; still
                                    shown in the full analytics view.
                                  type: boolean
                                sortOrder:
                                  type: number
                                derived:
                                  description: >-
                                    Role-driven derived metric; when set the
                                    panel computes from fieldRoles instead of
                                    metric/groupBy.
                                  type: string
                                  enum:
                                    - conversion_rate
                                    - win_rate
                                    - won_amount
                                    - lost_amount
                                    - open_pipeline
                                    - pipeline_forecast
                                    - mrr
                                    - arr
                              required:
                                - id
                                - title
                                - type
                                - metric
                                - sortOrder
                              additionalProperties: false
                              description: One analytics panel definition.
                          removedPanelIds:
                            description: >-
                              Template panel ids the user deleted; never
                              resurrected.
                            type: array
                            items:
                              type: string
                          fieldRoles:
                            type: object
                            properties:
                              amount:
                                description: >-
                                  Numeric field holding the deal value
                                  ("Amount") — the "Value field" in the setup
                                  sheet.
                                type: string
                              stage:
                                description: >-
                                  Enum field driving the pipeline ("Stage" /
                                  "Status") — the "Progress field".
                                type: string
                              wonValues:
                                description: >-
                                  `stage` options that count as won (closed,
                                  successful).
                                type: array
                                items:
                                  type: string
                              lostValues:
                                description: >-
                                  `stage` options that count as lost (closed,
                                  gone).
                                type: array
                                items:
                                  type: string
                              convertedValues:
                                description: >-
                                  `stage` options that count as converted (a
                                  lead reached "Qualified").
                                type: array
                                items:
                                  type: string
                              closeDate:
                                description: >-
                                  Date field for time bucketing, forecasts and
                                  the period pill (falls back to $createdAt).
                                type: string
                              owner:
                                description: >-
                                  User field naming who owns each record
                                  ("Owner"). Rankings on it default to a narrow
                                  card and draw member faces.
                                type: string
                              location:
                                description: >-
                                  Place-name field maps plot. May be a relation
                                  path like "Account.HQ Location" (one hop
                                  through a relation).
                                type: string
                              recurrence:
                                description: >-
                                  How a won amount recurs: annual treats Amount
                                  as ARR, monthly as MRR, one_time disables
                                  MRR/ARR panels.
                                type: string
                                enum:
                                  - monthly
                                  - annual
                                  - one_time
                              stageProbabilities:
                                description: >-
                                  Chance of closing per OPEN stage, 0..1, for
                                  the weighted forecast. Unlisted stages are
                                  spaced evenly; won = 1, lost = 0.
                                type: object
                                propertyNames:
                                  type: string
                                additionalProperties:
                                  type: number
                            additionalProperties: false
                            description: >-
                              The object's analytics setup, shared by every
                              chart and every view: the semantic field roles
                              derived metrics (win rate, won $, open pipeline,
                              forecast, MRR/ARR), maps and card defaults read.
                          stripCollapsed:
                            type: boolean
                        required:
                          - panels
                        additionalProperties: false
                      - type: 'null'
                  viewAnalytics:
                    anyOf:
                      - type: object
                        properties:
                          panels:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: >-
                                    Stable id (template panels use
                                    `tpl:<template>:<slug>`).
                                title:
                                  type: string
                                type:
                                  type: string
                                  enum:
                                    - stat
                                    - bar
                                    - line
                                    - area
                                    - donut
                                    - funnel
                                    - leaderboard
                                    - forecast
                                    - map
                                metric:
                                  type: string
                                  enum:
                                    - count
                                    - sum
                                    - avg
                                    - min
                                    - max
                                metricField:
                                  description: >-
                                    Numeric field for sum/avg/min/max. Ignored
                                    for count.
                                  type: string
                                groupBy:
                                  description: >-
                                    Bucketing field
                                    (enum/user/relation/boolean/text, or
                                    $location). On a time-series panel it splits
                                    the series into one line per value.
                                  type: string
                                dateField:
                                  description: >-
                                    Date field for line/area/forecast bucketing
                                    (or $createdAt).
                                  type: string
                                dateBucket:
                                  type: string
                                  enum:
                                    - day
                                    - week
                                    - month
                                    - quarter
                                filters:
                                  description: >-
                                    Panel-scoped FilterGroup, same shape as
                                    saved-view filters.
                                  type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties: {}
                                size:
                                  description: Deprecated; ignored for layout. Use `span`.
                                  type: string
                                  enum:
                                    - sm
                                    - md
                                    - lg
                                span:
                                  description: >-
                                    Card width on the 6-track dashboard grid: 2
                                    = a third, 3 = half, 4 = two thirds, 6 =
                                    full row. Defaults: funnel 4; map and
                                    leaderboard 2; bar/donut grouped by a user
                                    field 2, by anything else 4; trends 3.
                                  anyOf:
                                    - type: number
                                      const: 2
                                    - type: number
                                      const: 3
                                    - type: number
                                      const: 4
                                    - type: number
                                      const: 6
                                hidden:
                                  description: >-
                                    Hide from the strip above the table; still
                                    shown in the full analytics view.
                                  type: boolean
                                sortOrder:
                                  type: number
                                derived:
                                  description: >-
                                    Role-driven derived metric; when set the
                                    panel computes from fieldRoles instead of
                                    metric/groupBy.
                                  type: string
                                  enum:
                                    - conversion_rate
                                    - win_rate
                                    - won_amount
                                    - lost_amount
                                    - open_pipeline
                                    - pipeline_forecast
                                    - mrr
                                    - arr
                              required:
                                - id
                                - title
                                - type
                                - metric
                                - sortOrder
                              additionalProperties: false
                              description: One analytics panel definition.
                          removedPanelIds:
                            description: >-
                              Template panel ids the user deleted; never
                              resurrected.
                            type: array
                            items:
                              type: string
                        required:
                          - panels
                        additionalProperties: false
                      - type: 'null'
                    description: The named view's own dashboard, or null when it inherits.
                  viewExists:
                    type: boolean
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        type:
                          type: string
                        enumValues:
                          anyOf:
                            - type: array
                              items:
                                type: string
                            - type: 'null'
                        enumColors:
                          anyOf:
                            - type: array
                              items:
                                type: string
                            - type: 'null'
                      required:
                        - name
                        - type
                        - enumValues
                        - enumColors
                      additionalProperties: false
                required:
                  - objectName
                  - analytics
                  - viewAnalytics
                  - viewExists
                  - fields
                additionalProperties: false
              example:
                objectName: lead
                analytics:
                  panels:
                    - id: tpl:sales:total-leads
                      title: Total leads
                      type: stat
                      metric: count
                      sortOrder: 0
                    - id: tpl:sales:leads-by-source
                      title: Leads by source
                      type: donut
                      metric: count
                      groupBy: Source
                      sortOrder: 1
                  fieldRoles:
                    stage: Status
                    convertedValues:
                      - Qualified
                  stripCollapsed: false
                viewAnalytics: null
                viewExists: false
                fields:
                  - name: Status
                    type: enum
                    enumValues:
                      - New
                      - Qualified
                    enumColors: null
                  - name: $createdAt
                    type: date
                    enumValues: null
                    enumColors: null
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - DenchApiKey: []
        - AgentSession: []
components:
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Operation or resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
            details: {}
  securitySchemes:
    DenchApiKey:
      type: http
      scheme: bearer
      bearerFormat: DENCH_API_KEY
      description: >-
        Workspace-scoped Dench API key from workspace settings. This is the same
        key used by DENCH_API_KEY in sandboxes.
    AgentSession:
      type: http
      scheme: bearer
      bearerFormat: dch_agent_*
      description: >-
        Agent session token created by `dench signin`. Gateway-backed routes
        exchange this token for the workspace gateway key.

````