# Server Requests (Server Messages)

This section describes messages that the server sends on its own initiative, without a direct client request. These are used for notifications about external events, state changes, and actions of other users. For example:

  • createGroupChat – group chat created.

  • addChatParticipant – user added to group chat.

  • sendMessage – new chat message.

For each server request, the client must respond as follows:

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

# Personal chat created

Message 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 Required Description
method string Yes Command createP2PChat
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. Read more 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 Chat identifier where the message is located
messageId string Yes Message identifier. 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 message author. See EnvelopeAuthorTypeEnum
lastMessage.type uint32 Yes Type of message, corresponds to EnvelopeTypeEnum
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 contains different data depending on the payload.lastMessage.type message type.

Response for the server:

{
    "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.

Message 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 incremented value assigned by the sender, required in each request for subsequent response matching. 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 Type of author. See EnvelopeAuthorTypeEnum
lastMessage.type uint32 Yes Message type. See EnvelopeTypeEnum
userId string No TrueConf ID of the user who sent the message
role string No User's 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

Message 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 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 matching with the response. More details read here
chatId string Yes Identifier of the created channel
title string Yes Name of the created channel
chatType uint32 Yes Type of the created channel. Corresponds to ChatTypeEnum = 6
lastMessage.chatId string Yes Identifier of the channel where the message is located
messageId string Yes Identifier of the message. This identifier can be used later for editing, forwarding, or deleting the message
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. It is either the TrueConf ID of the user or the server name from which the message was sent. The type of identifier depends on the type field
author.type uint32 Yes Type of the message author. For more details, see EnvelopeAuthorTypeEnum
lastMessage.type uint32 Yes Type of message. Allows identification of the type of content in the message. Corresponds to EnvelopeTypeEnum
userId string No TrueConf ID of the user who sent the message
role string No User role in the group chat (see more details)
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)

# Participant added to chat

Message from the server:

{   
    "method": "addChatParticipant",
    "type": 1,
    "id": 1,
    "payload": {
        "chatId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
        "userId": "user@video.example.com",
        "addedBy": {
            "id": "admin@video.example.com",
            "type": 1
        },
        "timestamp": "1735370776"
    }
}
Parameter Type Required Description
method string Yes Command addChatParticipant
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 sender. More details read 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
addedBy.id string Yes Unique identifier of the user who added the new participant. This is either the TrueConf ID or the server name, depending on addedBy.type
addedBy.type uint32 Yes Type of the user who added the new participant. See EnvelopeAuthorTypeEnum
timestamp uint64 Yes Timestamp of adding the participant 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

Message from the server:

{
  "method": "removeChatParticipant",
  "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)

# New message in chat

Message from the server:

{
    "method": "sendMessage",
    "type": 1,
    "id": 11,
    "payload": {
        "chatId": "bd05af54347e04a1c44e70033d35834d4428bb5d",
        "messageId": "d66254de-9d89-4130-8027-c5378f042800",
        "timestamp": 1746029007569,
        "author": {
            "id": "brown@video.example.com",
            "type": 1
        },
        "isEdited": false,
        "box": {
            "id": 4,
            "position": "0"
        },
        "type": 200,
        "content": {
            "text": "Text",
            "parseMode": "html"
        }
    }
}

The notification of a new message includes fields corresponding to the Envelope object. Detailed descriptions of these fields can be found in the section on working with messages.

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)

# New file in chat

In the TrueConf chat protocol, the file send event occurs immediately upon message creation, without waiting for the file to be uploaded to the server. After this, the file will upload for a while before becoming available for download.

Message from the server:

{
    "type": 1,
    "id": 7,
    "method": "sendMessage",
    "payload": {
        "chatId": "bea15543d971a83c8ba1f103104791762c6b4b8f",
        "messageId": "c8c3eee8-9ad0-4638-9692-ad16391a4256",
        "timestamp": 1735302531000,
        "author": {
            "id": "user@video.example.com",
            "type": 1
        },
        "isEdited": false,
        "box": {
            "id": 10,
            "position": ""
        },
        "type": 2,
        "content": {
            "name": "someimage.png",
            "mimeType": "image/png",
            "size": 2156,
            "fileId": "e09dbd63a16bd8cd7bddda7193c1c4ff0d2f6de5"
        }
    }
}

A notification about a message with a file contains fields corresponding to the Envelope and FileMessageContent objects. Detailed descriptions of these fields can be found in the section dedicated to message handling.

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)

# New poll in chat

Message from the server:

{
    "method": "sendMessage",
    "type": 1,
    "id": 11,
    "payload": {
        "chatId": "bd05af54347e04a1c44e70033d35834d4428bb5d",
        "messageId": "d66254de-9d89-4130-8027-c5378f042800",
        "timestamp": 1746029007569,
        "author": {
            "id": "brown@video.example.com",
            "type": 1
        },
        "isEdited": false,
        "box": {
            "id": 4,
            "position": "0"
        },
        "type": 204,
        "content": {
            "url": "<tool_url>?id=...&k=...&mode=popup&call_id=vasya@srv.trueconf.name/1vca3&lang=ru&version=1&app=TrueConf+WebClient&dn=Vasiliy&s=12fee56062786c267cc286045f1fac76",
            "appVersion": 1,
            "path": "some_survey",
            "title": "Meeting survey",
            "description": "{{Survey}}",
            "buttonText": "{{Go to survey}}",
            "secret": "054c1cf18f1e64f4c38b256effedfe18debdcbba",
            "alt": "📊 <a href='https://server.url/webtools/survey?id=some_survey&error=autologin_not_supported'>Meeting survey</a>"
        }
    }
}

The notification about a message with a survey includes fields corresponding to the Envelope objects. A detailed description of these fields can be found in the section dedicated to working with messages and surveys.

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)

# The message has been modified.

Message from the server:

{
    "method": "editMessage",
    "type": 1,
    "id": 12,
    "payload": {
        "messageId": "d4d20b4f-e4a4-4abc-8e66-ff2e17f483b7",
        "timestamp": 1746029430000,
        "content": {
            "text": "🤝",
            "parseMode": "text"
        }
    }
}
Parameter Type Required Description
method string Yes Command editMessage
type uint32 Yes Message type (default 1). Corresponds to MESSAGE_TYPE.REQUEST
id uint32 Yes Unique request identifier. An incrementing value assigned by the sender, mandatory in each request to link with the response. More details read here
messageId string Yes Identifier of the edited message. This identifier can be used later for copying, forwarding, or deleting the message
timestamp uint64 Yes Timestamp of the message modification in UNIX timestamp format with millisecond precision
text string Yes Text of the edited message
parseMode string Yes Formatting mode (see more details)

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)

# The message has been deleted

Message from the server:

{
    "method": "removeMessage",
    "type": 1,
    "id": 12,
    "payload": {
        "chatId": "bd05af54347e04a1c44e70033d35834d4428bb5d",
        "messageId": "d4d20b4f-e4a4-4abc-8e66-ff2e17f483b7",
        "removedBy": {
            "id": "brown@video.example.com",
            "type": 1
        }
    }
}

Parameter Type Required Description
method string Yes Command removeMessage
type uint32 Yes Message type (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
chatId string Yes Identifier of the chat where the message was removed
messageId string Yes Identifier of the removed message. This identifier can be used later for copying, forwarding, or deleting the message
removedBy.id string Yes Unique identifier of the user who removed the message. This is either the TrueConf ID or the name of the server from which the message originated. The type of identifier depends on the removedBy.type field
removedBy.type uint32 Yes Type of user who removed the message. For more details, see EnvelopeAuthorTypeEnum

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)