message.customer
Тело запроса POST на адрес подписки. Заголовки, подпись и повторы описаны в гайде «Вебхуки».
Схема message.customer.v1 собрана из src/backend/contracts/integrations/webhooks/message.customer.v1.json при сборке портала.
Поля
CustomerMessage
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
conversation | Conversation | да | |
event_id | string (uuid) | да | |
message | Message | да | |
occurred_at | string (date-time) | да | |
schema_version | integer | нет | По умолчанию 1. |
type | "message.customer" | да | Вид варианта: всегда message.customer. |
Conversation
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
customer_id | string (uuid) | да | |
id | string (uuid) | да | |
identities | массив Identity | да | |
number | string | да | |
queue_id | string (uuid) или null | нет | По умолчанию null. |
Identity
Подтверждённая личность клиента: по ней система находит его у себя.
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
external_id | string | да | |
namespace | string | да |
Message
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
author | Author | да | |
client_message_id | string | нет | По умолчанию "". |
files | массив File | да | |
hidden | boolean | да | |
id | string (uuid) | да | |
sent_at | string (date-time) | да | |
sequence | integer | да | |
texts | массив string | да |
Author
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
kind | AuthorKind | да | |
name | string | нет | По умолчанию "". |
AuthorKind
Значения: "bot", "customer", "operator", "system".
File
Файл сообщения: GET /api/integration/v1/attachments/{attachment_id}.
| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
attachment_id | string (uuid) | да | |
mime_type | string | да | |
name | string | да | |
size | integer | да |
JSON Schema
{
"$defs": {
"Author": {
"properties": {
"kind": {
"$ref": "#/$defs/AuthorKind"
},
"name": {
"default": "",
"type": "string"
}
},
"required": [
"kind"
],
"title": "Author",
"type": "object"
},
"AuthorKind": {
"enum": [
"bot",
"customer",
"operator",
"system"
],
"title": "AuthorKind"
},
"Conversation": {
"properties": {
"customer_id": {
"format": "uuid",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"identities": {
"items": {
"$ref": "#/$defs/Identity"
},
"type": "array"
},
"number": {
"type": "string"
},
"queue_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"id",
"number",
"customer_id",
"identities"
],
"title": "Conversation",
"type": "object"
},
"CustomerMessage": {
"properties": {
"conversation": {
"$ref": "#/$defs/Conversation"
},
"event_id": {
"format": "uuid",
"type": "string"
},
"message": {
"$ref": "#/$defs/Message"
},
"occurred_at": {
"format": "date-time",
"type": "string"
},
"schema_version": {
"default": 1,
"type": "integer"
},
"type": {
"description": "Вид варианта: всегда `message.customer`.",
"enum": [
"message.customer"
]
}
},
"required": [
"type",
"event_id",
"occurred_at",
"conversation",
"message"
],
"title": "CustomerMessage",
"type": "object"
},
"File": {
"description": "Файл сообщения: ``GET /api/integration/v1/attachments/{attachment_id}``.",
"properties": {
"attachment_id": {
"format": "uuid",
"type": "string"
},
"mime_type": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer"
}
},
"required": [
"attachment_id",
"name",
"mime_type",
"size"
],
"title": "File",
"type": "object"
},
"Identity": {
"description": "Подтверждённая личность клиента: по ней система находит его у себя.",
"properties": {
"external_id": {
"type": "string"
},
"namespace": {
"type": "string"
}
},
"required": [
"namespace",
"external_id"
],
"title": "Identity",
"type": "object"
},
"Message": {
"properties": {
"author": {
"$ref": "#/$defs/Author"
},
"client_message_id": {
"default": "",
"type": "string"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"hidden": {
"type": "boolean"
},
"id": {
"format": "uuid",
"type": "string"
},
"sent_at": {
"format": "date-time",
"type": "string"
},
"sequence": {
"type": "integer"
},
"texts": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"id",
"sequence",
"author",
"hidden",
"texts",
"files",
"sent_at"
],
"title": "Message",
"type": "object"
}
},
"$ref": "#/$defs/CustomerMessage"
}