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

> Adds multiple users as per the scope.

# Add members

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


## OpenAPI

````yaml post /groups/{guid}/members
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}/members:
    post:
      tags:
        - Group Members
      summary: Add members
      description: Adds multiple users as per the scope.
      operationId: add-group-members
      parameters:
        - $ref: '#/components/parameters/onBehalfOf'
        - $ref: '#/components/parameters/guid'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                admins:
                  description: UIDs of users to be made admins.
                  type: array
                  items:
                    type: string
                  default: []
                moderators:
                  description: UIDs of users to be made moderators.
                  type: array
                  items:
                    type: string
                  default: []
                participants:
                  description: UIDs of users to be made participants.
                  type: array
                  items:
                    type: string
                  default: []
                usersToBan:
                  description: UIDs of the users to be banned from the group.
                  type: array
                  items:
                    type: string
                  default: []
              type: object
      responses:
        '200':
          description: Create Group Members
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: object
                type: object
              example:
                data:
                  usersToBan:
                    cometchat-uid-6:
                      success: true
                  admins:
                    cometchat-uid-1:
                      success: true
                      data:
                        id: '32'
                        conversationId: group_project-group
                        sender: app_system
                        receiverType: group
                        receiver: project-group
                        category: action
                        type: groupMember
                        data:
                          action: added
                          entities:
                            by:
                              entity:
                                uid: app_system
                                name: System
                                role: default
                                status: offline
                                createdAt: 1596537299
                              entityType: user
                            'on':
                              entity:
                                uid: cometchat-uid-1
                                name: Andrew Joseph
                                role: default
                                avatar: >-
                                  https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp
                                status: offline
                                createdAt: 1596537299
                              entityType: user
                            for:
                              entity:
                                guid: project-group
                                icon: >-
                                  https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp
                                name: Project Group
                                tags:
                                  - friends
                                  - project
                                type: public
                                owner: cometchat-uid-2
                                createdAt: 1625460947
                                description: project related discussions between members
                                membersCount: 2
                                conversationId: group_project-group
                              entityType: group
                        sentAt: 1625460972
                        updatedAt: 1625460972
                  moderators:
                    cometchat-uid-3:
                      success: true
                      data:
                        id: '33'
                        conversationId: group_project-group
                        sender: app_system
                        receiverType: group
                        receiver: project-group
                        category: action
                        type: groupMember
                        data:
                          action: added
                          entities:
                            by:
                              entity:
                                uid: app_system
                                name: System
                                role: default
                                status: offline
                                createdAt: 1596537299
                              entityType: user
                            'on':
                              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: 1596537299
                                updatedAt: 1625234590
                              entityType: user
                            for:
                              entity:
                                guid: project-group
                                icon: >-
                                  https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp
                                name: Project Group
                                tags:
                                  - friends
                                  - project
                                type: public
                                owner: cometchat-uid-2
                                createdAt: 1625460947
                                updatedAt: 1625460972
                                description: project related discussions between members
                                membersCount: 3
                                conversationId: group_project-group
                              entityType: group
                        sentAt: 1625460973
                        updatedAt: 1625460973
                  participants:
                    cometchat-uid-4:
                      success: true
                      data:
                        id: '34'
                        conversationId: group_project-group
                        sender: app_system
                        receiverType: group
                        receiver: project-group
                        category: action
                        type: groupMember
                        data:
                          action: added
                          entities:
                            by:
                              entity:
                                uid: app_system
                                name: System
                                role: default
                                status: offline
                                createdAt: 1596537299
                              entityType: user
                            'on':
                              entity:
                                uid: cometchat-uid-4
                                name: Susan Marie
                                role: default
                                avatar: >-
                                  https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp
                                status: offline
                                createdAt: 1596537299
                              entityType: user
                            for:
                              entity:
                                guid: project-group
                                icon: >-
                                  https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp
                                name: Project Group
                                tags:
                                  - friends
                                  - project
                                type: public
                                owner: cometchat-uid-2
                                createdAt: 1625460947
                                updatedAt: 1625460973
                                description: project related discussions between members
                                membersCount: 4
                                conversationId: group_project-group
                              entityType: group
                        sentAt: 1625460973
                        updatedAt: 1625460973
                    cometchat-uid-5:
                      success: true
                      data:
                        id: '35'
                        conversationId: group_project-group
                        sender: app_system
                        receiverType: group
                        receiver: project-group
                        category: action
                        type: groupMember
                        data:
                          action: added
                          entities:
                            by:
                              entity:
                                uid: app_system
                                name: System
                                role: default
                                status: offline
                                createdAt: 1596537299
                              entityType: user
                            'on':
                              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: 1596537299
                              entityType: user
                            for:
                              entity:
                                guid: project-group
                                icon: >-
                                  https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp
                                name: Project Group
                                tags:
                                  - friends
                                  - project
                                type: public
                                owner: cometchat-uid-2
                                createdAt: 1625460947
                                updatedAt: 1625460973
                                description: project related discussions between members
                                membersCount: 5
                                conversationId: group_project-group
                              entityType: group
                        sentAt: 1625460973
                        updatedAt: 1625460973
      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

````