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

> Fetches the group message list for a user.

# List Group Messages

For the complete error reference, see [Error Guide](/articles/error-guide).


## OpenAPI

````yaml get /groups/{guid}/messages
openapi: 3.0.0
info:
  title: Chat APIs
  description: Manage messages, users, groups for a particular app using our Chat API.
  version: '3.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: API Keys
    description: The API keys are used to authorise the APIs
  - name: Roles
    description: The roles are used to give user access rights
  - name: Users
    description: The REST collection for users.
  - name: Auth Tokens
    description: The auth tokens are used to login end users using client SDKs.
  - name: Blocked Users
    description: The REST collections for blocked users.
  - name: Friends
    description: List,add and remove friends by passing UID in path variables
  - name: Groups
    description: The REST collections for groups.
  - name: Banned Users
    description: Ban and Unban user by passing other UID in path variables.
  - name: Group Members
    description: The REST collections for group members.
  - name: Messages
    description: The REST collections for messages.
  - name: Conversations
    description: The REST collections for conversations.
  - name: Restrict Features
    description: Allows Restricting Features
  - name: Metrics
    description: Allows accessing Data Metrics
  - name: Triggers
    description: Allows adding triggers to a webhook.
  - name: Webhooks
    description: Allows accessing Webhooks.
  - name: Notifications
    description: Allows configuring Notifications core.
paths:
  /groups/{guid}/messages:
    get:
      tags:
        - Messages
      summary: List Group Messages
      description: Fetches the group message list for a user.
      operationId: user-list-group-messages
      parameters:
        - $ref: '#/components/parameters/onBehalfOf'
        - $ref: '#/components/parameters/guid'
        - name: searchKey
          in: query
          description: searches for occurence of message.
          schema:
            type: string
        - name: hasAttachments
          in: query
          description: Fetches messages that include attachments.
          schema:
            type: boolean
        - name: attachmentTypes
          in: query
          description: >-
            Displays messages according to the type of attachment. Supported
            types include: image, video, audio, and file.
          schema:
            type: string
            enum:
              - image
              - video
              - audio
              - file
            description: Media message type.
        - name: hasMentions
          in: query
          description: Fetches messages that include mentions.
          schema:
            type: boolean
        - name: hasLinks
          in: query
          description: Fetches messages that include links.
          schema:
            type: boolean
        - name: mentionedUids
          in: query
          description: Fetches messages that include the mentioned comma-separated UIDs.
          schema:
            type: boolean
        - name: unread
          in: query
          description: displays all the unread messages of the user.
          schema:
            type: boolean
        - name: undelivered
          in: query
          description: displays all the messages those are undelivered.
          schema:
            type: boolean
        - name: count
          in: query
          description: displays the count of messages as per group/user
          schema:
            type: boolean
        - name: hideMessagesFromBlockedUsers
          in: query
          description: Hides the messages from blocked users in group.
          schema:
            type: boolean
        - name: hideReplies
          in: query
          description: Shows only messages skipping the replies in the message thread.
          schema:
            type: boolean
        - name: affix
          in: query
          description: >-
            Determines whether to pull the messages either before or after any
            message id. Possible values are append(after) and prepend(before).
          schema:
            type: string
            enum:
              - append
              - prepend
            description: Cursor pagination direction.
        - name: id
          in: query
          description: Retrieves all those messages after the passed id.
          schema:
            type: string
        - name: category
          in: query
          description: Fetches messages that belongs to specific category.
          schema:
            type: string
        - name: categories
          in: query
          description: Fetches messages that contains multiple categories.
          schema:
            type: array
            items: {}
        - name: type
          in: query
          description: Fetches messages that belongs to a specific type.
          schema:
            type: string
        - name: types
          in: query
          description: Fetches messages with multiple types.
          schema:
            type: array
            items: {}
        - name: myMentionsOnly
          in: query
          description: Filters messages with mentions for the UID in onBehalfOf header.
          schema:
            type: boolean
            default: 'false'
        - name: hasReactions
          in: query
          description: >-
            Filters messages sent by a the uid given in sender query param and
            has reactions. If onBehalfOf header is also set then the messages
            from their common conversations will be filtered.
          schema:
            type: boolean
            default: 'false'
        - name: sender
          in: query
          description: >-
            Filters messages with sender. If onBehalfOf header is also set then
            the messages from their common conversations will be filtered.
          schema:
            type: string
        - name: mentionsWithBlockedInfo
          in: query
          description: >-
            For the mentioned users, provides blocked information with respect
            to the UID in onBehalfOf header.
          schema:
            type: boolean
            default: 'false'
        - name: mentionsWithTagInfo
          in: query
          description: Provides user tags for the mentioned users.
          schema:
            type: boolean
            default: 'false'
        - name: limit
          in: query
          description: >-
            The number of records to fetch. Minimum value: 1, Maximum value:
            1000
          schema:
            type: integer
            default: '10'
        - name: fromTimestamp
          in: query
          description: Fetches the messages from this timestamp.
          schema:
            type: integer
        - name: toTimestamp
          in: query
          description: Fetches the messages till this timestamp.
          schema:
            type: integer
        - name: withTags
          in: query
          description: This will fetch messages along with the tags.
          schema:
            type: boolean
        - name: tags
          in: query
          description: This will fetch only those messages belonging to the mentioned tags.
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Retreived Group Messages
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        conversationId:
                          type: string
                        sender:
                          type: string
                        receiverType:
                          type: string
                        receiver:
                          type: string
                        category:
                          type: string
                        type:
                          type: string
                        data:
                          type: object
                        sentAt:
                          type: integer
                        updatedAt:
                          type: integer
                  meta:
                    type: object
                type: object
              example:
                data:
                  - id: '1'
                    conversationId: cometchat-uid-3_user_cometchat-uid-5
                    sender: cometchat-uid-3
                    receiverType: user
                    receiver: cometchat-uid-5
                    category: message
                    type: text
                    data:
                      text: test     hello
                      entities:
                        sender:
                          entity:
                            uid: cometchat-uid-3
                            name: Nancy Grace
                            role: default
                            avatar: >-
                              https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp
                            status: offline
                            createdAt: 1638361550
                          entityType: user
                        receiver:
                          entity:
                            uid: cometchat-uid-5
                            name: John Paul
                            role: default
                            avatar: >-
                              https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp
                            status: offline
                            createdAt: 1638361550
                            conversationId: cometchat-uid-3_user_cometchat-uid-5
                          entityType: user
                      metadata:
                        key1: val1
                    sentAt: 1638423490
                    updatedAt: 1638423490
                meta:
                  current:
                    limit: 100
                    count: 1
                  next:
                    affix: append
                    sentAt: 1638423490
                    id: '1'
      security:
        - apiKey: []
components:
  parameters:
    onBehalfOf:
      name: onBehalfOf
      in: header
      description: UID of the user on whose behalf the action is performed.
      schema:
        type: string
    guid:
      name: guid
      in: path
      description: A GUID of a group.
      required: true
      schema:
        type: string
      examples:
        string:
          summary: GUID
          value: cometchat-guid-1
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````