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

> The reports you can read with [get a report](/api-reference/cloudchat/endpoints/get-a-report). Each one is a dashboard from the Reports area of Cloud Chat, and reading it through the API returns the same numbers the dashboard shows.

For each report the list gives the metric keys you can ask for, the metrics returned when you ask for none, the filters it accepts and how its time series can be grouped. These differ per report, so read them from here instead of hardcoding them.



## OpenAPI

````yaml api-reference/specs/cloudchat/v1.json GET /v1/accounts/{accountId}/reports
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}/reports:
    parameters:
      - $ref: '#/components/parameters/CloudChatInstance'
      - $ref: '#/components/parameters/AccountId'
    get:
      tags:
        - Reports
      summary: List reports
      description: >-
        The reports you can read with [get a
        report](/api-reference/cloudchat/endpoints/get-a-report). Each one is a
        dashboard from the Reports area of Cloud Chat, and reading it through
        the API returns the same numbers the dashboard shows.


        For each report the list gives the metric keys you can ask for, the
        metrics returned when you ask for none, the filters it accepts and how
        its time series can be grouped. These differ per report, so read them
        from here instead of hardcoding them.
      operationId: listReports
      responses:
        '200':
          description: The reports available on the account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportCatalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ReportsForbidden'
        '404':
          $ref: '#/components/responses/ReportsNotFound'
        '429':
          $ref: '#/components/responses/ReportsTooManyRequests'
        '500':
          $ref: '#/components/responses/ReportsInternalError'
        '503':
          $ref: '#/components/responses/ReportsUnavailable'
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:
    ReportCatalog:
      type: object
      description: The reports you can read on this account.
      required:
        - data
      properties:
        data:
          type: array
          description: One entry per report.
          items:
            $ref: '#/components/schemas/ReportSummary'
    ReportSummary:
      type: object
      description: One report and what it accepts.
      required:
        - key
        - name
        - date_axis
        - metrics
        - default_metrics
        - filters
        - group_by
      properties:
        key:
          type: string
          description: The key you pass as `reportKey`.
          example: claudia_general_info
        name:
          type: string
          description: The report name, as Cloud Chat shows it.
          example: ClaudIA - Informações Gerais
        date_axis:
          type: string
          description: >-
            Which date `from` and `to` filter on. `conversation_created` is the
            day the conversation started.
          example: conversation_created
        metrics:
          type: array
          description: Every metric of the report.
          items:
            $ref: '#/components/schemas/ReportMetricSummary'
        default_metrics:
          type: array
          description: The metric keys returned when you send no `metrics`.
          items:
            type: string
          example:
            - volume
            - n1_retained
            - retention
            - csat_n1
        filters:
          type: array
          description: >-
            The query parameters this report accepts as filters, including
            `from` and `to` when the report has a date to filter on.
          items:
            type: string
          example:
            - from
            - to
            - project
            - closing
        group_by:
          type: array
          description: >-
            The values `group_by` accepts on this report. Empty when the report
            has no time series to split.
          items:
            type: string
          example:
            - date
            - week
            - month
    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
    ReportMetricSummary:
      type: object
      description: One metric of a report.
      required:
        - key
      properties:
        key:
          type: string
          description: The key you pass in `metrics`.
          example: retention
        name:
          type: string
          description: >-
            The metric name as the dashboard shows it, in the dashboard's
            language.
          nullable: true
          example: Taxa de retenção
  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.
    ReportsForbidden:
      description: >-
        Reading reports needs an administrator, supervisor or CX engineer role,
        or an agent role on an account that granted reports to its agents. 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.
    ReportsNotFound:
      description: >-
        The account does not exist, you are not a member of it, reports are not
        enabled on it, or the `reportKey` does not exist. These cases are
        deliberately indistinguishable. Check `reportKey` against [list
        reports](/api-reference/cloudchat/endpoints/list-reports) before
        anything else.
      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.
    ReportsUnavailable:
      description: >-
        The reporting backend is unavailable, or no metric finished in time.
        Retry in a few minutes; if it persists, ask for fewer metrics or a
        shorter period.
      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.