Перейти к основному содержимому

custom.message (входной)

Входной топик аккаунта канала: запись пишет система организации, читает Shtab Connect. Ключ записи — customer.external_id.

Схема inbound.message.v1 собрана из src/backend/contracts/integrations/custom_channel/inbound.message.v1.json при сборке портала.

Поля​

InboundMessage​

Сообщение клиента. message_id — id у организации: повтор ничего не делает.

ПолеТипОбязательноеОписание
attachmentsмассив InboundAttachmentнетдо 10 элементов. По умолчанию [].
customerCustomerда
message_idstringдаот 1 симв., до 100 симв..
schema_versionintegerнетПо умолчанию 1.
sent_atstring (date-time)да
textstringнетдо 20000 симв.. По умолчанию "".
thread_idstringнетдо 100 симв.. По умолчанию "".
type"custom.message"даВид варианта: всегда custom.message.

InboundAttachment​

Файл клиента: Helpdesk скачивает его по url (хост — в разрешённых, C-04) и проверяет антивирусом до показа оператору.

ПолеТипОбязательноеОписание
mime_typestringнетдо 255 симв.. По умолчанию "".
namestringдаот 1 симв., до 255 симв..
sizeinteger или nullнетне меньше 0. По умолчанию null.
urlstringдаот 1 симв., до 2048 симв..

Customer​

Клиент в системе организации: по external_id Helpdesk находит его карточку.

ПолеТипОбязательноеОписание
external_idstringдаот 1 симв., до 100 симв..
namestringнетдо 255 симв.. По умолчанию "".

Пример​

{
"type": "custom.message",
"schema_version": 1,
"message_id": "msg-1001",
"customer": {
"external_id": "client-42",
"name": "Анна Петрова"
},
"thread_id": "order-77",
"text": "Здравствуйте, где мой заказ?",
"attachments": [
{
"url": "https://files.example.com/receipt.pdf",
"name": "receipt.pdf",
"mime_type": "application/pdf",
"size": 48213
}
],
"sent_at": "2026-11-10T09:30:00Z"
}

JSON Schema​

{
"$defs": {
"Customer": {
"description": "Клиент в системе организации: по ``external_id`` Helpdesk находит его карточку.",
"properties": {
"external_id": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"name": {
"default": "",
"maxLength": 255,
"type": "string"
}
},
"required": [
"external_id"
],
"title": "Customer",
"type": "object"
},
"InboundAttachment": {
"description": "Файл клиента: Helpdesk скачивает его по ``url`` (хост — в разрешённых, C-04) и проверяет\nантивирусом до показа оператору.",
"properties": {
"mime_type": {
"default": "",
"maxLength": 255,
"type": "string"
},
"name": {
"maxLength": 255,
"minLength": 1,
"type": "string"
},
"size": {
"anyOf": [
{
"minimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"url": {
"maxLength": 2048,
"minLength": 1,
"type": "string"
}
},
"required": [
"url",
"name"
],
"title": "InboundAttachment",
"type": "object"
},
"InboundMessage": {
"description": "Сообщение клиента. ``message_id`` — id у организации: повтор ничего не делает.",
"properties": {
"attachments": {
"default": [],
"items": {
"$ref": "#/$defs/InboundAttachment"
},
"maxItems": 10,
"type": "array"
},
"customer": {
"$ref": "#/$defs/Customer"
},
"message_id": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"schema_version": {
"default": 1,
"type": "integer"
},
"sent_at": {
"format": "date-time",
"type": "string"
},
"text": {
"default": "",
"maxLength": 20000,
"type": "string"
},
"thread_id": {
"default": "",
"maxLength": 100,
"type": "string"
},
"type": {
"description": "Вид варианта: всегда `custom.message`.",
"enum": [
"custom.message"
]
}
},
"required": [
"type",
"message_id",
"customer",
"sent_at"
],
"title": "InboundMessage",
"type": "object"
}
},
"$ref": "#/$defs/InboundMessage"
}