Skip to main content
POST
/
groups
Create
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/groups \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "guid": "<string>",
  "name": "<string>",
  "type": "public",
  "password": "<string>",
  "icon": "<string>",
  "description": "<string>",
  "metadata": {},
  "owner": "<string>",
  "tags": [
    "tag1"
  ],
  "members": {
    "admins": [],
    "moderators": [],
    "participants": [],
    "usersToBan": []
  }
}'
{
  "data": {
    "guid": "project-group",
    "name": "Project Group",
    "description": "project related discussions between members",
    "icon": "http://placehold.it/120x120&text=image1",
    "type": "public",
    "scope": "admin",
    "membersCount": 1,
    "joinedAt": 1638440784,
    "conversationId": "group_project-group",
    "hasJoined": true,
    "createdAt": 1638440784,
    "owner": "superhero4",
    "tags": [
      "friends",
      "project"
    ]
  }
}

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Headers

onBehalfOf
string

UID of the user on whose behalf the action is performed.

Body

application/json
guid
string
required

A unique identifier for a group.

name
string
required

Name of the group.

type
enum<string>
required

Type of the group. Can be public, password or private.

Available options:
public,
password,
private
password
string

A password required to join the the group with type password

icon
string

An URL for a group icon.

description
string

Description about the group

metadata
object

Additional data for the group.

owner
string

The UID that you wish to make owner of the group

tags
string[]

List of tags to identify specific groups.

members
object

Add members to a group with scope admins,moderators and participants.

Response

200 - application/json

Create Group

data
object
I