> ## 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 import API allows customers to import their groups’ data into the CometChat systems.

# Import Groups

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


## OpenAPI

````yaml post /data_import/groups
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/groups:
    post:
      tags:
        - Groups
      summary: Import Groups
      description: >-
        The CometChat group import API allows customers to import their groups’
        data into the CometChat systems.
      operationId: import-groups
      requestBody:
        content:
          application/json:
            schema:
              properties:
                groups:
                  description: Wrapper for the groups.
                  required:
                    - guid
                  properties:
                    <guid>:
                      description: >-
                        Wraps a group object. The <b>&lt;guid&gt;</b> will be a
                        primary key/unique Identifier of the group.
                      required:
                        - guid
                        - name
                        - type
                      properties:
                        guid:
                          description: >-
                            The value should be the same as value of the
                            placeholder <b>&lt;guid&gt;</b> which wraps the
                            group object.
                          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: []
                        groupOwnerDetails:
                          description: >-
                            The JSON object contains the user details of the
                            owner.
                          required:
                            - uid
                            - name
                          properties:
                            uid:
                              description: The primary-key/ unique identifier of the owner.
                              type: string
                            name:
                              description: Name of the owner.
                              type: string
                            avatar:
                              description: URL to the profile picture of the owner.
                              type: string
                            link:
                              description: Profile page URL of the owner.
                              type: string
                            role:
                              description: >-
                                Role of the owner. Should be created already via
                                the Create role API.
                              type: string
                            createdAt:
                              description: >-
                                A 10-digit timestamp at which the owner was
                                created.
                              type: integer
                            lastActiveAt:
                              description: >-
                                A 10-digit UNIX timestamp at which the owner was
                                most recently online.
                              type: integer
                            metadata:
                              description: Additional details about the owner.
                              type: object
                            tags:
                              description: A string array containing owner tags.
                              type: array
                              items:
                                type: string
                              default: []
                            deactivatedAt:
                              description: >-
                                A 10-digit UNIX timestamp at which the owner was
                                deactivated/soft-deleted/blocked to use the chat
                                services.
                              type: integer
                          type: object
                      type: object
                  type: object
                  example:
                    guid1:
                      guid: guid1
                      name: guid1
                      createdAt: '1673421419'
                      type: public
                      owner: cometchat-uid-1
                      groupOwnerDetails:
                        uid: cometchat-uid-1
                        name: cometchat-uid-1
              type: object
      responses:
        '200':
          description: Import Group(s)
          content:
            application/json:
              schema:
                properties:
                  data:
                    properties:
                      <guid>:
                        type: object
                        allOf:
                          - $ref: '#/components/schemas/groupSchema'
                    type: object
                type: object
              example:
                data:
                  guid1:
                    success: true
                    data:
                      guid: guid1
                      name: guid1
                      type: public
                      conversationId: group_guid1
                      createdAt: 1673421419
                      owner: cometchat-uid-1
      security:
        - apiKey: []
components:
  schemas:
    groupSchema:
      description: Response data
      properties:
        guid:
          type: string
        name:
          type: string
        description:
          type: string
        icon:
          type: string
        type:
          type: string
        scope:
          type: string
        membersCount:
          type: integer
        joinedAt:
          type: integer
        conversationId:
          type: string
        hasJoined:
          type: boolean
        owner:
          type: string
        tags:
          type: array
          items:
            type: string
        createdAt:
          type: integer
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````