# Working with Chats
# Client requests
# Create 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"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. Incremental value assigned by the sender, required in each request for subsequent linking with the response. Read more here |
| method | string | Yes | Command createP2PChat |
| userId | string | Yes | TrueConf ID of the user with whom we want to create a chat |
Response:
{
"type": 2,
"id": 1,
"payload": {
"chatId": "4a1f88f1070d2f43d385cde9ff61964bc6b74477"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to associate the request and response |
| chatId | string | Yes | Identifier 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 relevant section of the documentation.
# Create a group chat
Request:
{
"type": 1,
"id": 1,
"method": "createGroupChat",
"payload": {
"name": "TrueConf Server Administrators’ Chat"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request for subsequent association with the response. Read more here |
| method | string | Yes | Command createGroupChat |
| name | string | Yes | Name of the group chat |
Response:
{
"type": 2,
"id": 1,
"payload": {
"chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to link the request and response |
| chatId | string | Yes | The identifier 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 relevant section of the documentation.
# Create channel
Request:
{
"type": 1,
"id": 1,
"method": "createChannel",
"payload": {
"title": "Company news"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request for subsequent matching with the response. Read more here |
| method | string | Yes | The command createChannel |
| title | string | Yes | Channel name |
Response:
{
"type": 2,
"id": 1,
"payload": {
"chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier that matches the number sent in the original request, used for linking the request and response |
| chatId | string | Yes | Identifier 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 relevant section of the documentation.
# Create "Favorites" chat
5.5.2+
Request:
{
"type": 1,
"id": 1,
"method": "createFavoritesChat",
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, mandatory in each request for subsequent linking to a response. Read more here |
| method | string | Yes | Command createFavoritesChat |
Response:
{
"type": 2,
"id": 1,
"payload": {
"chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to link the request and response |
| chatId | string | Yes | Identifier 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 relevant section of the documentation.
# Change chat name
5.5.3+
Request:
{
"type": 1,
"id": 1,
"method": "editChatTitle",
"payload": {
"chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
"title": "New title"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, mandatory in each request for subsequent binding with the response. Read more here |
| method | string | Yes | Command editChatTitle |
| chatId | string | Yes | Identifier of the chat being renamed |
| title | string | Yes | New chat title |
Response:
{
"type": 2,
"id": 2,
"payload": {
"chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
"timestamp": 1765115572804
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier matching the number sent in the original request, used for linking request and response |
| chatId | string | Yes | Identifier of the chat whose name was changed |
| timestamp | uint64 | Yes | Timestamp of 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 relevant section of the documentation.
# Change chat image
5.5.3+
Request:
{
"type": 1,
"id": 1,
"method": "editChatAvatar",
"payload": {
"chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
"temporalFileId": "8157ea50-fd9e-4b27-bb93-d9045bc65c48"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request to link it to the response. Read more here |
| method | string | Yes | Command editChatAvatar |
| chatId | string | Yes | Identifier of the chat being renamed |
| temporalFileId | string | Yes | Identifier of the uploaded file on the server. To delete the image, set to null |
# Clear chat history
5.5.3+ Delete all messages from a specified chat (personal, group, or channel).
Request:
{
"type": 1,
"id": 1,
"method": "clearHistory",
"payload": {
"chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
"forAll": false
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incremented value assigned by the sender, required in each request for subsequent binding with the response. Read more here |
| method | string | Yes | Command clearHistory |
| chatId | string | Yes | The identifier of the chat whose history will be cleared |
| forAll | bool | No | Default is 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": {}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | 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 relevant 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"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incremented value assigned by the sender, required in each request for subsequent linkage with the response. Read more here |
| method | string | Yes | Command removeChat |
| chatId | string | Yes | Identifier of the chat to be removed |
Response:
{
"type": 2,
"id": 1,
"payload": {
"chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier matching the number sent in the original request, used to link the request and response |
| chatId | string | Yes | Remote chat identifier |
In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the relevant section of the documentation.
# Add participant to chat
Adds a user to a group chat or channel. The operation requires appropriate permissions.
Request:
{
"type": 1,
"id": 1,
"method": "addChatParticipant",
"payload": {
"chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
"userId": "user@video.example.com",
"displayHistory": false
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request for subsequent linking with the response. Read more here |
| method | string | Yes | Command addChatParticipant |
| chatId | string | Yes | Identifier of the chat to which the user is being added |
| userId | string | Yes | TrueConf ID of the user being added to the chat |
| displayHistory | bool | No | 5.5.2+ Chat history display flag. If true, the user will see previous messages |
Response:
{
"type": 2,
"id": 1,
"payload": {}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to link the request and response |
| payload | object | Yes | In 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 relevant section of the documentation.
# Remove chat participant
Removes the specified participant from the chat. Can be used only in group chats and channels. To perform this operation, the appropriate permissions are required.
Request:
{
"type": 1,
"id": 1,
"method": "removeChatParticipant",
"payload": {
"chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
"userId": "user@video.example.com",
"clearHistory" : false
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementable value assigned by the sending party, required in each request for subsequent linkage with the response. More details read here |
| method | string | Yes | Command removeChatParticipant |
| chatId | string | Yes | ID of the chat from which the user is being removed |
| userId | string | Yes | TrueConf ID of the user being removed |
| clearHistory | bool | No | 5.5.3+ If true, the chat will be cleared along with the participant's removal. Default is false. |
Response:
{
"type": 2,
"id": 1,
"payload": {}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to link the request and response |
| payload | object | Yes | In 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 relevant section of the documentation.
# Change participant role
5.5.2+ Allows you to change a participant's role in a chat. To change a role, you must have the appropriate permissions. You will also receive a notification when any participant's role changes.
Request:
{
"type": 1,
"id": 1,
"method": "changeParticipantRole",
"payload": {
"chatId": "2b896a6ef210d6b2dcaebc2186c9a7974d616054",
"userId": "user@video.example.com",
"role": "admin"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, mandatory in each request for subsequent linking to the response. For more details, read here |
| method | string | Yes | Command changeParticipantRole |
| chatId | string | Yes | Chat identifier |
| userId | string | Yes | TrueConf ID of the user for whom the role is being changed |
| role | string | Yes | User's new role |
Response:
{
"type": 2,
"id": 1,
"payload": {}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to link the request and response |
| payload | object | Yes | In 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 relevant 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"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incremented value assigned by the sender, required in each request for subsequent linking to the response. Read more here |
| method | string | Yes | Command getChatByID |
| chatId | string | Yes | Chat identifier |
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"
}
}
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier matching the number sent in the original request, used to link the request and response |
| chatId | string | Yes | Chat identifier |
| title | string | Yes | Chat title |
| chatType | ChatTypeEnum | Yes | Type of chat |
| unreadMessages | uint32 | Yes | Number of unread messages in the chat |
| lastMessage | Envelope | Yes | Last message in the chat |
The lastMessage field follows the Envelope format, except that it does not include the chatId, isEdited, and box fields.
In the event of an error, a message containing the errorCode parameter is returned. A list of possible values is available in the relevant section of the documentation.
# Retrieve the list of chats
Returns a list of all chats that the current user is a member of.
Request:
{
"type": 1,
"id": 1,
"method": "getChats",
"payload": {
"count": 10,
"page": 1
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. This is an incremented value assigned by the sender, required in each request to associate with a response. Read more here |
| method | string | Yes | Command getChats |
| count | uint32 | Yes | Maximum number of chat objects in the response |
| page | uint32 | Yes | Page number of the request (paging). Starts at 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"
}
}
}
]
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier matching the number sent in the original request, used for linking the request and response |
| payload | Array<Chat> | Yes | User's 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 relevant section of the documentation.
# Get chat participant
5.5.3+ Returns a participant from 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",
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incremental value assigned by the sender, required for each request to link with the response. More details here |
| method | string | Yes | Command getChatParticipant |
| chatId | string | Yes | Chat identifier |
| userId | string | Yes | TrueConf ID of the requested user |
Response:
{
"type": 2,
"id": 1,
"payload": {
"userId": "user@video.example.com",
"role": "user",
"type": 1
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier matching the number sent in the original request, used to link the request and response |
| userId | string | Yes | TrueConf user ID |
| role | string | Yes | User role (see description) |
| type | uint32 | Yes | User 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 relevant 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
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Type of message (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required for every request to link with a response. More details read here |
| method | string | Yes | Command getChatParticipants |
| chatId | string | Yes | Chat identifier |
| pageSize | uint32 | Yes | Number of records with chat participant information in the response to the request |
| pageNumber | uint32 | Yes | Offset at which the list of participants will be returned. Calculated by 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
}
]
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | An identifier matching the number sent in the original request, used to link the request and response |
| participants | Array<ChatParticipant> | Yes | A list of chat participants represented 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 relevant section of the documentation.
# Verify 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"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementable value assigned by the sending party, required in every request for subsequent mapping with the response. Read more here |
| method | string | Yes | Command hasChatParticipant |
| chatId | string | Yes | The chat ID in which the user's presence is checked |
| userId | string | Yes | TrueConf ID of the user being checked |
Response:
{
"type": 2,
"id": 1,
"payload": {
"result": true
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier matching the number sent in the original request, used to associate the request and response |
| result | boolean | Yes | Flag indicating participant presence 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 relevant 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. 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
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| method | string | Yes | Command createP2PChat |
| type | uint32 | Yes | Message type (default 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sending party. More details here. |
| chatId | string | Yes | Identifier of the created chat |
| title | string | Yes | TrueConf ID of the user who created the chat |
| chatType | uint32 | Yes | Type of the created chat. Corresponds to ChatTypeEnum |
| lastMessage.chatId | string | Yes | Identifier of the chat where the message is located |
| messageId | string | Yes | Identifier of the message. Can be used later for editing, forwarding, or deleting the message |
| timestamp | uint64 | Yes | Message sending timestamp in UNIX timestamp format with millisecond precision |
| author.id | string | Yes | Unique identifier of the message author (TrueConf ID or server name) |
| author.type | uint32 | Yes | Type of the message author. See EnvelopeAuthorTypeEnum |
| lastMessage.type | uint32 | Yes | Type of message, corresponds to EnvelopeContentType |
| text | string | No | Message text |
| parseMode | string | No | Formatting mode (more details) |
| unreadMessages | uint32 | Yes | Number of unread messages in the personal chat |
The payload.lastMessage.content field varies depending on the payload.lastMessage.type of the message.
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Group chat created
The server notifies about the creation of a group chat to which the current user has been added. You can find a description of the group chat participant permissions 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
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| method | string | Yes | Command createGroupChat |
| type | uint32 | Yes | Message type (default 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the requesting party, mandatory for each request to be associated with a response. Read more here |
| chatId | string | Yes | Identifier of the created chat |
| title | string | Yes | Title of the created chat |
| chatType | uint32 | Yes | Type of the created chat. Corresponds to ChatTypeEnum |
| lastMessage.chatId | string | Yes | Identifier of the chat containing the message |
| messageId | string | Yes | Message identifier. Can be used for modification, forwarding, or deletion |
| timestamp | uint64 | Yes | Timestamp in UNIX timestamp format with millisecond precision |
| author.id | string | Yes | TrueConf ID of the message author or server name |
| author.type | uint32 | Yes | Author type. See EnvelopeAuthorTypeEnum |
| lastMessage.type | uint32 | Yes | Message type. See EnvelopeContentType |
| userId | string | No | TrueConf ID of the user who sent the message |
| role | string | No | User role in the chat (see more) |
| unreadMessages | uint32 | Yes | Number 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
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# 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 channel participant 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
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| method | string | Yes | Command createChannel |
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request ID. An incrementing value assigned by the sender, mandatory in each request for subsequent linking with the response. Read more here |
| chatId | string | Yes | Identifier of the created channel |
| title | string | Yes | Title of the created channel |
| chatType | uint32 | Yes | Type of the created channel. Corresponds to ChatTypeEnum = 6 |
| lastMessage.chatId | string | Yes | Channel ID where the message is located |
| messageId | string | Yes | Message ID. This ID can be used to modify, forward, or delete the message in the future |
| timestamp | uint64 | Yes | Timestamp of the message sent in UNIX timestamp format with millisecond precision |
| author.id | string | Yes | Unique identifier of the message author. This is either the user's TrueConf ID or the name of the server from which the message came. The identifier type depends on the type field |
| author.type | uint32 | Yes | Type of the message author. More details in EnvelopeAuthorTypeEnum |
| lastMessage.type | uint32 | Yes | Type of message. Allows determining the content type in the message. Corresponds to EnvelopeContentType |
| userId | string | No | TrueConf ID of the user who sent the message |
| role | string | No | User's role in the group chat (see more) |
| unreadMessages | uint32 | Yes | Number 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
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Chat "Favorites" created
5.5.2+ 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
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| method | string | Yes | Command createFavoritesChat |
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request to link it with the response. More details here |
| chatId | string | Yes | Identifier of the created "Favorites" chat |
| title | — | Yes | Default is null |
| chatType | uint32 | Yes | Type of the created chat. Corresponds to ChatTypeEnum = 5 |
| lastMessage | — | Yes | Default is null |
| unreadMessages | uint32 | Yes | Default is 0 |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Chat name changed
5.5.3+
Notification from the server:
{
"method": "editChatTitle",
"type": 1,
"id": 1,
"payload": {
"chatId": "29bc6e4d0f99105b50f419eff03a1ed58da9db6c",
"title": "New title"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| method | string | Yes | Command editChatTitle |
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request for subsequent association with the response. More details read here |
| chatId | string | Yes | Identifier of the renamed chat |
| title | string | Yes | New chat title |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# 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"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| method | string | Yes | Command editChatAvatar |
| type | uint32 | Yes | Type of message (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sending party, required in each request for subsequent correlation with the response. More details here |
| chatId | string | Yes | Identifier of the chat whose image was changed |
| avatarUrl | string | Yes | New chat image. If null, the image is absent (deleted). |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Chat history cleared
5.5.3+
Notification from the server:
{
"type": 1,
"id": 1,
"method": "clearHistory",
"payload": {
"chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
"forAll": false
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request for subsequent linking to the response. Read more here |
| method | string | Yes | Command clearHistory |
| chatId | string | Yes | Identifier of the chat whose history was cleared |
| forAll | bool | No | If true, the chat was cleared for everyone |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Chat deleted
The server notifies about the chat removal in which the current user previously participated. This could be a personal (peer-to-peer) chat, a group chat, or a channel.
Notification from the server:
{
"method": "removeChat",
"type": 1,
"id": 1,
"payload": {
"chatId": "84960c6d80afa729b0fd42d35331de5814cc3e9a"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| method | string | Yes | Command removeChat |
| type | uint32 | Yes | Message type (default 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incremental value assigned by the sender. Read more here |
| chatId | string | Yes | Identifier of the remote chat |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# 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"
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| method | string | Yes | Command addChatParticipant |
| type | uint32 | Yes | Message type (default 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. Incremental value assigned by the sending party. Read more here |
| chatId | string | Yes | Identifier of the chat where the user was added |
| userId | string | Yes | TrueConf ID of the user added to the chat |
| userRole | string | Yes | 5.5.2+ User role who added the participant to the chat |
| addedBy.id | string | Yes | Unique identifier of the user who added the new participant. This is the TrueConf ID or server name, depending on addedBy.type |
| addedBy.type | uint32 | Yes | Type of user who added the new participant. See EnvelopeAuthorTypeEnum |
| timestamp | uint64 | Yes | Timestamp of when the participant was added to the chat in UNIX timestamp format (in milliseconds) |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Chat participant removed
The server sends a notification when a participant is 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"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| method | string | Yes | The removeChatParticipant command |
| type | uint32 | Yes | Message type (default 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incremental value assigned by the sender, required in each request to subsequently link it with the response. More details here |
| chatId | string | Yes | The chat identifier from which the user was removed |
| userId | string | Yes | The TrueConf ID of the user removed from the chat |
| removedBy.id | string | Yes | Unique identifier of the user who removed the participant from the chat. This is either the TrueConf ID or the server name from which the message was sent. The identifier type depends on the removedBy.type field |
| removedBy.type | uint32 | Yes | Type of user who removed the participant from the chat. See more in EnvelopeAuthorTypeEnum |
| timestamp | uint64 | Yes | Timestamp of the user's removal from the chat in UNIX timestamp format with millisecond precision |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |
# Participant role changed
5.5.2+ The server sends a notification when the role of a chat participant has been changed.
Request:
{
"type": 1,
"id": 1,
"method": "changeParticipantRole",
"payload": {
"chatId": "7e5ea3e8b5ed63e1443b2e4dcdd68b9f196abae1",
"userId": "user@video.example.com",
"role": "admin",
"timestamp": 1760594447544
}
}
| Parameter | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 1). Corresponds to MESSAGE_TYPE.REQUEST |
| id | uint32 | Yes | Unique request identifier. An incrementing value assigned by the sender, required in each request for subsequent linkage with the response. More details can be read here |
| method | string | Yes | Command changeParticipantRole |
| chatId | string | Yes | Chat identifier |
| userId | string | Yes | TrueConf ID of the user whose role has changed |
| role | string | Yes | New user role |
| timestamp | uint64 | Yes | Timestamp of the participant role change in UNIX timestamp format accurate to milliseconds |
Response from client:
{
"type": 2,
"id": 123456
}
| Field | Type | Req. | Description |
|---|---|---|---|
| type | uint32 | Yes | Message type (default is 2). Corresponds to MESSAGE_TYPE.RESPONSE |
| id | uint32 | Yes | Identifier of the message being responded to (see details) |