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

> The CometChat group member import API allows customers to import their group members’ data into the CometChat systems.

# Import Group Members

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


## OpenAPI

````yaml post /data_import/members
openapi: 3.0.0
info:
  title: Data Import 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: Push Notifications
    description: Allows configuring Push Notifications.
paths:
  /data_import/members:
    post:
      tags:
        - Groups
      summary: Import Group Members
      description: >-
        The CometChat group member import API allows customers to import their
        group members’ data into the CometChat systems.
      operationId: import-members
      requestBody:
        content:
          application/json:
            schema:
              properties:
                members:
                  description: Wrapper for the members.
                  required:
                    - memberId
                  properties:
                    <guid>_member_<uid>:
                      description: >-
                        Wraps a single member object. The
                        <b>&lt;guid&gt;&#95member&#95&lt;uid&gt;</b> will will
                        be a primary key/unique Identifier of the member.
                      required:
                        - memberId
                        - guid
                        - uid
                      properties:
                        memberId:
                          description: >-
                            The value should be the same as value of the
                            placeholder
                            <b>&lt;guid&gt;&#95member&#95&lt;uid&gt;</b> which
                            wraps the member object.
                          type: string
                        guid:
                          description: Id of the group.
                          type: string
                        uid:
                          description: Id of user.
                          type: string
                        scope:
                          description: Scope of the member in group.
                          type: string
                        isBanned:
                          description: Specify if user is banned in group.
                          type: boolean
                        joinedAt:
                          description: ' A 10-digit UNIX timestamp at which the member joined the group.'
                          type: integer
                        groupDetails:
                          description: >-
                            The JSON object contains the group details of the
                            member.
                          required:
                            - guid
                            - name
                            - type
                          properties:
                            guid:
                              description: The primary-key/ unique identifier of the group.
                              type: string
                            name:
                              description: Name of the group.
                              type: string
                            icon:
                              description: An URL for a group icon.
                              type: string
                            type:
                              description: >-
                                Type of the group. Can be public, password or
                                private.
                              type: string
                              enum:
                                - public
                                - password
                                - private
                            password:
                              description: >-
                                A password required to join the the group with
                                type password
                              type: string
                            owner:
                              description: Owner of the group.
                              type: string
                            createdAt:
                              description: ' A 10-digit UNIX timestamp at which the group was created.'
                              type: integer
                            metadata:
                              description: Additional data for the group.
                              type: object
                            tags:
                              description: A string array containing grouptags.
                              type: array
                              items:
                                type: string
                              default: []
                          type: object
                        userDetails:
                          description: >-
                            The JSON object contains the user details of the
                            member.
                          required:
                            - uid
                            - name
                          properties:
                            uid:
                              description: >-
                                The primary-key/ unique identifier of the
                                member.
                              type: string
                            name:
                              description: Name of the member.
                              type: string
                            avatar:
                              description: URL to the profile picture of the member.
                              type: string
                            link:
                              description: Profile page URL of the user.
                              type: string
                            role:
                              description: >-
                                Role of the user. Should be created already via
                                the Create role API.
                              type: string
                            createdAt:
                              description: >-
                                A 10-digit timestamp at which the member was
                                created.
                              type: integer
                            lastActiveAt:
                              description: >-
                                A 10-digit UNIX timestamp at which the member
                                was most recently online.
                              type: integer
                            metadata:
                              description: >-
                                JSON object containing Additional member
                                information.
                              type: object
                            tags:
                              description: A string array containing member tags.
                              type: array
                              items:
                                type: string
                              default: []
                            deactivatedAt:
                              description: >-
                                A 10-digit UNIX timestamp at which the member
                                was deactivated/soft-deleted/blocked to use the
                                chat services.
                              type: integer
                          type: object
                      type: object
                  type: object
                  example:
                    guid1_member_uid2:
                      memberId: guid1_member_uid2
                      uid: uid2
                      guid: guid1
                      joinedAt: '1673421419'
                      scope: admin
                      groupDetails:
                        guid: guid1
                        name: guid1
                        type: public
                        owner: uid1
                        createdAt: '1673421419'
                      userDetails:
                        uid: uid2
                        name: uid2
              type: object
      responses:
        '200':
          description: Import Group Member(s)
          content:
            application/json:
              schema:
                properties:
                  data:
                    properties:
                      <memberId>:
                        type: object
                        allOf:
                          - $ref: '#/components/schemas/groupMemberSchema'
                    type: object
                type: object
              example:
                data:
                  guid1_member_uid2:
                    success: true
                    data:
                      guid: guid1
                      uid: uid2
                      scope: admin
                      joinedAt: 1673421419
      security:
        - apiKey: []
components:
  schemas:
    groupMemberSchema:
      description: Response data
      properties:
        usersToBan:
          properties:
            <uid>:
              properties:
                success:
                  type: boolean
              type: object
          type: object
        admins:
          properties:
            <uid>:
              properties:
                success:
                  type: boolean
                data:
                  type: object
              type: object
          type: object
        moderators:
          properties:
            <uid>:
              properties:
                success:
                  type: boolean
                data:
                  type: object
              type: object
          type: object
        participants:
          properties:
            <uid>:
              properties:
                success:
                  type: boolean
                data:
                  type: object
              type: object
          type: object
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````