💬 Chat App
Create a group chat
This API endpoint enables a logged-in user to initiate the creation of a group chat, bringing together multiple participants to engage in collaborative discussions.
To establish a group, a minimum of three participants is required.
This endpoint streamlines the process of forming dynamic group conversations, fostering enriched interactions among users within the chat application.
post/chat-app/chats/group
Request body
Example request
{
"name": "My first group",
"participants": [
"64c940d8ffe6c671f4d049d0",
"64c940d8ffe6c671f4d049cd"
]
}Response
Create a group chat
Example response
{
"data": {
"_id": "64ca9e166cabe93cce077e0a",
"admin": "64ca18038155dc11e68dfe83",
"createdAt": "2023-08-02T18:19:02.958Z",
"isGroupChat": true,
"name": "My first group",
"participants": [
{
"__v": 0,
"_id": "64c940d8ffe6c671f4d049cd",
"avatar": {
"_id": "64c940d8ffe6c671f4d049ce",
"localPath": "",
"url": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/601.jpg"
},
"createdAt": "2023-08-01T17:28:56.322Z",
"email": "vallie.tremblay15@hotmail.com",
"isEmailVerified": true,
"loginType": "EMAIL_PASSWORD",
"role": "ADMIN",
"updatedAt": "2023-08-01T19:00:03.310Z",
"username": "baylee_mante"
},
{
"__v": 0,
"_id": "64c940d8ffe6c671f4d049d0",
"avatar": {
"_id": "64c940d8ffe6c671f4d049d1",
"localPath": "",
"url": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1247.jpg"
},
"createdAt": "2023-08-01T17:28:56.322Z",
"email": "vanessa_ondricka81@hotmail.com",
"isEmailVerified": true,
"loginType": "EMAIL_PASSWORD",
"role": "USER",
"updatedAt": "2023-08-01T19:00:13.101Z",
"username": "walton_halvorson"
},
{
"__v": 0,
"_id": "64ca18038155dc11e68dfe83",
"avatar": {
"_id": "64ca18038155dc11e68dfe82",
"localPath": "",
"url": "https://via.placeholder.com/200x200.png"
},
"createdAt": "2023-08-02T08:46:59.711Z",
"email": "john.doe@gmail.com",
"isEmailVerified": false,
"loginType": "EMAIL_PASSWORD",
"role": "ADMIN",
"updatedAt": "2023-08-02T17:35:38.049Z",
"username": "doejohn"
}
],
"updatedAt": "2023-08-02T18:19:02.958Z"
},
"message": "Group chat created successfully",
"statusCode": 201,
"success": true
}