Skip to content

Edit Conversation



wss conversation_update

The conversation_update request allows you to edit the specified fields in the chat object.

NameTypeDescription
idstringConversation type
namestringConversation name
descriptionstringDescription of conversation
participants.addarray[string]Array of participant IDs who need to be added
participants.removearray[string]Array of participant IDs who need to be kicked
admins.addarray[string]Array of admin IDs who need to be added
admins.removearray[string]Array of admin IDs who need to be kicked
image_object.file_blur_hashstringBlur hash for chat image
image_object.file_namestringChat image name
image_object.file_idstringChat image file id
NameTypeDescription
conversationobjectUpdated Conversation object
{
"request": {
"conversation_update": {
"id": "currentConversationId",
"name": "NewName",
"description": "NewDescription",
"participants": {
"add": [ "63077ad836b78c3d82af0812", "63077ad836b78c3d82af0832" ],
"remove": [ "63077ad836b78c3d82af0816" ],
}
"admins": {
"add": ["63077ad836b78c3d82af0812"],
"remove": ["63077ad836b78c3d82af0816"]
}
},
"id": "RequestId"
}
}
{ "response": { "id": "RequestId", "conversation": { ... } } }

After adding users to a conversation, if they are online, they will receive the following event about the newly created conversation:

{
"system_message": {
"_id": "646e2092d80fe5c4e688dfa0",
"t": 15673838833,
"cid": "646e2092d80fe5c4e688dfa0",
"from": "63077ad836b78c3d82af0812",
"x": {
"conversation_updated": {
"_id": "646e2092d80fe5c4e688dfa0",
"type": "u",
"opponent_id": "646c823bf989c57fe910d289",
"participants": ["646c823bf989c57fe910d289"],
"owner_id": "646c82947b3aceab988c0073",
"created_at": "2023-05-24T14:34:58.066Z",
"updated_at": "2023-05-24T14:52:24.953Z"
}
}
}
}

The following message will also be sent to all users who are online and saved in the Message collection:

{
"_id": "655b479fe980b3e36f402234",
"body": "Sam Samuels has been added to the group",
"cid": "646e2092d80fe5c4e688dfa0",
"from": "646c82947b3aceab988c0073",
"status": "sent",
"t": 1700480927,
"x": {
"type": "added_participant",
"user": {
"_id": "64cb6b2def440b9c5bf18d6d",
"login": "sam1991",
"recent_activity": 1700149064,
"first_name": "Sam",
"last_name": "Samuelson",
"email": "DonateforUkraine@gmail.com"
}
},
"created_at": "2023-05-24T14:34:58.066Z"
}

After kicking users out of the conversation, if they are online, they will receive the following event:

{
"system_message": {
"_id": "646e2092d80fe5c4e688dfa0",
"t": 15673838833,
"cid": "646e2092d80fe5c4e688dfa0",
"from": "63077ad836b78c3d82af0812",
"x": {
"conversation_kicked": {
"_id": "646e2092d80fe5c4e688dfa0",
"type": "u",
"opponent_id": "646c823bf989c57fe910d289",
"participants": ["646c823bf989c57fe910d289"],
"owner_id": "646c82947b3aceab988c0073",
"created_at": "2023-05-24T14:34:58.066Z",
"updated_at": "2023-05-24T14:52:24.953Z"
}
}
}
}

The following message will also be sent to all users who are online and saved in the Message collection:

{
"_id": "655b479fe980b3e36f402234",
"body": "Lane Stark has been remove from the group",
"cid": "646e2092d80fe5c4e688dfa0",
"from": "646c82947b3aceab988c0073",
"status": "sent",
"t": 1700480927,
"x": {
"type": "removed_participant",
"user": {
"_id": "64cb6b2def440b9c5bf18d6d",
"login": "lane1991",
"recent_activity": 1700149064,
"first_name": "Lane",
"last_name": "Stark",
"email": "DonateforUkraine@gmail.com"
}
},
"created_at": "2023-05-24T14:34:58.066Z"
}