This Chat API allows your clients and operators to communicate in real time.
Deafault chat server
Used to send new messages from clients/operators
Available only on servers:
Accepts the following message:
Event emitted when user sends new message to the chat room
{
"type": "send_message",
"data": {
"text": "string",
"attachments": [
"3f439f10-9c19-4bd4-81a8-d6e048b97ba4"
]
}
}
Used to notify server that user has successefuly received/read message
Available only on servers:
Accepts one of the following messages:
Event emitted when user receives new message
{
"type": "mark_message_delivered",
"data": {
"message_id": 0
}
}
Event emitted when user reads a message
{
"type": "mark_message_read",
"data": {
"message_id": 0
}
}
Used to notify room about typing updates
Available only on servers:
Accepts the following message:
Event emitted when user starts/stops typing
{
"type": "update_typing",
"data": {
"text": "string",
"stopped": true
}
}
Used to notify users that a new message was added to the room
Available only on servers:
Accepts the following message:
Event emitted when server adds new message to the room
{
"type": "message_added",
"data": {
"message": {
"id": 0,
"type": "standard",
"type_role": "user",
"status": "new",
"text": "string",
"send_time": "2025-01-20T16:31:04+03:00",
"message_index": 0,
"chat": {
"uuid": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"widget": {
"source": "lk"
},
"status": "new",
"owner_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"operator_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
},
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"attachments": [
{
"uuid": "3f439f10-9c19-4bd4-81a8-d6e048b97ba4",
"type": "image",
"url": "string",
"url_preview": "string",
"filename": "gold sphere_2.gif",
"extension": "gif",
"size": 1614977
}
]
}
}
}
Used to notify users that some message in the current room was updated
Available only on servers:
Accepts the following message:
Event emitted when server modifies existing message in the room
{
"type": "message_updated",
"data": {
"message": {
"id": 0,
"type": "standard",
"type_role": "user",
"status": "new",
"text": "string",
"send_time": "2025-01-20T16:31:04+03:00",
"message_index": 0,
"chat": {
"uuid": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"widget": {
"source": "lk"
},
"status": "new",
"owner_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"operator_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
},
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"attachments": [
{
"uuid": "3f439f10-9c19-4bd4-81a8-d6e048b97ba4",
"type": "image",
"url": "string",
"url_preview": "string",
"filename": "gold sphere_2.gif",
"extension": "gif",
"size": 1614977
}
]
}
}
}
Used to notify users that somebody just joined/left the room
Available only on servers:
Accepts one of the following messages:
Event emitted by server when user connects to the room
{
"type": "user_connected",
"data": {
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
}
}
Event emitted by server when user disconnects from the room
{
"type": "user_disconnected",
"data": {
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
}
}
Used to notify operators about new messages in every room and global updates
Available only on servers:
Accepts one of the following messages:
Event emitted when server adds new message to the room
{
"type": "message_added",
"data": {
"message": {
"id": 0,
"type": "standard",
"type_role": "user",
"status": "new",
"text": "string",
"send_time": "2025-01-20T16:31:04+03:00",
"message_index": 0,
"chat": {
"uuid": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"widget": {
"source": "lk"
},
"status": "new",
"owner_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"operator_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
},
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"attachments": [
{
"uuid": "3f439f10-9c19-4bd4-81a8-d6e048b97ba4",
"type": "image",
"url": "string",
"url_preview": "string",
"filename": "gold sphere_2.gif",
"extension": "gif",
"size": 1614977
}
]
}
}
}
Event emitted by server on chat updates
{
"type": "chat_updated",
"data": {
"chat": {
"uuid": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"widget": {
"source": "lk"
},
"status": "new",
"owner_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"operator_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
}
}
}
Event emitted by server on operator updates
{
"type": "operator_updated",
"data": {
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"is_online": true,
"new_chats": 0,
"open_chats": 0
}
}
Event emitted by server when user starts/stops typing
{
"type": "typing_updated",
"data": {
"text": "string",
"stopped": true,
"chat_id": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
}
}
Event emitted by server on global data updates
{
"type": "global_updated",
"data": {
"unread_chats": 0
}
}
Used to notify operators about updates in chat
Available only on servers:
Accepts the following message:
Json encoded chat
Additional chat information
{
"uuid": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"widget": {
"source": "lk"
},
"status": "new",
"owner_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"operator_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
}
Used to notify broadcast listener about updates related to operators
Available only on servers:
Accepts the following message:
Json encoded operators data
List of updated operators data
[
{
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"is_online": true,
"new_chats": 0,
"open_chats": 0
}
]
{
"Widget-Source": "lk"
}
Used to notify users about new messages
Messages with type=standard are added to both chat and broadcast channels, messages with type=system are added only to the chat channel, and only users with role=type_role receive notifications.
Available only on servers:
Accepts the following message:
Json encoded message data
Message related information
{
"id": 0,
"type": "standard",
"type_role": "user",
"status": "new",
"text": "string",
"send_time": "2025-01-20T16:31:04+03:00",
"message_index": 0,
"chat": {
"uuid": "d599cb9b-a451-4bb3-ac0c-1465b9a1c4de",
"widget": {
"source": "lk"
},
"status": "new",
"owner_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"operator_user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
}
},
"user": {
"id": 0,
"role": "user",
"avatar": "string",
"lastname": "string",
"firstname": "string",
"patronymic": "string"
},
"attachments": [
{
"uuid": "3f439f10-9c19-4bd4-81a8-d6e048b97ba4",
"type": "image",
"url": "string",
"url_preview": "string",
"filename": "gold sphere_2.gif",
"extension": "gif",
"size": 1614977
}
]
}
{
"Widget-Source": "lk"
}
Used to notify broadcast listener about updates to global data
Available only on servers:
Accepts the following message:
Json encoded global data
Event specific payload data
{
"unread_chats": 0
}
{
"Widget-Source": "lk"
}
Event emitted when user sends new message to the chat room
Event emitted when user receives new message
Event emitted when user reads a message
Event emitted when server adds new message to the room
Event emitted when server could not add new message to the room
Event emitted when server modifies existing message in the room
Event emitted when user starts/stops typing
Event emitted by server when user starts/stops typing
Event emitted by server when user connects to the room
Event emitted by server when user disconnects from the room
Event emitted by server on chat updates
Event emitted by server on operator updates
Event emitted by server on global data updates
User related information
Additional chat information
Message related information
Operator related information