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

# Get metrics breakdown

> Totals one metric over the range for each user, group, Agent, Workflow, or source, largest first. For example, credits by person, Workflow runs by Workflow, or chat messages by source, such as Slack or Microsoft Teams.

**Metrics and the dimensions they support** (`metric` and `groupBy`)
- `credits`: `user`, `group`, `agent`, `workflow`, `source`
- `chatMessages`: `user`, `group`, `agent`, `source`
- `workflowRuns`: `user`, `group`, `workflow`
- `meetingHours`: `user`, `group`
- `meetings`: `user`, `group`

For `meetingHours` and `meetings`, each meeting counts toward the member it's attributed to, the person who first added the notetaker. To see who joined each meeting, use `/meetings`.

Narrow the results to a person, group, Workflow, source, or specific Agents or models with the filters below.

The range is widened to whole days in UTC.

Requires the Analytics permission (`analytics:read`).



## OpenAPI

````yaml /admin-api-openapi.json get /metrics/breakdown
openapi: 3.1.1
info:
  title: Cassidy Admin API
  description: Read your organization's usage analytics and activity in Cassidy.
  version: 1.0.0
servers:
  - url: https://app.cassidyai.com/api/admin/v1
security: []
tags:
  - name: Analytics
  - name: Workflow runs
  - name: Chats
  - name: Meetings
  - name: Audit logs
externalDocs:
  url: https://docs.cassidyai.com/reference/admin-api
paths:
  /metrics/breakdown:
    get:
      tags:
        - Analytics
      summary: Get metrics breakdown
      description: >-
        Totals one metric over the range for each user, group, Agent, Workflow,
        or source, largest first. For example, credits by person, Workflow runs
        by Workflow, or chat messages by source, such as Slack or Microsoft
        Teams.


        **Metrics and the dimensions they support** (`metric` and `groupBy`)

        - `credits`: `user`, `group`, `agent`, `workflow`, `source`

        - `chatMessages`: `user`, `group`, `agent`, `source`

        - `workflowRuns`: `user`, `group`, `workflow`

        - `meetingHours`: `user`, `group`

        - `meetings`: `user`, `group`


        For `meetingHours` and `meetings`, each meeting counts toward the member
        it's attributed to, the person who first added the notetaker. To see who
        joined each meeting, use `/meetings`.


        Narrow the results to a person, group, Workflow, source, or specific
        Agents or models with the filters below.


        The range is widened to whole days in UTC.


        Requires the Analytics permission (`analytics:read`).
      operationId: getMetricsBreakdown
      parameters:
        - in: query
          name: userId
          schema:
            description: >-
              Only count usage by this user. For `meetingHours` and `meetings`,
              only count meetings billed to them, which are the meetings they
              were first to add the notetaker to.
            type: string
          description: >-
            Only count usage by this user. For `meetingHours` and `meetings`,
            only count meetings billed to them, which are the meetings they were
            first to add the notetaker to.
        - in: query
          name: externalEmail
          schema:
            description: >-
              Only count usage by this external deployment user (e.g. such as a
              Slack, Microsoft Teams, Google Chat, or email user).
            type: string
          description: >-
            Only count usage by this external deployment user (e.g. such as a
            Slack, Microsoft Teams, Google Chat, or email user).
        - in: query
          name: groupId
          schema:
            description: >-
              Only count usage by members of this group. This uses current group
              membership, so it may include a member's usage from before they
              joined.
            type: string
          description: >-
            Only count usage by members of this group. This uses current group
            membership, so it may include a member's usage from before they
            joined.
        - in: query
          name: agentIds
          schema:
            description: >-
              Only include these Agents, using the IDs from the `agent`
              breakdown or `/chats`. Built-in models combine their thinking
              levels. Pass several as a comma-separated list.
            maxItems: 20
            type: array
            items:
              type: string
          description: >-
            Only include these Agents, using the IDs from the `agent` breakdown
            or `/chats`. Built-in models combine their thinking levels. Pass
            several as a comma-separated list.
        - in: query
          name: excludeAgentIds
          schema:
            description: Leave out these Agents. Pass several as a comma-separated list.
            maxItems: 20
            type: array
            items:
              type: string
          description: Leave out these Agents. Pass several as a comma-separated list.
        - in: query
          name: modelIds
          schema:
            description: >-
              Only include Agents that use these models, such as
              `claude-opus-5-5`, including the built-in model's own Agent.
              Agents count as the model they use today, so changing an Agent's
              model moves its past usage too. Thinking levels are combined. Pass
              several as a comma-separated list.
            maxItems: 20
            type: array
            items:
              type: string
          description: >-
            Only include Agents that use these models, such as
            `claude-opus-5-5`, including the built-in model's own Agent. Agents
            count as the model they use today, so changing an Agent's model
            moves its past usage too. Thinking levels are combined. Pass several
            as a comma-separated list.
        - in: query
          name: excludeModelIds
          schema:
            description: >-
              Leave out Agents that use these models. Pass several as a
              comma-separated list.
            maxItems: 20
            type: array
            items:
              type: string
          description: >-
            Leave out Agents that use these models. Pass several as a
            comma-separated list.
        - in: query
          name: workflowId
          schema:
            description: Only count usage of this Workflow.
            type: string
          description: Only count usage of this Workflow.
        - in: query
          name: source
          schema:
            description: >-
              Only count Agent chat usage from this source, such as `slack` or
              `web`. Available for `credits` and `chatMessages`; with `credits`,
              only Agent chat credits count.
            type: string
            enum:
              - web
              - slack
              - teams
              - googleChat
              - embedded
              - email
              - api
          description: >-
            Only count Agent chat usage from this source, such as `slack` or
            `web`. Available for `credits` and `chatMessages`; with `credits`,
            only Agent chat credits count.
        - in: query
          name: from
          schema:
            type: string
            format: date-time
            description: >-
              Inclusive start of the range as an ISO 8601 timestamp. Rounded
              down to the start of its bucket in UTC.
          required: true
          description: >-
            Inclusive start of the range as an ISO 8601 timestamp. Rounded down
            to the start of its bucket in UTC.
        - in: query
          name: to
          schema:
            type: string
            format: date-time
            description: >-
              Exclusive end of the range as an ISO 8601 timestamp. Rounded up to
              the next bucket boundary in UTC.
          required: true
          description: >-
            Exclusive end of the range as an ISO 8601 timestamp. Rounded up to
            the next bucket boundary in UTC.
        - in: query
          name: metric
          schema:
            type: string
            enum:
              - credits
              - chatMessages
              - workflowRuns
              - meetingHours
              - meetings
            description: The metric to total.
          required: true
          description: The metric to total.
        - in: query
          name: groupBy
          schema:
            type: string
            enum:
              - user
              - group
              - agent
              - workflow
              - source
            description: >-
              The dimension to total by. Not every metric supports every
              dimension; the error message lists the ones it does.
          required: true
          description: >-
            The dimension to total by. Not every metric supports every
            dimension; the error message lists the ones it does.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  from:
                    type: string
                  to:
                    type: string
                  metric:
                    type: string
                    enum:
                      - credits
                      - chatMessages
                      - workflowRuns
                      - meetingHours
                      - meetings
                  groupBy:
                    type: string
                    enum:
                      - user
                      - group
                      - agent
                      - workflow
                      - source
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          description: >-
                            ID of the user, group, Agent, or Workflow, or the
                            source, such as `slack`. Null for external users.
                          type:
                            - string
                            - 'null'
                        name:
                          type: string
                          description: Display name.
                        externalEmail:
                          description: >-
                            When grouped by user, the email of a deployment user
                            (for example from Slack or Microsoft Teams) who
                            doesn't match any member's email.
                          type:
                            - string
                            - 'null'
                        value:
                          type: number
                      required:
                        - id
                        - name
                        - externalEmail
                        - value
                    description: >-
                      Users, groups, Agents, Workflows, or sources with usage in
                      the range, largest first. At most 10000 rows. Groups use
                      current group membership, and a user in several groups
                      counts toward each, so group values can overlap. Agent and
                      source values count direct chats only, not usage inside
                      Workflows, and built-in model Agents combine their
                      thinking levels. For `meetingHours` and `meetings`, each
                      meeting counts toward the member it's attributed to, the
                      person who first added the notetaker.
                  truncated:
                    type: boolean
                    description: >-
                      True when more than 10000 rows had usage and only the
                      largest were returned. Narrow the range or add a filter to
                      see the rest.
                required:
                  - from
                  - to
                  - metric
                  - groupBy
                  - rows
                  - truncated
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - bearerAuth:
            - analytics:read
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
      required:
        - message
        - code
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
      required:
        - message
        - code
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.FORBIDDEN:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Insufficient access
        code:
          type: string
          description: The error code
          example: FORBIDDEN
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
      required:
        - message
        - code
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
      required:
        - message
        - code
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
      required:
        - message
        - code
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Admin API key, starting with `cas_admin_`.

````

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