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 элементов. По умолчанию []. |
customer | Customer | да | |
message_id | string | да | от 1 симв., до 100 симв.. |
schema_version | integer | нет | По умолчанию 1. |
sent_at | string (date-time) | да | |
text | string | нет | до 20000 симв.. По умолчанию "". |
thread_id | string | нет | до 100 симв.. По умолчанию "". |
type | "custom.message" | да | Вид варианта: всегда custom.message. |
InboundAttachment
Файл клиента: Helpdesk скачивает его по url (хост — в разрешённых, C-04) и проверяет антивирусом до показа оператору.
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
mime_type | string | нет | до 255 симв.. По умолчанию "". |
name | string | да | от 1 симв., до 255 симв.. |
size | integer или null | нет | не меньше 0. По умолчанию null. |
url | string | да | от 1 симв., до 2048 симв.. |
Customer
Клиент в системе организации: по external_id Helpdesk находит его карточку.
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
external_id | string | да | от 1 симв., до 100 симв.. |
name | string | нет | до 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"
}