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

# Group chats count

> Returns the total number of chats handled by each group during the specified period.

**Required scopes:** `reports_read`


## OpenAPI

````yaml /api/reports/v3.7/openapi.json post /reports/chats/groups
openapi: 3.0.0
info:
  title: Reports API
  description: Access and extract all the Reports data available in Text.
  version: '3.7'
servers:
  - url: https://api.livechatinc.com/v3.7
    description: Production
security:
  - PersonalAccessToken: []
  - OAuth2BearerToken: []
tags:
  - name: Chats
  - name: Agents
  - name: Customers
  - name: Tags
  - name: Stats
  - name: Sales
    description: Sales performance reports.
paths:
  /reports/chats/groups:
    post:
      tags:
        - Chats
      summary: Group chats count
      description: >-
        Returns the total number of chats handled by each group during the
        specified period.
      operationId: post-chats-groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatsReportRequest'
            example:
              distribution: day
              filters:
                from: '2026-06-20T00:00:00-00:00'
                to: '2026-06-22T23:59:59-00:00'
        required: true
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupChatsResponse'
              example:
                name: groups-report
                total: 29
                records:
                  '2024-08-20':
                    '0': 1
                    '2': 1
                  '2024-08-21':
                    '0': 20
                    '1': 2
                  '2024-08-22':
                    '0': 1
                    '1': 2
                    '3': 1
                    '4': 1
components:
  schemas:
    ChatsReportRequest:
      type: object
      properties:
        distribution:
          type: string
          enum:
            - hour
            - day
            - day-hours
            - month
            - year
          default: day
          description: The time distribution of results.
        timezone:
          type: string
          description: >-
            The IANA Time Zone identifier (for example, `America/Phoenix`). By
            default, the timezone is taken from the request. If not provided,
            it's taken from the agent's timezone. When the agent's timezone
            cannot be determined, `filters.from` is used to derive it.
        filters:
          $ref: '#/components/schemas/ChatsFilters'
    GroupChatsResponse:
      type: object
      properties:
        total:
          type: integer
          description: The total number of chats in the specified date range.
        records:
          type: object
          description: Contains distribution objects, for example, `day`.
          additionalProperties:
            type: object
            properties:
              group:
                type: object
                description: Contains `<group>:<chat_count>` pairs.
                additionalProperties:
                  type: integer
    ChatsFilters:
      type: object
      description: >-
        Filters for chats reports. If none provided, the report spans the last
        seven days. If filters are provided, they must contain exactly one pair
        of time-based filters (`from`/`to`, `greetings.from`/`to`, or
        `surveys.from`/`to`).
      properties:
        from:
          type: string
          description: >-
            The start of the time range. Date and time format compatible with
            RFC3339 with optional microsecond resolution:
            `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
        to:
          type: string
          description: >-
            The end of the time range. Date and time format compatible with
            RFC3339 with optional microsecond resolution:
            `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
        properties:
          $ref: '#/components/schemas/PropertiesFilter'
        agents:
          description: >-
            Agent filter. If `exists` is set to `false`, the API returns
            unassigned chats.
          allOf:
            - $ref: '#/components/schemas/StringFilterType'
        tags:
          $ref: '#/components/schemas/StringFilterType'
        sales:
          $ref: '#/components/schemas/IntegerFilterType'
        goals:
          $ref: '#/components/schemas/IntegerFilterType'
        forms:
          type: array
          items:
            $ref: '#/components/schemas/FormFilter'
          description: Form filters.
        event_types:
          $ref: '#/components/schemas/EventTypeFilterType'
        groups:
          description: A group filter. An array of group IDs.
          allOf:
            - $ref: '#/components/schemas/IntegerFilterType'
        greetings:
          $ref: '#/components/schemas/GreetingsFilter'
        agent_response:
          $ref: '#/components/schemas/AgentResponseFilter'
        customer_countries:
          description: >-
            Customer country filter. Country codes must follow the ISO 3166-1
            Alpha-2 format.
          allOf:
            - $ref: '#/components/schemas/StringFilterType'
    PropertiesFilter:
      type: object
      description: >-
        Property filters keyed by namespace. Each namespace value is an object
        keyed by property name, whose values are PropertyFilterType objects. A
        list of default properties is available in the default properties
        reference.
      additionalProperties:
        type: object
        additionalProperties:
          $ref: '#/components/schemas/PropertyFilterType'
    StringFilterType:
      type: object
      description: >-
        A filter type for string values. You can pass only one of the following
        at a time: `exists`, `values`, or `exclude_values`.
      properties:
        exists:
          type: boolean
          description: >-
            If `true`: the filter requires the field to exist. Available only
            for Chats parameters.
        values:
          type: array
          items:
            type: string
          description: An array of string values to include.
        exclude_values:
          type: array
          items:
            type: string
          description: An array of string values to exclude.
        require_every_value:
          type: boolean
          description: >-
            If `true`: returns only chats that have all elements passed in
            `values` or `exclude_values`.
    IntegerFilterType:
      type: object
      description: >-
        A filter type for integer values. You can pass only one of the following
        at a time: `exists`, `values`, or `exclude_values`.
      properties:
        exists:
          type: boolean
          description: 'If `true`: the filter requires the field to exist.'
        values:
          type: array
          items:
            type: integer
          description: An array of integer values to include.
        exclude_values:
          type: array
          items:
            type: integer
          description: An array of integer values to exclude.
        require_every_value:
          type: boolean
          description: >-
            If `true`: returns only chats that have all elements passed in
            `values` or `exclude_values`.
    FormFilter:
      type: object
      description: A form filter object.
      properties:
        type:
          type: string
          enum:
            - pre_chat
            - post_chat
          description: The form type.
        values:
          type: array
          items:
            type: string
          description: An array of answer IDs to include.
        exclude_values:
          type: array
          items:
            type: string
          description: An array of answer IDs to exclude.
        from:
          type: string
          description: >-
            The start of the form submission time range. Date and time format
            compatible with RFC3339 with optional microsecond resolution:
            `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
        to:
          type: string
          description: >-
            The end of the form submission time range. Date and time format
            compatible with RFC3339 with optional microsecond resolution:
            `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
        exists:
          type: boolean
          description: 'If `true`: returns only surveys that have a `survey_id`.'
        groups:
          $ref: '#/components/schemas/IntegerFilterType'
    EventTypeFilterType:
      type: object
      description: >-
        A filter type for event types. You can pass only one of the following at
        a time: `values` or `exclude_values`.
      properties:
        values:
          type: array
          items:
            type: string
          description: An array of Event type values to include. Duplicates are ignored.
        exclude_values:
          type: array
          items:
            type: string
          description: An array of Event type values to exclude. Duplicates are ignored.
        require_every_value:
          type: boolean
          description: >-
            If `true`: returns only chats that have all elements passed in
            `values` or `exclude_values`.
    GreetingsFilter:
      type: object
      description: A filter for chats started from greetings.
      properties:
        from:
          type: string
          description: >-
            The start of the greeting time range. Date and time format
            compatible with RFC3339 with optional microsecond resolution:
            `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
        to:
          type: string
          description: >-
            The end of the greeting time range. Date and time format compatible
            with RFC3339 with optional microsecond resolution:
            `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
        exists:
          type: boolean
          description: 'If `true`: the filter requires the greeting to exist.'
        values:
          type: array
          items: {}
          description: An array of property values to include.
        exclude_values:
          type: array
          items: {}
          description: An array of property values to exclude.
        groups:
          $ref: '#/components/schemas/IntegerFilterType'
    AgentResponseFilter:
      type: object
      description: A filter for agent responses.
      properties:
        exists:
          type: boolean
          description: Filters by whether an agent response exists.
        first:
          type: boolean
          description: >-
            A modifier that makes the other `agent_response` filters operate
            exclusively on the agent's first response.
        agents:
          $ref: '#/components/schemas/StringFilterType'
        groups:
          $ref: '#/components/schemas/IntegerFilterType'
    PropertyFilterType:
      type: object
      description: >-
        A filter type for chat properties. Only one value is allowed for a
        single property. You can pass only one of the following at a time:
        `exists`, `values`, or `exclude_values`.
      properties:
        exists:
          type: boolean
          description: 'If `true`: the filter requires the property to exist.'
        values:
          type: array
          items: {}
          description: >-
            An array of property values to include. The array item type matches
            the property type (`string`, `int`, or `bool`).
        exclude_values:
          type: array
          items: {}
          description: >-
            An array of property values to exclude. The array item type matches
            the property type (`string`, `int`, or `bool`).
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: basic
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
    OAuth2BearerToken:
      type: http
      scheme: bearer
      description: Authenticate using an OAuth 2.0 Bearer token.
      x-example: us-south1:MQraNrGCsoJvtxD7KNJQB1kM3d5

````