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

# Create or update one panel (upsert by id). With viewName the write lands on that saved view's own dashboard, forking a copy if it was still inheriting the object's

> Create or update one panel (upsert by id). With viewName the write lands on that saved view's own dashboard, forking a copy if it was still inheriting the object's.



## OpenAPI

````yaml /api-reference/openapi.json put /crm/objects/{objectName}/analytics/panels/{panelId}
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/panels/{panelId}:
    put:
      tags:
        - crm
      summary: >-
        Create or update one panel (upsert by id). With viewName the write lands
        on that saved view's own dashboard, forking a copy if it was still
        inheriting the object's
      description: >-
        Create or update one panel (upsert by id). With viewName the write lands
        on that saved view's own dashboard, forking a copy if it was still
        inheriting the object's.
      operationId: crm_analytics_save
      parameters:
        - name: objectName
          in: path
          required: true
          schema:
            type: string
        - name: panelId
          in: path
          required: true
          schema:
            type: string
            description: Panel id (path); becomes panel.id.
          description: Panel id (path); becomes panel.id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                panel:
                  type: object
                  properties:
                    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
                    id:
                      type: string
                  required:
                    - title
                    - type
                    - metric
                    - sortOrder
                  additionalProperties: false
                  description: The panel definition to upsert.
                viewName:
                  description: >-
                    Write the saved view's own dashboard (forks a copy if it was
                    inheriting).
                  type: string
              required:
                - panel
            example:
              panel:
                title: Open pipeline
                type: stat
                metric: sum
                derived: open_pipeline
                sortOrder: 10
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  panelId:
                    type: string
                required:
                  - ok
                  - panelId
                additionalProperties: false
              example:
                ok: true
                panelId: adhoc:open-pipeline
        '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.

````