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

# Create a dashboard

> Creates a dashboard with its widgets. Each widget is an analytics query (see POST /v1/analytics/query)
with a name unique on the dashboard, a `display` (LINE, NUMBER, RADAR, STACKED_BAR, TABLE) and a
`size` (SMALL, MEDIUM, LARGE, EXTRA_LARGE). Widgets render top to bottom in the order given.

Dashboard `filters` apply over every widget and must be conversation-level: AGENT_PROPERTY,
CALL_PROPERTY, MODALITY, DATASET or METRIC_VALUE. On a field a widget already filters, the dashboard's wins.



## OpenAPI

````yaml /api-reference/openapi.documented.json post /v1/dashboard
openapi: 3.1.0
info:
  title: Roark Analytics API
  description: >-
    The Roark Analytics API gives you access to the same API that powers the
    award winning Roark Analytics platform.
  version: 1.0.0
servers:
  - description: Production
    url: https://api.roark.ai
security:
  - Bearer: []
tags:
  - name: Agent
  - name: Agent Endpoint
  - name: Call
  - name: Chat
  - name: Metric
  - name: Metric Policy
  - name: Metric Collection Job
  - name: Customer Flow
  - name: Customer Flow Edge Case
  - name: Simulation
  - name: Simulation Persona
  - name: Simulation Environment
  - name: Simulation Scenario
  - name: Simulation Run Plan
  - name: Simulation Template
  - name: Simulation Run Plan Job
  - name: Simulation Job
  - name: HTTP Request Definition
  - name: Webhook
  - name: Issue
  - name: Autoimprove
  - name: Agent Config
  - name: Knowledge Base
  - name: Config
  - name: Organization Project
  - name: Organization Project Member
  - name: Organization Project API Key
  - name: Organization Config
  - name: CLI Auth
  - name: Me
  - name: Project
  - name: Usage
  - name: Analytics
  - name: Dashboard
  - name: Benchmark
  - name: Health
  - name: Prospect Simulation
paths:
  /v1/dashboard:
    post:
      tags:
        - Dashboard
      summary: Create a dashboard
      description: >-
        Creates a dashboard with its widgets. Each widget is an analytics query
        (see POST /v1/analytics/query)

        with a name unique on the dashboard, a `display` (LINE, NUMBER, RADAR,
        STACKED_BAR, TABLE) and a

        `size` (SMALL, MEDIUM, LARGE, EXTRA_LARGE). Widgets render top to bottom
        in the order given.


        Dashboard `filters` apply over every widget and must be
        conversation-level: AGENT_PROPERTY,

        CALL_PROPERTY, MODALITY, DATASET or METRIC_VALUE. On a field a widget
        already filters, the dashboard's wins.
      operationId: postV1Dashboard
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DashboardInput'
      responses:
        '201':
          description: The created dashboard
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Dashboard'
                required:
                  - data
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Validation error
              example:
                type: validation
                code: invalid_parameter
                message: The request was invalid
                param: email
          description: Invalid dashboard, or a widget the analytics store cannot answer
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Authentication error
              example:
                type: authentication
                code: unauthorized
                message: Authentication required
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Permission error
              example:
                type: forbidden
                code: permission_denied
                message: You do not have permission to access this resource
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Not found error
              example:
                type: not_found
                code: resource_not_found
                message: The requested resource could not be found
          description: Dashboard, widget or a referenced metric not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Conflict error
              example:
                type: conflict
                code: resource_in_use
                message: The resource is in use and cannot be deleted
          description: The dashboard is managed by config as code
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Rate limit error
              example:
                type: rate_limit
                code: too_many_requests
                message: Rate limit exceeded
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Server error
              example:
                type: internal
                code: internal_error
                message: Internal server error
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Roark from '@roarkanalytics/sdk';

            const client = new Roark({
              bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
            });

            const dashboard = await client.dashboard.create({ name: 'x' });

            console.log(dashboard.data);
        - lang: Python
          source: |-
            import os
            from roark_analytics import Roark

            client = Roark(
                bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"),  # This is the default and can be omitted
            )
            dashboard = client.dashboard.create(
                name="x",
            )
            print(dashboard.data)
components:
  schemas:
    DashboardInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        description:
          type: string
          maxLength: 2000
        timeRange:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: LAST
                value:
                  type: integer
                  minimum: 1
                  maximum: 1000
                unit:
                  type: string
                  enum:
                    - DAYS
                    - WEEKS
                    - MONTHS
              required:
                - type
                - value
                - unit
            - type: object
              properties:
                type:
                  type: string
                  const: CALENDAR_ALIGNED
                period:
                  type: string
                  enum:
                    - TODAY
                    - YESTERDAY
                    - THIS_WEEK
                    - LAST_WEEK
                    - THIS_MONTH
                    - LAST_MONTH
                    - THIS_YEAR
                    - LAST_YEAR
              required:
                - type
                - period
            - type: object
              properties:
                type:
                  type: string
                  const: FIXED
                from:
                  type: string
                  format: date-time
                to:
                  type: string
                  format: date-time
              required:
                - type
                - from
                - to
            - type: object
              properties:
                type:
                  type: string
                  const: SINCE
                from:
                  type: string
                  format: date-time
              required:
                - type
                - from
          description: >-
            The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED
            period (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH,
            LAST_MONTH, THIS_YEAR, LAST_YEAR), FIXED from/to, or SINCE a date.
            At most 731 days (two years).
        filters:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - METRIC_PROPERTY
                  - CALL_PROPERTY
                  - AGENT_PROPERTY
                  - CALL_ID
                  - MODALITY
                  - DATASET
                  - METRIC_VALUE
                description: >-
                  What the filter narrows on. GET /v1/analytics/schema lists
                  each type.
              property:
                type: string
                description: >-
                  The property to compare. Required for CALL_PROPERTY and
                  METRIC_PROPERTY; may be omitted for AGENT_PROPERTY, DATASET,
                  MODALITY and CALL_ID.
              operator:
                type: string
                enum:
                  - EQUALS
                  - NOT_EQUALS
                  - GREATER_THAN
                  - GREATER_THAN_OR_EQUAL_TO
                  - LESS_THAN
                  - LESS_THAN_OR_EQUAL_TO
                  - CONTAINS
                  - STARTS_WITH
                description: Defaults to EQUALS.
              value:
                anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                description: >-
                  The value to compare against (an agent id, "call" / "chat", a
                  property value).
            required:
              - type
              - value
          maxItems: 20
        isDefault:
          type: boolean
        widgets:
          type: array
          items:
            type: object
            properties:
              measures:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - METRIC
                        - CONVERSATION
                        - UPTIME
                      description: >-
                        METRIC (default): a metric's values. CONVERSATION:
                        conversation counts. UPTIME: health-check outcomes.
                    metric:
                      type: string
                      minLength: 1
                      description: >-
                        The metric's slug (e.g. `task_completion`) or id.
                        Required for METRIC.
                    aggregation:
                      type: string
                      enum:
                        - COUNT
                        - AVG
                        - MIN
                        - MAX
                        - SUM
                        - MEDIAN
                        - PERCENTILE
                        - PASS_RATE
                      description: >-
                        Defaults by output type: AVG for numeric metrics, COUNT
                        (split by value) for classification and text, PASS_RATE
                        for thresholds and uptime, COUNT for conversations.
                    percentile:
                      type: integer
                      minimum: 0
                      maximum: 100
                      description: Required with PERCENTILE, e.g. 95.
                    distinctBy:
                      type: string
                      enum:
                        - NONE
                        - CALL
                      description: >-
                        CALL (default for metrics) folds each conversation to
                        one value first, so a long call does not outweigh a
                        short one. NONE aggregates every value.
                    nestedAggregation:
                      type: string
                      enum:
                        - COUNT
                        - AVG
                        - MIN
                        - MAX
                        - SUM
                        - MEDIAN
                        - PERCENTILE
                        - PASS_RATE
                      description: >-
                        How each conversation is folded when distinctBy is CALL.
                        Defaults to SUM under SUM, else AVG.
                    nestedAggregationPercentile:
                      type: integer
                      minimum: 0
                      maximum: 100
                    passOperator:
                      type: string
                      enum:
                        - EQUALS
                        - NOT_EQUALS
                        - GREATER_THAN
                        - GREATER_THAN_OR_EQUAL_TO
                        - LESS_THAN
                        - LESS_THAN_OR_EQUAL_TO
                        - CONTAINS
                        - STARTS_WITH
                      description: >-
                        PASS_RATE condition operator. Omit for a threshold
                        metric: its own condition is used.
                    passValue:
                      anyOf:
                        - type: string
                        - type: number
                        - type: boolean
                      description: PASS_RATE condition value, e.g. 4 or "resolved".
                    breakdown:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - METRIC_PROPERTY
                            - CALL_PROPERTY
                            - AGENT_PROPERTY
                            - DATASET
                        property:
                          type: string
                          description: >-
                            The property to split by. Required for CALL_PROPERTY
                            and METRIC_PROPERTY.
                      required:
                        - type
                      description: >-
                        Split the measure into one series per value of this
                        dimension (the largest 50 are returned). Ignored while
                        comparisonGroups are set: each group is then one series.
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - METRIC_PROPERTY
                              - CALL_PROPERTY
                              - AGENT_PROPERTY
                              - CALL_ID
                              - MODALITY
                              - DATASET
                              - METRIC_VALUE
                            description: >-
                              What the filter narrows on. GET
                              /v1/analytics/schema lists each type.
                          property:
                            type: string
                            description: >-
                              The property to compare. Required for
                              CALL_PROPERTY and METRIC_PROPERTY; may be omitted
                              for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
                          operator:
                            type: string
                            enum:
                              - EQUALS
                              - NOT_EQUALS
                              - GREATER_THAN
                              - GREATER_THAN_OR_EQUAL_TO
                              - LESS_THAN
                              - LESS_THAN_OR_EQUAL_TO
                              - CONTAINS
                              - STARTS_WITH
                            description: Defaults to EQUALS.
                          value:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                            description: >-
                              The value to compare against (an agent id, "call"
                              / "chat", a property value).
                        required:
                          - type
                          - value
                      maxItems: 20
                      description: >-
                        Filters for this measure only, on top of the query's
                        filters.
                    isBaseline:
                      type: boolean
                      description: >-
                        Mark one measure as the baseline: every series also
                        reports its value as a percentage of it.
                    color:
                      type: string
                      enum:
                        - GREEN
                        - RED
                        - ORANGE
                        - PURPLE
                        - GREY
                        - BLUE
                        - PEACH
                        - TEAL
                        - INDIGO
                        - AMBER
                        - ROSE
                        - CYAN
                      description: Chart color on a dashboard.
                minItems: 1
                maxItems: 10
                description: 'What to aggregate: 1 to 10 measures.'
              filters:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - METRIC_PROPERTY
                        - CALL_PROPERTY
                        - AGENT_PROPERTY
                        - CALL_ID
                        - MODALITY
                        - DATASET
                        - METRIC_VALUE
                      description: >-
                        What the filter narrows on. GET /v1/analytics/schema
                        lists each type.
                    property:
                      type: string
                      description: >-
                        The property to compare. Required for CALL_PROPERTY and
                        METRIC_PROPERTY; may be omitted for AGENT_PROPERTY,
                        DATASET, MODALITY and CALL_ID.
                    operator:
                      type: string
                      enum:
                        - EQUALS
                        - NOT_EQUALS
                        - GREATER_THAN
                        - GREATER_THAN_OR_EQUAL_TO
                        - LESS_THAN
                        - LESS_THAN_OR_EQUAL_TO
                        - CONTAINS
                        - STARTS_WITH
                      description: Defaults to EQUALS.
                    value:
                      anyOf:
                        - type: string
                        - type: number
                        - type: boolean
                      description: >-
                        The value to compare against (an agent id, "call" /
                        "chat", a property value).
                  required:
                    - type
                    - value
                maxItems: 20
                description: >-
                  Applied to every measure, on top of each measure's own
                  filters.
              interval:
                type: string
                enum:
                  - HOUR
                  - DAY
                  - WEEK
                  - MONTH
                description: >-
                  Bucket size. Defaults from the window's length and steps
                  coarser when the window would exceed 500 buckets.
              comparisonMode:
                type: string
                enum:
                  - NONE
                  - PREVIOUS_PERIOD
                description: >-
                  PREVIOUS_PERIOD adds the preceding window of the same length
                  to every series.
              comparisonGroups:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                      maxLength: 100
                      description: The series label; unique within the query.
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - METRIC_PROPERTY
                              - CALL_PROPERTY
                              - AGENT_PROPERTY
                              - CALL_ID
                              - MODALITY
                              - DATASET
                              - METRIC_VALUE
                            description: >-
                              What the filter narrows on. GET
                              /v1/analytics/schema lists each type.
                          property:
                            type: string
                            description: >-
                              The property to compare. Required for
                              CALL_PROPERTY and METRIC_PROPERTY; may be omitted
                              for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
                          operator:
                            type: string
                            enum:
                              - EQUALS
                              - NOT_EQUALS
                              - GREATER_THAN
                              - GREATER_THAN_OR_EQUAL_TO
                              - LESS_THAN
                              - LESS_THAN_OR_EQUAL_TO
                              - CONTAINS
                              - STARTS_WITH
                            description: Defaults to EQUALS.
                          value:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                            description: >-
                              The value to compare against (an agent id, "call"
                              / "chat", a property value).
                        required:
                          - type
                          - value
                      minItems: 1
                      maxItems: 20
                    color:
                      type: string
                      enum:
                        - GREEN
                        - RED
                        - ORANGE
                        - PURPLE
                        - GREY
                        - BLUE
                        - PEACH
                        - TEAL
                        - INDIGO
                        - AMBER
                        - ROSE
                        - CYAN
                  required:
                    - name
                    - filters
                minItems: 2
                maxItems: 5
                description: >-
                  Run every measure once per named filter set, e.g. one group
                  per agent.
              name:
                type: string
                minLength: 1
                maxLength: 200
                description: 'Unique on the dashboard: how the widget is matched on update.'
              description:
                type: string
                maxLength: 2000
              display:
                type: string
                enum:
                  - LINE
                  - NUMBER
                  - RADAR
                  - STACKED_BAR
                  - TABLE
                description: Chart type. Defaults to LINE.
              size:
                type: string
                enum:
                  - SMALL
                  - MEDIUM
                  - LARGE
                  - EXTRA_LARGE
                description: Grid width. Defaults to MEDIUM.
            required:
              - measures
              - name
          maxItems: 50
      required:
        - name
      description: >-
        A dashboard: a name, the window and filters every widget reads, and its
        widgets top to bottom. Each widget is an analytics query (the shape POST
        /v1/analytics/query takes) plus a name, chart type and size.
      example:
        name: Support agent health
        timeRange:
          type: LAST
          value: 30
          unit: DAYS
        filters:
          - type: MODALITY
            value: call
        widgets:
          - name: Sentiment
            display: LINE
            size: LARGE
            interval: DAY
            measures:
              - metric: sentiment_score
                aggregation: AVG
          - name: Calls
            display: NUMBER
            measures:
              - type: CONVERSATION
    Dashboard:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        isDefault:
          type: boolean
        configManaged:
          type: boolean
          description: >-
            Managed by config as code (`kind: dashboard`). A managed dashboard
            is read-only here: edits return 409; change it in the config file.
        timeRange:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: LAST
                value:
                  type: integer
                  minimum: 1
                  maximum: 1000
                unit:
                  type: string
                  enum:
                    - DAYS
                    - WEEKS
                    - MONTHS
              required:
                - type
                - value
                - unit
            - type: object
              properties:
                type:
                  type: string
                  const: CALENDAR_ALIGNED
                period:
                  type: string
                  enum:
                    - TODAY
                    - YESTERDAY
                    - THIS_WEEK
                    - LAST_WEEK
                    - THIS_MONTH
                    - LAST_MONTH
                    - THIS_YEAR
                    - LAST_YEAR
              required:
                - type
                - period
            - type: object
              properties:
                type:
                  type: string
                  const: FIXED
                from:
                  type: string
                  format: date-time
                to:
                  type: string
                  format: date-time
              required:
                - type
                - from
                - to
            - type: object
              properties:
                type:
                  type: string
                  const: SINCE
                from:
                  type: string
                  format: date-time
              required:
                - type
                - from
            - type: 'null'
          description: >-
            The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED
            period (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH,
            LAST_MONTH, THIS_YEAR, LAST_YEAR), FIXED from/to, or SINCE a date.
            At most 731 days (two years).
        createdAt:
          type: string
        updatedAt:
          type: string
        filters:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - METRIC_PROPERTY
                  - CALL_PROPERTY
                  - AGENT_PROPERTY
                  - CALL_ID
                  - MODALITY
                  - DATASET
                  - METRIC_VALUE
                description: >-
                  What the filter narrows on. GET /v1/analytics/schema lists
                  each type.
              property:
                type: string
                description: >-
                  The property to compare. Required for CALL_PROPERTY and
                  METRIC_PROPERTY; may be omitted for AGENT_PROPERTY, DATASET,
                  MODALITY and CALL_ID.
              operator:
                type: string
                enum:
                  - EQUALS
                  - NOT_EQUALS
                  - GREATER_THAN
                  - GREATER_THAN_OR_EQUAL_TO
                  - LESS_THAN
                  - LESS_THAN_OR_EQUAL_TO
                  - CONTAINS
                  - STARTS_WITH
                description: Defaults to EQUALS.
              value:
                anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                description: >-
                  The value to compare against (an agent id, "call" / "chat", a
                  property value).
            required:
              - type
              - value
        widgets:
          type: array
          items:
            type: object
            properties:
              measures:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - METRIC
                        - CONVERSATION
                        - UPTIME
                      description: >-
                        METRIC (default): a metric's values. CONVERSATION:
                        conversation counts. UPTIME: health-check outcomes.
                    metric:
                      type: string
                      minLength: 1
                      description: >-
                        The metric's slug (e.g. `task_completion`) or id.
                        Required for METRIC.
                    aggregation:
                      type: string
                      enum:
                        - COUNT
                        - AVG
                        - MIN
                        - MAX
                        - SUM
                        - MEDIAN
                        - PERCENTILE
                        - PASS_RATE
                      description: >-
                        Defaults by output type: AVG for numeric metrics, COUNT
                        (split by value) for classification and text, PASS_RATE
                        for thresholds and uptime, COUNT for conversations.
                    percentile:
                      type: integer
                      minimum: 0
                      maximum: 100
                      description: Required with PERCENTILE, e.g. 95.
                    distinctBy:
                      type: string
                      enum:
                        - NONE
                        - CALL
                      description: >-
                        CALL (default for metrics) folds each conversation to
                        one value first, so a long call does not outweigh a
                        short one. NONE aggregates every value.
                    nestedAggregation:
                      type: string
                      enum:
                        - COUNT
                        - AVG
                        - MIN
                        - MAX
                        - SUM
                        - MEDIAN
                        - PERCENTILE
                        - PASS_RATE
                      description: >-
                        How each conversation is folded when distinctBy is CALL.
                        Defaults to SUM under SUM, else AVG.
                    nestedAggregationPercentile:
                      type: integer
                      minimum: 0
                      maximum: 100
                    passOperator:
                      type: string
                      enum:
                        - EQUALS
                        - NOT_EQUALS
                        - GREATER_THAN
                        - GREATER_THAN_OR_EQUAL_TO
                        - LESS_THAN
                        - LESS_THAN_OR_EQUAL_TO
                        - CONTAINS
                        - STARTS_WITH
                      description: >-
                        PASS_RATE condition operator. Omit for a threshold
                        metric: its own condition is used.
                    passValue:
                      anyOf:
                        - type: string
                        - type: number
                        - type: boolean
                      description: PASS_RATE condition value, e.g. 4 or "resolved".
                    breakdown:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - METRIC_PROPERTY
                            - CALL_PROPERTY
                            - AGENT_PROPERTY
                            - DATASET
                        property:
                          type: string
                          description: >-
                            The property to split by. Required for CALL_PROPERTY
                            and METRIC_PROPERTY.
                      required:
                        - type
                      description: >-
                        Split the measure into one series per value of this
                        dimension (the largest 50 are returned). Ignored while
                        comparisonGroups are set: each group is then one series.
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - METRIC_PROPERTY
                              - CALL_PROPERTY
                              - AGENT_PROPERTY
                              - CALL_ID
                              - MODALITY
                              - DATASET
                              - METRIC_VALUE
                            description: >-
                              What the filter narrows on. GET
                              /v1/analytics/schema lists each type.
                          property:
                            type: string
                            description: >-
                              The property to compare. Required for
                              CALL_PROPERTY and METRIC_PROPERTY; may be omitted
                              for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
                          operator:
                            type: string
                            enum:
                              - EQUALS
                              - NOT_EQUALS
                              - GREATER_THAN
                              - GREATER_THAN_OR_EQUAL_TO
                              - LESS_THAN
                              - LESS_THAN_OR_EQUAL_TO
                              - CONTAINS
                              - STARTS_WITH
                            description: Defaults to EQUALS.
                          value:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                            description: >-
                              The value to compare against (an agent id, "call"
                              / "chat", a property value).
                        required:
                          - type
                          - value
                      maxItems: 20
                      description: >-
                        Filters for this measure only, on top of the query's
                        filters.
                    isBaseline:
                      type: boolean
                      description: >-
                        Mark one measure as the baseline: every series also
                        reports its value as a percentage of it.
                    color:
                      type: string
                      enum:
                        - GREEN
                        - RED
                        - ORANGE
                        - PURPLE
                        - GREY
                        - BLUE
                        - PEACH
                        - TEAL
                        - INDIGO
                        - AMBER
                        - ROSE
                        - CYAN
                      description: Chart color on a dashboard.
                minItems: 1
                maxItems: 10
                description: 'What to aggregate: 1 to 10 measures.'
              filters:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - METRIC_PROPERTY
                        - CALL_PROPERTY
                        - AGENT_PROPERTY
                        - CALL_ID
                        - MODALITY
                        - DATASET
                        - METRIC_VALUE
                      description: >-
                        What the filter narrows on. GET /v1/analytics/schema
                        lists each type.
                    property:
                      type: string
                      description: >-
                        The property to compare. Required for CALL_PROPERTY and
                        METRIC_PROPERTY; may be omitted for AGENT_PROPERTY,
                        DATASET, MODALITY and CALL_ID.
                    operator:
                      type: string
                      enum:
                        - EQUALS
                        - NOT_EQUALS
                        - GREATER_THAN
                        - GREATER_THAN_OR_EQUAL_TO
                        - LESS_THAN
                        - LESS_THAN_OR_EQUAL_TO
                        - CONTAINS
                        - STARTS_WITH
                      description: Defaults to EQUALS.
                    value:
                      anyOf:
                        - type: string
                        - type: number
                        - type: boolean
                      description: >-
                        The value to compare against (an agent id, "call" /
                        "chat", a property value).
                  required:
                    - type
                    - value
                maxItems: 20
                description: >-
                  Applied to every measure, on top of each measure's own
                  filters.
              interval:
                type: string
                enum:
                  - HOUR
                  - DAY
                  - WEEK
                  - MONTH
                description: >-
                  Bucket size. Defaults from the window's length and steps
                  coarser when the window would exceed 500 buckets.
              comparisonMode:
                type: string
                enum:
                  - NONE
                  - PREVIOUS_PERIOD
                description: >-
                  PREVIOUS_PERIOD adds the preceding window of the same length
                  to every series.
              comparisonGroups:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                      maxLength: 100
                      description: The series label; unique within the query.
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - METRIC_PROPERTY
                              - CALL_PROPERTY
                              - AGENT_PROPERTY
                              - CALL_ID
                              - MODALITY
                              - DATASET
                              - METRIC_VALUE
                            description: >-
                              What the filter narrows on. GET
                              /v1/analytics/schema lists each type.
                          property:
                            type: string
                            description: >-
                              The property to compare. Required for
                              CALL_PROPERTY and METRIC_PROPERTY; may be omitted
                              for AGENT_PROPERTY, DATASET, MODALITY and CALL_ID.
                          operator:
                            type: string
                            enum:
                              - EQUALS
                              - NOT_EQUALS
                              - GREATER_THAN
                              - GREATER_THAN_OR_EQUAL_TO
                              - LESS_THAN
                              - LESS_THAN_OR_EQUAL_TO
                              - CONTAINS
                              - STARTS_WITH
                            description: Defaults to EQUALS.
                          value:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                            description: >-
                              The value to compare against (an agent id, "call"
                              / "chat", a property value).
                        required:
                          - type
                          - value
                      minItems: 1
                      maxItems: 20
                    color:
                      type: string
                      enum:
                        - GREEN
                        - RED
                        - ORANGE
                        - PURPLE
                        - GREY
                        - BLUE
                        - PEACH
                        - TEAL
                        - INDIGO
                        - AMBER
                        - ROSE
                        - CYAN
                  required:
                    - name
                    - filters
                minItems: 2
                maxItems: 5
                description: >-
                  Run every measure once per named filter set, e.g. one group
                  per agent.
              name:
                type: string
                minLength: 1
                maxLength: 200
                description: 'Unique on the dashboard: how the widget is matched on update.'
              description:
                type: string
                maxLength: 2000
              display:
                type: string
                enum:
                  - LINE
                  - NUMBER
                  - RADAR
                  - STACKED_BAR
                  - TABLE
                description: Chart type. Defaults to LINE.
              size:
                type: string
                enum:
                  - SMALL
                  - MEDIUM
                  - LARGE
                  - EXTRA_LARGE
                description: Grid width. Defaults to MEDIUM.
              id:
                type: string
                format: uuid
            required:
              - measures
              - name
              - id
      required:
        - id
        - name
        - description
        - isDefault
        - configManaged
        - timeRange
        - createdAt
        - updatedAt
        - filters
        - widgets
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - validation
            - authentication
            - forbidden
            - not_found
            - conflict
            - payment_required
            - rate_limit
            - internal
          description: The error type category
          examples:
            - validation
            - authentication
        code:
          type: string
          description: Machine-readable error code identifier
          examples:
            - invalid_parameter
            - missing_required_field
            - unauthorized
        message:
          type: string
          description: Human-readable error message
          examples:
            - The request was invalid
            - Authentication required
        param:
          type: string
          description: The parameter that caused the error (if applicable)
          examples:
            - email
            - user_id
        details:
          description: Additional error context information
      required:
        - type
        - code
        - message
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.