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

# List report query fields

> The fields you can ask for with [run a report query](/api-reference/cloudchat/endpoints/run-a-report-query), for questions about ClaudIA conversations that no metric of [get a report](/api-reference/cloudchat/endpoints/get-a-report) answers. When a report has the metric, prefer it: its numbers are the ones the Cloud Chat dashboards show.

A `dimension` splits the rows and a `measure` is aggregated within each split. Each date also comes split by period, such as `creation_date[week]` or `creation_date[month]`, to group rows by week or month. Only `STRING` dimensions can be filtered.



## OpenAPI

````yaml api-reference/specs/cloudchat/v1.json GET /v1/accounts/{accountId}/report-queries/fields
openapi: 3.0.1
info:
  title: Cloud Chat API
  version: v1
  description: >-
    The curated public surface of Cloud Chat. Every call needs two things: the
    Bearer token from `POST /auth/v1/signin`, and the `cloudchat-instance`
    header that says which Cloud Chat instance your company lives on.


    If you don't know your instance value, the [Find your
    credentials](/api-reference/cloudchat/credentials) page reads it out of your
    own token in the browser.
servers:
  - url: https://api.cloudhumans.com/cloudchat
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Canned Responses
    description: >-
      Canned responses — the shortcuts agents expand while replying. Each one
      belongs to a single account and is identified by its short code.
  - name: Conversations
    description: >-
      Read-only access to the conversations of an account. What you can see
      follows the same rule as the dashboard: an administrator token sees every
      inbox, an agent token only the inboxes it is a member of.
  - name: Help Center
    description: >-
      Portals, categories and articles of the help center — the public FAQ your
      customers read.
  - name: Uploads
    description: Store the images help center articles embed.
  - name: Labels
    description: >-
      Read-only access to the labels an account has defined. A label is a tag
      conversations and contacts carry; this endpoint only lists the label
      definitions themselves.
  - name: Inboxes
    description: >-
      Read-only access to the inboxes a token can see — every inbox of the
      account for an administrator, only its memberships for an agent. Never
      includes the channel's credentials.
  - name: Agents
    description: >-
      Read-only access to the human and AI agents of an account. A hidden admin
      (the platform's own support user) never appears, on the list or by id.
  - name: Teams
    description: >-
      Teams group agents for assignment. Listing and reading are open to any
      member; creating and updating a team, and managing its membership, require
      an administrator token. A system-managed team (provisioned by the
      platform) can be read like any other but never updated.
  - name: Macros
    description: >-
      Macros bundle a sequence of actions an agent runs against a conversation
      from the dashboard. This surface lets you list, read and write macro
      definitions — running one is not part of the v1 contract. A macro is
      either `global` (visible to the whole account) or `personal` (visible only
      to its author); an agent token can only create personal macros.
  - name: Automation Rules
    description: >-
      Read-only access to the account's automation rules — administrator only.
      An agent token gets a 403 on every operation in this group.
  - name: Availability Reasons
    description: >-
      The reasons an agent can go `busy` for, configured per account. Listing is
      open to any member; creating, updating and deleting require an
      administrator token. Deleting is a soft delete — the reason disappears
      from listings but agents' past availability history keeps referencing it.
  - name: Native Attribute Requirements
    description: >-
      Which native conversation attributes (priority, assignee, tag, team) the
      account requires agents to fill before resolving a conversation. Listing
      is open to any member; requiring and un-requiring need an administrator
      token. Deleting a requirement is reversible — require the same key again
      to restore it.
  - name: Campaigns
    description: Check who a campaign would reach, send it, and read the result back.
  - name: Reports
    description: The numbers of the Cloud Chat reporting dashboards, read through the API.
paths:
  /v1/accounts/{accountId}/report-queries/fields:
    parameters:
      - $ref: '#/components/parameters/CloudChatInstance'
      - $ref: '#/components/parameters/AccountId'
    get:
      tags:
        - Reports
      summary: List report query fields
      description: >-
        The fields you can ask for with [run a report
        query](/api-reference/cloudchat/endpoints/run-a-report-query), for
        questions about ClaudIA conversations that no metric of [get a
        report](/api-reference/cloudchat/endpoints/get-a-report) answers. When a
        report has the metric, prefer it: its numbers are the ones the Cloud
        Chat dashboards show.


        A `dimension` splits the rows and a `measure` is aggregated within each
        split. Each date also comes split by period, such as
        `creation_date[week]` or `creation_date[month]`, to group rows by week
        or month. Only `STRING` dimensions can be filtered.
      operationId: listReportQueryFields
      parameters:
        - name: topic
          in: query
          required: false
          description: >-
            The topic to list, as `key` in the answer. Leave it out for
            `claudia_conversations`, currently the only one.
          schema:
            type: string
            example: claudia_conversations
      responses:
        '200':
          description: The fields of the topic.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportQueryTopic'
              example:
                key: claudia_conversations
                name: ClaudIA Conversations
                date_axis: conversation_created
                max_days: 366
                fields:
                  - name: datamart_claudia__claudia_conversation.creation_date[week]
                    kind: dimension
                    type: TIMESTAMP
                    label: Week
                  - name: datamart_claudia__claudia_conversation.project_name
                    kind: dimension
                    type: STRING
                  - name: datamart_claudia__claudia_conversation.taxa_retencao_pct
                    kind: measure
                    type: NUMBER
                    label: Taxa de retencao (%)
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ReportQueriesForbidden'
        '404':
          $ref: '#/components/responses/ReportQueriesNotFound'
        '429':
          $ref: '#/components/responses/ReportsTooManyRequests'
        '500':
          $ref: '#/components/responses/ReportsInternalError'
        '503':
          $ref: '#/components/responses/ReportQueriesUnavailable'
components:
  parameters:
    CloudChatInstance:
      name: cloudchat-instance
      in: header
      required: true
      description: >-
        Your Cloud Chat instance ID — an integer, fixed for your company, told
        at onboarding. [The API
        overview](/api-reference/cloudchat/overview#two-headers-every-call)
        explains how instances work, how to find yours, and the errors a wrong
        or missing value produces.
      schema:
        type: integer
        example: 1
    AccountId:
      name: accountId
      in: path
      required: true
      description: >-
        Your Cloud Chat account. It has to be an account your token grants
        membership on, and it has to live on the instance in the
        `cloudchat-instance` header — the two travel together. Account numbers
        are only unique **within** an instance, so the same number is a
        different company on another instance. Usually a mismatched pair fails
        closed with a 401, because your user does not exist on the other
        instance — but if your identity happens to exist on both, the call
        succeeds against the other company's data, silently. Read it and you are
        looking at the wrong help center; write it and you have stored into the
        wrong account. Send the two values that were given to you together, and
        never try a number to see what answers.
      schema:
        type: integer
        example: 1
  schemas:
    ReportQueryTopic:
      type: object
      description: The fields a query can ask for on one topic.
      required:
        - key
        - name
        - date_axis
        - max_days
        - fields
      properties:
        key:
          type: string
          description: The topic key, to send as `topic`.
        name:
          type: string
          description: The topic name.
        date_axis:
          type: string
          description: >-
            Which date `from` and `to` filter on. `conversation_created`: the
            day the conversation started.
        max_days:
          type: integer
          description: The longest period one query may span, in days.
        fields:
          type: array
          description: The fields a query can ask for.
          items:
            type: object
            required:
              - name
              - kind
              - type
            properties:
              name:
                type: string
                description: >-
                  The name to send in `fields`, `filters` and `sorts`, and the
                  key of its value in each row.
              kind:
                type: string
                enum:
                  - dimension
                  - measure
                description: >-
                  A `dimension` splits the rows; a `measure` is aggregated
                  within each split.
              type:
                type: string
                description: >-
                  The value type, such as `STRING`, `NUMBER`, `BOOLEAN` or
                  `TIMESTAMP`. Only `STRING` dimensions can be filtered.
              label:
                type: string
                description: A readable name for the field.
              description:
                type: string
                description: What the field holds, when documented.
    Error:
      type: object
      description: The error envelope every Cloud Chat API response uses.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                The stable, machine-readable reason. Branch on this, never on
                `message`.
              enum:
                - unauthorized
                - forbidden
                - not_found
                - validation_failed
                - bad_request
                - internal_error
                - rate_limited
                - service_unavailable
              example: not_found
            message:
              type: string
              description: >-
                The reason in words, localized to your account's language
                (English, Spanish or Brazilian Portuguese; English when the
                account is set to anything else). Wording changes with the
                account and between releases, so never match on it.


                Two cases stay in English whatever the account is set to:
                `unauthorized`, decided before any account is known, and the
                account-level `not_found`, which must not reveal the account's
                language.
              example: Resource could not be found.
            details:
              type: array
              description: >-
                Present on some rejections — a 400 for a refused query parameter
                or upload mode, for example. One entry per offending field,
                localized to the account's language like `message` — match on
                `code` and `field`, never on the text.
              items:
                type: object
                required:
                  - field
                  - code
                  - message
                properties:
                  field:
                    type: string
                    description: Which request field the rule was about.
                  code:
                    type: string
                    description: Stable, machine-readable reason.
                  message:
                    type: string
                    description: The rule in words.
    GatewayError:
      type: object
      description: >-
        Rejected by the gateway before Cloud Chat saw it, so it does not use the
        `error` envelope.
      required:
        - message
      properties:
        message:
          type: string
          example: API rate limit exceeded
        request_id:
          type: string
          description: Gateway request id. Quote it when reporting a problem.
          example: f3f7567638d4b65a8003057d0c77d275
  responses:
    BadRequest:
      description: >-
        The request itself is malformed, before any value is validated:


        - a body that isn't valid JSON, or one with no `canned_response`
        wrapper,

        - a `canned_response` that isn't an object (`{"canned_response":
        "text"}`),

        - `page`, `per_page`, `search` or `sort` sent as an array or a nested
        object (`?page[]=1`, `?sort[x]=y`) instead of a plain value,

        - **the `cloudchat-instance` header missing or holding a value we don't
        route,**

        - an `accountId` that is not a number — including the literal
        `{accountId}` that some API clients send when the argument is left
        unset. This one answers with the normal envelope and `error.details`
        naming `accountId`, and it is deliberately **not** a 404: a 404 would
        mean the account cannot be reached, while this means the value was never
        an account id at all, so re-read the argument instead of trying other
        numbers.


        **Two different shapes answer with 400, and the difference will bite you
        on day one.** That last case is rejected before the request reaches the
        API, so `error` is a plain **string** instead of the usual object:


        ```json

        { "error": "<human-readable message>" }

        ```


        Every other 400 uses the normal envelope, where `error` is an object
        with `code` and `message`. Reading `error.code` without checking the
        type first throws on the missing-header case — which is the most likely
        400 of your first integration. Check `typeof error === "string"` first,
        or read `error?.code` defensively.


        A 400 always means fix the request shape; it never means a value was
        rejected. Rejected values are 422.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: bad_request
              message: The request is malformed.
    Unauthorized:
      description: >-
        No Bearer token, or one that is expired, malformed, or not a Cognito
        token. Sign in again for a fresh `id_token`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: >-
                Authentication is required. Send a valid Bearer token in the
                Authorization header.
    ReportQueriesForbidden:
      description: >-
        Running queries needs an administrator, supervisor or CX engineer role.
        A suspended account also answers `403`, and then nothing on it works
        until it is reactivated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: You are not allowed to perform this action.
    ReportQueriesNotFound:
      description: >-
        The account does not exist, you are not a member of it, queries are not
        enabled on it, or the `topic` does not exist. These cases are
        deliberately indistinguishable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: Resource could not be found.
    ReportsTooManyRequests:
      description: >-
        Rate limited. The gateway answers `{ "message": ... }`, with
        `Retry-After` and the `ratelimit-*` headers carrying the current values.
        Other limits answer the usual envelope with code `rate_limited` and can
        apply even when your account made few calls: wait a minute before
        retrying. Don't hardcode any limit.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/GatewayError'
              - $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Too many requests. Wait a minute and try again.
    ReportsInternalError:
      description: >-
        Something broke on our side. It is reported to our monitoring
        automatically. Retrying the same call will not help until it is fixed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: An unexpected error occurred. Please try again later.
    ReportQueriesUnavailable:
      description: >-
        The reporting backend is unavailable or did not answer in time. Retry in
        a few minutes; if it persists, ask for a shorter period or fewer fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: service_unavailable
              message: >-
                The reporting service is temporarily unavailable. Try again in a
                few minutes.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The `id_token` from `POST /auth/v1/signin`, sent as `Authorization:
        Bearer <id_token>`. Not the `access_token` — that one does not carry the
        identity Cloud Chat authorizes on.

````

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