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

conversation.state

Тело запроса POST на адрес подписки. Заголовки, подпись и повторы описаны в гайде «Вебхуки».

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

Поля​

StateChanged​

ПолеТипОбязательноеОписание
conversationConversationда
event_idstring (uuid)да
occurred_atstring (date-time)да
operatorOperator или nullнетПо умолчанию null.
previous_statusConversationStatus или nullнетПо умолчанию null.
schema_versionintegerнетПо умолчанию 1.
statusConversationStatusда
type"conversation.state"даВид варианта: всегда conversation.state.

Conversation​

ПолеТипОбязательноеОписание
customer_idstring (uuid)да
idstring (uuid)да
identitiesмассив Identityда
numberstringда
queue_idstring (uuid) или nullнетПо умолчанию null.

Identity​

Подтверждённая личность клиента: по ней система находит его у себя.

ПолеТипОбязательноеОписание
external_idstringда
namespacestringда

Operator​

ПолеТипОбязательноеОписание
idstring (uuid)да
namestringда

ConversationStatus​

Состояние обращения, как его видит организация: без внутренних оттенков очереди.

Значения: "assigned", "at_bot", "closed", "on_hold", "resolved", "waiting".

JSON Schema​

{
"$defs": {
"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"
},
"ConversationStatus": {
"description": "Состояние обращения, как его видит организация: без внутренних оттенков очереди.",
"enum": [
"assigned",
"at_bot",
"closed",
"on_hold",
"resolved",
"waiting"
],
"title": "ConversationStatus"
},
"Identity": {
"description": "Подтверждённая личность клиента: по ней система находит его у себя.",
"properties": {
"external_id": {
"type": "string"
},
"namespace": {
"type": "string"
}
},
"required": [
"namespace",
"external_id"
],
"title": "Identity",
"type": "object"
},
"Operator": {
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"title": "Operator",
"type": "object"
},
"StateChanged": {
"properties": {
"conversation": {
"$ref": "#/$defs/Conversation"
},
"event_id": {
"format": "uuid",
"type": "string"
},
"occurred_at": {
"format": "date-time",
"type": "string"
},
"operator": {
"anyOf": [
{
"$ref": "#/$defs/Operator"
},
{
"type": "null"
}
],
"default": null
},
"previous_status": {
"anyOf": [
{
"$ref": "#/$defs/ConversationStatus"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"default": 1,
"type": "integer"
},
"status": {
"$ref": "#/$defs/ConversationStatus"
},
"type": {
"description": "Вид варианта: всегда `conversation.state`.",
"enum": [
"conversation.state"
]
}
},
"required": [
"type",
"event_id",
"occurred_at",
"conversation",
"status"
],
"title": "StateChanged",
"type": "object"
}
},
"$ref": "#/$defs/StateChanged"
}