Working with Chats

TrueConfAbout 41 min

Working with Chats

Client Requests

Create a personal chat

Creating a personal chat (peer-to-peer) with a server user. If the bot has never messaged this user before, a new chat will be created. If the bot has previously sent messages to this user, the existing chat will be returned.

Request:

{
    "type": 1,
    "id": 1,
    "method": "createP2PChat",
    "payload": {
        "userId": "user@video.example.com"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesThe createP2PChat command
userIdstringYesTrueConf ID of the user with whom we want to start a chat

Response:

{
    "type": 2,
    "id": 1,
    "payload": {
        "chatId": "4a1f88f1070d2f43d385cde9ff61964bc6b74477"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
chatIdstringYesID of the created chat

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Create a group chat

Request:

{
    "type": 1,
    "id": 1,
    "method": "createGroupChat",
    "payload": {
        "name": "TrueConf Server Administrators’ Chat"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand createGroupChat
titlestringYesGroup Chat Name

Response:

{
    "type": 2,
    "id": 1,
    "payload": {
        "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
chatIdstringYesIdentifier of the created group chat

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Create channel

Request:

{
    "type": 1,
    "id": 1,
    "method": "createChannel",
    "payload": {
        "title": "Company news"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand createChannel
titlestringYesChannel Name

Response:

{
    "type": 2,
    "id": 1,
    "payload": {
        "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
chatIdstringYesIdentifier of the created channel

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Create "Favorites" Chat 5.5.2+

Request:

{
    "type": 1,
    "id": 1,
    "method": "createFavoritesChat",
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesThe createFavoritesChat command

Response:

{
    "type": 2,
    "id": 1,
    "payload": {
        "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
chatIdstringYesIdentifier of the created "Favorites" chat

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Edit the chat name 5.5.3+

Request:

{
    "type": 1,
    "id": 1,
    "method": "editChatTitle",
    "payload": {
      "chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
      "title": "New title"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand editChatTitle
chatIdstringYesIdentifier of the chat being renamed
titlestringYesNew chat name

Response:

{
    "type": 2,
    "id": 2,
    "payload": {
        "chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
        "timestamp": 1765115572804
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
chatIdstringYesChat ID with the changed name
timestampuint64YesTimestamp for the chat name change in UNIX timestamp format with millisecond precision

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Edit chat image 5.5.3+

Request:

{
    "type": 1,
    "id": 1,
    "method": "editChatAvatar",
    "payload": {
      "chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
      "temporalFileId": "8157ea50-fd9e-4b27-bb93-d9045bc65c48"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand editChatAvatar
chatIdstringYesIdentifier of the chat being renamed
temporalFileIdstringYesThe identifier of the file uploaded to the server. To delete the image, set to null.

Clear chat history 5.5.3+

Deleting all messages from the specified chat (private, group, or channel).

Request:

{
  "type": 1,
  "id": 1,
  "method": "clearHistory",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "forAll": false
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand clearHistory
chatIdstringYesChat ID whose history will be cleared
forAllboolNoBy default — false. If true, the chat will be cleared for everyone. In group chats and channels, permissions must be granted to perform this action.

Response:

{
  "type": 2,
  "id": 1,
  "payload": {}
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Delete chat

Deletes the specified chat (personal, group, or channel). After deletion, the chat will be unavailable to all participants.

Request:

{
  "type": 1,
  "id": 1,
  "method": "removeChat",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256"
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand removeChat
chatIdstringYesIdentifier of the chat to be deleted

Response:

{
  "type": 2,
  "id": 1,
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256"
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
chatIdstringYesRemote chat ID

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Add participant to chat

Adds a user to a group chat or channel. Appropriate permissions are required to perform this operation.

Request:

{
  "type": 1,
  "id": 1,
  "method": "addChatParticipant",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "userId": "user@video.example.com",
    "displayHistory": false
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand addChatParticipant
chatIdstringYesChat ID where the user is added
userIdstringYesTrueConf ID of the user being added to the chat
displayHistoryboolNo5.5.3+ Chat history display flag. If true, the user will see previous messages.

Response:

{
  "type": 2,
  "id": 1,
  "payload": {}
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
payloadobjectYesIn case of success, you will receive an empty object.

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Remove chat participant

Removes the specified participant from the chat. This can only be used in group chats and channels. Appropriate permissions are required to perform this operation.

Request:

{
  "type": 1,
  "id": 1,
  "method": "removeChatParticipant",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "userId": "user@video.example.com",
    "clearHistory" : false
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand removeChatParticipant
chatIdstringYesChat ID from which the user is being removed
userIdstringYesTrueConf ID of the user to be deleted
clearHistoryboolNo5.5.3+ If true, the chat will be cleared when the participant is removed. By default, it is false.

Response:

{
  "type": 2,
  "id": 1,
  "payload": {}
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
payloadobjectYesIn case of success, you will receive an empty object.

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Change participant role 5.5.2+

Allows you to change the role of a chat participant. To change a role, you must have the appropriate permission. You will also receive a notification when the role is changed for any chat participant.

Request:

{
    "type": 1,
    "id": 1,
    "method": "changeParticipantRole",
    "payload": {
        "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054",
        "userId": "user@video.example.com",
        "role": "admin"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand changeParticipantRole
chatIdstringYesChat ID
userIdstringYesTrueConf ID of the user whose role is being changed
rolestringYesNew user role

Response:

{
  "type": 2,
  "id": 1,
  "payload": {}
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
payloadobjectYesIn case of success, you will receive an empty object.

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Get chat information

Returns detailed data about the chat by its ID.

Request:

{
    "type": 1,
    "id": 1,
    "method": "getChatByID",
    "payload": {
        "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand getChatByID
chatIdstringYesChat ID

Response:

```json
{
    "type": 2,
    "id": 1,
    "payload": {
        "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054",
        "title": "TrueConf Server Administrators’ Chat",
        "chatType": 2,
        "avatarUrl": "",
        "unreadMessages": 0,
        "lastMessage": {
            "messageId": "267d61f2-2ba1-4e88-83ab-bb84415f31b6",
            "timestamp": 1746028006345,
            "author": {
                "id": "brown@video.example.com",
                "type": 1
            },
            "type": 200,
            "content": {
                "text": "What's up?",
                "parseMode": "html"
            }
        }
    }
}

| Parameter | Type | Mandatory | Description |
| ----- | :-----: | :-----: | ----- |
| **type** | *uint32* | Yes | Message type (default is `2`). Corresponds to [MESSAGE_TYPE.RESPONSE](../objects/#enum-message-type) |
| **id** | *uint32* | Yes | An identifier matching the number sent in the original request, used to link the request and response. |
| **chatId** | *string* | Yes | Chat ID |
| **title** | *string* | Yes | Chat name |
| **chatType** | *ChatTypeEnum* | Yes | Chat type |
| **unreadMessages** | *uint32* | Yes | Number of unread messages in the chat |
| **lastMessage** | *Envelope* | Yes | Last message in chat |

::: tip <const name="empty-title"/>

The `lastMessage` field follows the Envelope format, except that it does not include the `chatId`, `isEdited`, and `box` fields.

:::

::: warning <const name="empty-title"/>

In the event of an error, a message containing the `errorCode` parameter is returned. A list of possible values is available in the [corresponding section of the documentation](../errors/#errorCode).

:::

### Get chat list {#getChats}

Returns a list of all chats that the current user is a member of.

**Request:**

```json
{
    "type": 1,
    "id": 1,
    "method": "getChats",
    "payload": {
        "count": 10,
        "page": 1
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand getChats
countuint32YesMaximum number of chat objects in response
Pageuint32YesPage number of the request (paging). Starts from 1

Response:

{
    "type": 2,
    "id": 1,
    "payload": [
        {
            "chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054",
            "title": "TrueConf Server Administrators’ Chat",
            "chatType": 2,
            "unreadMessages": 0,
            "lastMessage": {
                "messageId": "267d61f2-2ba1-4e88-83ab-bb84415f31b6",
                "timestamp": 1746028006345,
                "author": {
                    "id": "brown@video.example.com",
                    "type": 1
                },
                "type": 200,
                "content": {
                    "text": "What's up?",
                    "parseMode": "html"
                }
            }
        },
        {
            "chatId": "4a1f88f1070d2f43d385cde9ff61964bc6b74477",
            "title": "chester@video.example.com",
            "chatType": 1,
            "unreadMessages": 1,
            "lastMessage": {
                "messageId": "d4f756a2-8dd1-4cce-af7c-5a4311af0c79",
                "timestamp": 1746028006690,
                "author": {
                    "id": "chester@video.example.com",
                    "type": 1
                },
                "type": 200,
                "content": {
                    "text": "Hello!",
                    "parseMode": "html"
                }
            }
        },
        {
            "chatId": "5abba630dd1089090ba41c69c7aa34e4ba277a43",
            "title": "Project Announcements",
            "chatType": 6,
            "unreadMessages": 1,
            "lastMessage": {
                "messageId": "267d61f2-2ba1-4e88-83ab-bb84415f31b6",
                "timestamp": 1746028006345,
                "author": {
                    "id": "brown@video.example.com",
                    "type": 1
                },
                "type": 200,
                "content": {
                    "text": "Hello everyone!",
                    "parseMode": "html"
                }
            }
        }
    ]
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
payloadArrayYesUser chat array

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Get chat participant 5.5.3+

Returns a participant of the specified chat, including their role and type.

Request:

{
  "type": 1,
  "id": 1,
  "method": "getChatParticipant",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "userId": "user@video.example.com",

  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand getChatParticipant
chatIdstringYesChat ID
userIdstringYesTrueConf ID of the requested user

Response:

{
  "type": 2,
  "id": 1,
  "payload": {
    "userId": "user@video.example.com",
    "role": "user",
    "type": 1
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
userIdstringYesTrueConf ID of the user
rolestringYesUser role (see description)
typeuint32YesUser type (see description)

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Get chat participants

Returns a list of all participants in the specified chat, including their role and type.

Request:

{
  "type": 1,
  "id": 1,
  "method": "getChatParticipants",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "pageSize": 100,
    "pageNumber": 1
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand getChatParticipants
chatIdstringYesChat ID
pageSizeuint32YesNumber of records with information about chat participants in the response to the request
pageNumberuint32YesThe offset at which the participant list will be returned. It is calculated using the formula startOffset = pageSize * pageNumber.

Response:

{
  "type": 2,
  "id": 1,
  "payload": {
    "participants": [
      {
        "userId": "user@video.example.com",
        "role": "user",
        "type": 1
      },
      {
        "userId": "admin@video.example.com",
        "role": "admin",
        "type": 1
      }
    ]
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
participantsArrayYesList of chat participants, presented as ChatParticipant objects

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Check participant in chat Deprecated in 5.5.3+

Use the getChatParticipant request.

Request:

{
  "type": 1,
  "id": 1,
  "method": "hasChatParticipant",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "userId": "user@video.example.com"
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesThe hasChatParticipant command
chatIdstringYesChat ID where the user's presence is checked
userIdstringYesTrueConf ID of the user being verified

Response:

{
  "type": 2,
  "id": 1,
  "payload": {
    "result": true
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesAn identifier matching the number sent in the original request, used to link the request and response.
resultbooleanYesFlag indicating the presence of a participant in the chat. If true — the participant is present in the chat.

In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the corresponding section of the documentation.

Server Notifications

For each server notification (request), the client should respond as follows:

{
    "type": 2,
    "id": 123456
}

Once the response is sent, the user’s message is marked as read by the bot and a check mark appears in the TrueConf client application.

Personal chat created

The server notifies about the creation of a personal (peer-to-peer) chat involving only two users. The notification is sent when another user initiates the creation of such a chat with the current user.

Notification from the server:

{
    "method": "createP2PChat",
    "type": 1,
    "id": 2,
    "payload": {
        "chatId": "bd05af54347e04a1c44e70033d35834d4428bb5d",
        "title": "brown@video.example.com",
        "chatType": 1,
        "lastMessage": {
            "chatId": "bd05af54347e04a1c44e70033d35834d4428bb5d",
            "messageId": "d8bdd362-2656-46ff-a1db-8dadd2b76250",
            "timestamp": 1746028006345,
            "author": {
                "id": "brown@video.example.com",
                "type": 1
            },
            "type": 200,
            "content": {
                "text": "What's up?",
                "parseMode": "text"
            }
        },
        "unreadMessages": 1
    }
}
ParameterTypeMandatoryDescription
methodstringYesThe createP2PChat command
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incrementable value assigned by the sender. Read more here.
chatIdstringYesID of the created chat
titlestringYesthe user who created the chat
chatTypeuint32YesType of the created chat. Corresponds to ChatTypeEnum
lastMessage.chatIdstringYesChat ID where the message is located
messageIdstringYesMessage ID. It can be used later for modifying, forwarding, or deleting the message.
timestampuint64YesTimestamp of message sent in UNIX timestamp format with millisecond precision
author.idstringYesUnique identifier of the message author (TrueConf ID or server name)
author.typeuint32YesMessage author type. See EnvelopeAuthorTypeEnum
lastMessage.typeuint32YesMessage type corresponds to EnvelopeContentType
textstringNoMessage text
parseModestringNoFormatting mode (more details)
unreadMessagesuint32YesNumber of unread messages in personal chat

The payload.lastMessage.content field varies depending on the payload.lastMessage.type of the message.

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Group chat created

The server notifies about the creation of a group chat in which the current user has been added. You can find a description of the group chat participants' rights here.

Notification from the server:

{
    "method": "createGroupChat",
    "type": 1,
    "id": 14,
    "payload": {
        "chatId": "08d5dbda94a9de4b7554e3b4355307f9e97ffdb7",
        "title": "Marketing",
        "chatType": 2,
        "lastMessage": {
            "chatId": "08d5dbda94a9de4b7554e3b4355307f9e97ffdb7",
            "messageId": "cccea4a7-24b4-4b2c-8c50-67d01bce17bf",
            "timestamp": 1746029638147,
            "author": {
                "id": "user@video.example.com",
                "type": 0
            },
            "type": 110,
            "content": {
                "userId": "bot@video.example.com",
                "role": "user"
            }
        },
        "unreadMessages": 2
    }
}
ParameterTypeMandatoryDescription
methodstringYesCommand createGroupChat
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
chatIdstringYesID of the created chat
titlestringYesName of the created chat
chatTypeuint32YesType of the created chat. Corresponds to ChatTypeEnum
lastMessage.chatIdstringYesChat ID where the message is located
messageIdstringYesMessage ID. Can be used for modification, forwarding, or deletion.
timestampuint64YesA timestamp in the UNIX timestamp format, accurate to milliseconds
author.idstringYesTrueConf ID of the message author or the server name
author.typeuint32YesAuthor type. See EnvelopeAuthorTypeEnum
lastMessage.typeuint32YesMessage type. See EnvelopeContentType
userIdstringNoTrueConf ID of the user who sent the message
rolestringNoUser role in chat (see more)
unreadMessagesuint32YesNumber of unread messages in the group chat

The payload.lastMessage.content field varies depending on the payload.lastMessage.type of the message.

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Channel created

The server notifies about the creation of a channel to which the current user has been added. You can find a description of the channel participants' permissions here.

Notification from the server:

{
    "method": "createChannel",
    "type": 1,
    "id": 14,
    "payload": {
        "chatId": "08d5dbda94a9de4b7554e3b4355307f9e97ffdb7",
        "title": "Important Announcements",
        "chatType": 6,
        "lastMessage": {
            "chatId": "08d5dbda94a9de4b7554e3b4355307f9e97ffdb7",
            "messageId": "cccea4a7-24b4-4b2c-8c50-67d01bce17bf",
            "timestamp": 1746029638147,
            "author": {
                "id": "user@video.example.com",
                "type": 0
            },
            "type": 110,
            "content": {
                "userId": "bot@video.example.com",
                "role": "user"
            }
        },
        "unreadMessages": 2
    }
}
ParameterTypeMandatoryDescription
methodstringYesCommand createChannel
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
chatIdstringYesIdentifier of the created channel
titlestringYesName of the created channel
chatTypeuint32YesType of the created channel. Corresponds to ChatTypeEnum = 6
lastMessage.chatIdstringYesChannel ID where the message is located
messageIdstringYesMessage ID. This identifier can be used later to modify, forward, or delete the message.
timestampuint64YesTimestamp of message sent in UNIX timestamp format with millisecond precision
author.idstringYesUnique identifier of the message author. This can either be the TrueConf ID of the user or the name of the server from which the message was sent. The type of identifier depends on the type field.
author.typeuint32YesMessage author type. For more details, see EnvelopeAuthorTypeEnum.
lastMessage.typeuint32YesMessage type. Allows you to determine the type of content in the message. Corresponds to EnvelopeContentType
userIdstringNoTrueConf ID of the user who sent the message
rolestringNoUser role in group chat (see details)
unreadMessagesuint32YesNumber of unread messages in the channel

The payload.lastMessage.content field varies depending on the payload.lastMessage.type of the message.

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Favorites chat "5.5.2+" created

The server notifies about the creation of the "Favorites" chat.

Notification from the server:

{
    "method": "createFavoritesChat",
    "type": 1,
    "id": 1,
    "payload": {
        "chatId": "b7d0e9b76dd414cce07d6895682455814fa4bfd1",
        "title": null,
        "chatType": 5,
        "lastMessage": null,
        "unreadMessages": 0
    }
}
ParameterTypeMandatoryDescription
methodstringYesThe createFavoritesChat command
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
chatIdstringYesIdentifier of the created "Favorites" chat
titleYesBy default null
chatTypeuint32YesType of the created chat. Corresponds to ChatTypeEnum = 5
lastMessageYesBy default null
unreadMessagesuint32YesBy default, 0

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Chat name changed 5.5.3+

Notification from the server:

{   
    "method": "editChatTitle",
    "type": 1,
    "id": 1,
    "payload": {
      "chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
      "title": "New title"
    }
}
ParameterTypeMandatoryDescription
methodstringYesCommand editChatTitle
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
chatIdstringYesRenamed chat ID
titlestringYesNew chat name

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Chat image changed 5.5.3+

Notification from the server:

{
    "method": "editChatAvatar",
    "type": 1,
    "id": 12,
    "payload": {
        "chatId": "af9d5017f77a5bb81628e123e1061e49dfa29f80",
        "avatarUrl": "http://10.110.2.241/bridge/api/client/v1/message/123657c5-1b4f-4416-ae97-fbbc5b5b522d/preview"
    }
}
ParameterTypeMandatoryDescription
methodstringYesCommand editChatAvatar
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
chatIdstringYesChat ID for which the image has been changed.
avatarUrlstringYesNew chat image. If null, it means the image is missing (deleted).

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Chat history 5.5.3+ cleared

Notification from the server:

{
  "type": 1,
  "id": 1,
  "method": "clearHistory",
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "forAll": false
  }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand clearHistory
chatIdstringYesChat ID whose history was cleared
forAllboolNoIf true, the chat has been cleared for everyone.

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Chat removed

The server notifies about the deletion of a chat in which the current user was previously a participant. This can be a personal (peer-to-peer) chat, group chat, or channel.

Notification from the server:

{
    "method": "removeChat",
    "type": 1,
    "id": 1,
    "payload": {
        "chatId": "84960c6d80afa729b0fd42d35331de5814cc3e9a"
    }
}
ParameterTypeMandatoryDescription
methodstringYesCommand removeChat
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incrementing value assigned by the sender. Read more here
chatIdstringYesRemote chat ID

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Participant added to chat

The server sends a notification when a new participant is added to a group chat or channel.

Notification from the server:

{   
    "method": "addChatParticipant",
    "type": 1,
    "id": 1,
    "payload": {
        "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
        "userId": "user@video.example.com",
        "userRole": "owner",
        "addedBy": {
            "id": "admin@video.example.com",
            "type": 1
        },
        "timestamp": "1735370776"
    }
}
ParameterTypeMandatoryDescription
methodstringYesCommand addChatParticipant
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incrementing value assigned by the sender. Read more here
chatIdstringYesChat ID where the user was added
userIdstringYesTrueConf ID of the user who was added to the chat
userRolestringYes5.5.2+ Role of the user who added a participant to the chat
addedBy.idstringYesUnique identifier of the user who added a new participant. This can be a TrueConf ID or a server name, depending on addedBy.type.
addedBy.typeuint32YesThe type of user who added a new participant. See EnvelopeAuthorTypeEnum
timestampuint64YesTimestamp of adding a participant to the chat in UNIX timestamp format (in milliseconds)

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Removed chat participant

The server sends a notification when a participant has been removed from a group chat or channel.

Notification from the server:

{
  "method": "removedChatParticipant",
  "type": 1,
  "id": 1,
  "payload": {
    "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
    "userId": "user@video.example.com",
    "removedBy": {
      "id": "admin@video.example.com",
      "type": 1
    },
    "timestamp": "1735370778"
  }
}
ParameterTypeMandatoryDescription
methodstringYesCommand removeChatParticipant
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
chatIdstringYesChat ID where the user was removed
userIdstringYesTrueConf ID of the user who was removed from the chat
removedBy.idstringYesUnique identifier of the user who removed a participant from the chat. This is either a TrueConf ID or the name of the server from which the message was received. The type of identifier depends on the removedBy.type field.
removedBy.typeuint32YesThe type of user who removed a participant from the chat. For more details, see EnvelopeAuthorTypeEnum.
timestampuint64YesTimestamp of participant removal from chat in UNIX timestamp format with millisecond precision.

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)

Participant role changed 5.5.2+

The server sends a notification when a chat participant's role has changed.

Request:

{
    "type": 1,
    "id": 1,
    "method": "changeParticipantRole",
    "payload": {
        "chatId": "7e5ea3e8b5ed63e1443b2e4dcdd68b9f196abae1",
        "userId": "user@video.example.com",
        "role": "admin",
        "timestamp": 1760594447544
    }
}
ParameterTypeMandatoryDescription
typeuint32YesMessage type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST
iduint32YesUnique request identifier. An incremental value assigned by the sender, required in each request for subsequent association with the response. Read more here.
methodstringYesCommand changeParticipantRole
chatIdstringYesChat ID
userIdstringYesTrueConf ID of the user whose role has changed
rolestringYesNew user role
timestampuint64YesTimestamp of the chat participant role change in UNIX timestamp format with millisecond precision.

Response from client:

{
    "type": 2,
    "id": 123456
}
FieldTypeMandatoryDescription
typeuint32YesMessage type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE
iduint32YesMessage ID being replied to (see more)