Skip to main content
POST
/
api
/
v1
/
chats
Create a new group chat
curl --request POST \
  --url http://localhost:{port}/api/v1/chats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "participants": [
    {
      "phoneNumber": "<string>",
      "role": "member"
    }
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "isGroup": true,
  "unreadCount": 123,
  "timestamp": 123,
  "pinned": true,
  "muted": true,
  "archived": true
}

Authorizations

Authorization
string
header
required

JWT token authentication

Body

application/json
name
string
required

Name of the group to create

participants
object[]
required

List of participants to add to the group, with optional roles

Minimum length: 1
description
string

Description of the group (optional)

Response

The group chat has been successfully created

id
string
required

Chat ID

name
string
required

Chat name

isGroup
boolean
required

Whether the chat is a group

unreadCount
integer

Number of unread messages

timestamp
number

Timestamp of the last message

pinned
boolean

Whether the chat is pinned

muted
boolean

Whether the chat is muted

archived
boolean

Whether the chat is archived