MCP Control
Чаты · Изменение

Чаты · Сообщения · Создание

chat_messages_create
Контактные карточки и телефон

Попробуйте три запроса

Подготовить
  1. Вы указываетеЧат
  2. ПомощникПодготовка
  3. Вы получаетеПредпросмотр
Запрос в чат
Подготовь «Чаты / Сообщения / Создание». Для изменения нужны чат, сессия. Покажи объект и ожидаемый эффект до выполнения.
Что входит в подготовку
chatId
Чат
sessionId
Сессия
replyToMessageId
Параметр
Применить
  1. Вы указываетеСогласованные значения
  2. ПомощникОдин вызов
  3. Вы получаетеОтвет операции
Запрос в чат
На учебной записи подготовь «Чаты / Сообщения / Создание» с параметром type = text. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
Фрагмент учебных параметров
type
text
chatId
DEMO-101
sessionId
DEMO-101
Проверить итог
  1. Вы указываетеИсходный ответ
  2. ПомощникСверка результата
  3. Вы получаетеПодтверждение
Запрос в чат
Проверь результат «Чаты / Сообщения / Создание» по исходному ответу. Покажи чат, messageId. Объясни, чем подтвердить эффект для выбранного объекта.
Как сверить изменение
  1. До измененияПрочитать версию
  2. При записиПередать выбранную версию
  3. После ответаПеречитать объект
Как работает действие

Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения. Прочитайте актуальную версию записи перед подготовкой запроса.

Описание разработчика

Send text or an interactive card, form, live status or isolated HTML/CSS to an active human internal chat using interactive. The saved buttons can invoke approved published Flow bindings. Credential material remains restricted to secure input. Create or reply to a native message in an active chat; the server stamps sender and time. Replies must stay in the same chat and session. credential creates only an empty-reference secure-input placeholder; oauth requires a verified integration authorization link. In a StayraReply internal chat only, an exact owner reply “да” to a GPT proposal may trigger a separate server-verified Channex outbound queue; all other chats have no external sending effect. The returned chat receipt does not prove delivery.

Параметры запроса
interactive
Interactive message; use the declared type, limits and current saved card definition. необязательно · object
chatId
Existing native chatai document ID in the authenticated company and participant list. обязательно по схеме · string
sessionId
Current Flow/Chat operation session ID to preserve on this message, including OAuth link messages. обязательно по схеме · string
replyToMessageId
Optional existing reply target in the same chat and session. Omit for a top-level message. обязательно по схеме · string / string · по умолчанию ""
text
Native message text, at most 8192 characters. Submit credentials only through the secure human input page, never in this field. обязательно по схеме · string · по умолчанию "" · до символов 8192
type
Native message type. credential is only an empty-reference secure-input placeholder; oauth requires a server-verified authorization reference and URL. обязательно по схеме · string · по умолчанию "text" · варианты text, image, file, document, order, customer, task, product, oauth, credential
referenceId
Optional native reference ID hint. It never authorizes access to the referenced business resource. credential messages must initially use an empty reference. обязательно по схеме · string / string · по умолчанию ""
attachments
Up to ten existing internal media references. Each retains its own company and resource permission checks. обязательно по схеме · array · по умолчанию [] · до элементов 10
expectedRevision
Версия, прочитанная перед изменением. необязательно · string
requestId
Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
Что вернёт команда
chatId
Existing native chatai document ID in the authenticated company and participant list. обязательно по схеме · string
messageId
Created message ID, otherwise null. обязательно по схеме · string / null
operation
Committed native operation. No business operation, provider or agent was run. обязательно по схеме · string · варианты chat_created, chat_updated, chat_archived, chat_restored, message_created
changed
Whether this operation changed native fields. обязательно по схеме · boolean
appliedFromRevision
Parent revision checked before the change; null for chat creation. Read again for the current revision. обязательно по схеме · string / null
Поля и технические схемы
Входные поля и поля ответа chat_messages_create
Вход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "interactive": {
      "type": "object",
      "properties": {
        "version": {
          "default": 1,
          "description": "Interactive version; use the declared type, limits and current saved card definition.",
          "type": "number",
          "const": 1
        },
        "kind": {
          "default": "card",
          "description": "Interactive kind; use the declared type, limits and current saved card definition.",
          "type": "string",
          "enum": [
            "card",
            "form",
            "status",
            "html"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 180,
          "description": "Interactive title; use the declared type, limits and current saved card definition."
        },
        "body": {
          "default": "",
          "description": "Interactive body; use the declared type, limits and current saved card definition.",
          "type": "string",
          "maxLength": 3000
        },
        "fields": {
          "default": [],
          "description": "Interactive fields; use the declared type, limits and current saved card definition.",
          "maxItems": 12,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/_mcp0"
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120,
                "description": "Interactive label; use the declared type, limits and current saved card definition."
              },
              "type": {
                "default": "text",
                "description": "Interactive type; use the declared type, limits and current saved card definition.",
                "type": "string",
                "enum": [
                  "text",
                  "textarea",
                  "number",
                  "select",
                  "checkbox",
                  "date"
                ]
              },
              "required": {
                "default": false,
                "description": "Interactive required; use the declared type, limits and current saved card definition.",
                "type": "boolean"
              },
              "options": {
                "description": "Interactive options; use the declared type, limits and current saved card definition.",
                "maxItems": 30,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string",
                      "maxLength": 160,
                      "description": "Interactive value; use the declared type, limits and current saved card definition."
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 160,
                      "description": "Interactive label; use the declared type, limits and current saved card definition."
                    }
                  },
                  "required": [
                    "value",
                    "label"
                  ],
                  "additionalProperties": false,
                  "description": "Interactive options; use the declared type, limits and current saved card definition."
                }
              },
              "maxLength": {
                "default": 500,
                "description": "Interactive maxLength; use the declared type, limits and current saved card definition.",
                "type": "integer",
                "minimum": 1,
                "maximum": 1500
              },
              "minimum": {
                "description": "Interactive minimum; use the declared type, limits and current saved card definition.",
                "type": "number"
              },
              "maximum": {
                "description": "Interactive maximum; use the declared type, limits and current saved card definition.",
                "type": "number"
              },
              "value": {
                "description": "Interactive value; use the declared type, limits and current saved card definition.",
                "anyOf": [
                  {
                    "$ref": "#/$defs/_mcp1"
                  },
                  {
                    "type": "number",
                    "description": "Interactive value; use the declared type, limits and current saved card definition."
                  },
                  {
                    "type": "boolean",
                    "description": "Interactive value; use the declared type, limits and current saved card definition."
                  },
                  {
                    "type": "null",
                    "description": "Interactive value; use the declared type, limits and current saved card definition."
                  }
                ]
              }
            },
            "required": [
              "id",
              "label",
              "type",
              "required",
              "maxLength"
            ],
            "additionalProperties": false,
            "description": "Interactive fields; use the declared type, limits and current saved card definition."
          }
        },
        "metrics": {
          "default": [],
          "description": "Interactive metrics; use the declared type, limits and current saved card definition.",
          "maxItems": 12,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "maxLength": 120,
                "description": "Interactive label; use the declared type, limits and current saved card definition."
              },
              "valueKey": {
                "$ref": "#/$defs/_mcp0"
              },
              "suffix": {
                "default": "",
                "description": "Interactive suffix; use the declared type, limits and current saved card definition.",
                "type": "string",
                "maxLength": 30
              }
            },
            "required": [
              "label",
              "valueKey",
              "suffix"
            ],
            "additionalProperties": false,
            "description": "Interactive metrics; use the declared type, limits and current saved card definition."
          }
        },
        "progress": {
          "description": "Interactive progress; use the declared type, limits and current saved card definition.",
          "type": "object",
          "properties": {
            "label": {
              "default": "",
              "description": "Interactive label; use the declared type, limits and current saved card definition.",
              "type": "string",
              "maxLength": 120
            },
            "valueKey": {
              "$ref": "#/$defs/_mcp0"
            },
            "maximum": {
              "default": 100,
              "description": "Interactive maximum; use the declared type, limits and current saved card definition.",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1000000000000
            }
          },
          "required": [
            "label",
            "valueKey",
            "maximum"
          ],
          "additionalProperties": false
        },
        "actions": {
          "default": [],
          "description": "Interactive actions; use the declared type, limits and current saved card definition.",
          "maxItems": 8,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/_mcp0"
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "Interactive label; use the declared type, limits and current saved card definition."
              },
              "kind": {
                "default": "submit",
                "description": "Interactive kind; use the declared type, limits and current saved card definition.",
                "type": "string",
                "enum": [
                  "submit",
                  "flow"
                ]
              },
              "flow": {
                "description": "Interactive flow; use the declared type, limits and current saved card definition.",
                "type": "object",
                "properties": {
                  "siteId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
                    "description": "Interactive siteId; use the declared type, limits and current saved card definition."
                  },
                  "alias": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,63}$",
                    "description": "Interactive alias; use the declared type, limits and current saved card definition."
                  },
                  "input": {
                    "default": {},
                    "description": "Interactive input; use the declared type, limits and current saved card definition.",
                    "type": "object",
                    "propertyNames": {
                      "$ref": "#/$defs/_mcp0"
                    },
                    "additionalProperties": {
                      "$ref": "#/$defs/_mcp2"
                    }
                  }
                },
                "required": [
                  "siteId",
                  "alias",
                  "input"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "label",
              "kind"
            ],
            "additionalProperties": false,
            "description": "Interactive actions; use the declared type, limits and current saved card definition."
          }
        },
        "values": {
          "default": {},
          "description": "Interactive values; use the declared type, limits and current saved card definition.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/_mcp0"
          },
          "additionalProperties": {
            "$ref": "#/$defs/_mcp2"
          }
        },
        "html": {
          "description": "Interactive html; use the declared type, limits and current saved card definition.",
          "type": "string",
          "maxLength": 60000
        },
        "height": {
          "default": 360,
          "description": "Interactive height; use the declared type, limits and current saved card definition.",
          "type": "integer",
          "minimum": 160,
          "maximum": 800
        }
      },
      "required": [
        "version",
        "kind",
        "title",
        "body",
        "fields",
        "metrics",
        "actions",
        "values",
        "height"
      ],
      "additionalProperties": false,
      "description": "Interactive message; use the declared type, limits and current saved card definition."
    },
    "chatId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Existing native chatai document ID in the authenticated company and participant list."
    },
    "sessionId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Current Flow/Chat operation session ID to preserve on this message, including OAuth link messages."
    },
    "replyToMessageId": {
      "default": "",
      "description": "Optional existing reply target in the same chat and session. Omit for a top-level message.",
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
        },
        {
          "type": "string",
          "const": ""
        }
      ]
    },
    "text": {
      "default": "",
      "type": "string",
      "maxLength": 8192,
      "description": "Native message text, at most 8192 characters. Submit credentials only through the secure human input page, never in this field."
    },
    "type": {
      "default": "text",
      "type": "string",
      "enum": [
        "text",
        "image",
        "file",
        "document",
        "order",
        "customer",
        "task",
        "product",
        "oauth",
        "credential"
      ],
      "description": "Native message type. credential is only an empty-reference secure-input placeholder; oauth requires a server-verified authorization reference and URL."
    },
    "referenceId": {
      "default": "",
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
        },
        {
          "type": "string",
          "const": ""
        }
      ],
      "description": "Optional native reference ID hint. It never authorizes access to the referenced business resource. credential messages must initially use an empty reference."
    },
    "attachments": {
      "default": [],
      "maxItems": 10,
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          {
            "type": "string",
            "pattern": "^file:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          {
            "type": "string",
            "pattern": "^Companies\\/[A-Za-z0-9_~:@+.-]{1,128}\\/Documents\\/[A-Za-z0-9_~:@+.-]{1,128}$"
          }
        ],
        "description": "Existing managed image UUID from media_get, file:<UUID> reference returned by the managed file service, or canonical Companies/{company}/Documents/{documentId} reference. Server checks company and underlying resource access. No URL, Storage path, query, inline bytes or base64."
      },
      "description": "Up to ten existing internal media references. Each retains its own company and resource permission checks."
    },
    "expectedRevision": {
      "description": "Optional expected parent chat revision. Current participation and archived state are always checked transactionally.",
      "type": "string",
      "pattern": "^fsv1:-?\\d{1,12}:\\d{1,9}$"
    },
    "requestId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{8,128}$",
      "description": "Stable request identifier for these exact arguments. Keep it unchanged when retrying an uncertain response."
    }
  },
  "required": [
    "chatId",
    "sessionId",
    "replyToMessageId",
    "text",
    "type",
    "referenceId",
    "attachments",
    "requestId"
  ],
  "additionalProperties": false,
  "$defs": {
    "_mcp0": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9_]{0,47}$",
      "description": "Interactive id; use the declared type, limits and current saved card definition."
    },
    "_mcp1": {
      "type": "string",
      "maxLength": 1500,
      "description": "Interactive value; use the declared type, limits and current saved card definition."
    },
    "_mcp2": {
      "anyOf": [
        {
          "$ref": "#/$defs/_mcp1"
        },
        {
          "type": "number",
          "description": "Interactive value; use the declared type, limits and current saved card definition."
        },
        {
          "type": "boolean",
          "description": "Interactive value; use the declared type, limits and current saved card definition."
        },
        {
          "type": "null",
          "description": "Interactive value; use the declared type, limits and current saved card definition."
        }
      ],
      "description": "Interactive value; use the declared type, limits and current saved card definition."
    }
  }
}
Выход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "chatId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Existing native chatai document ID in the authenticated company and participant list."
    },
    "messageId": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
          "description": "Message ID under this exact chat; never a path into another chat."
        },
        {
          "type": "null"
        }
      ],
      "description": "Created message ID, otherwise null."
    },
    "operation": {
      "type": "string",
      "enum": [
        "chat_created",
        "chat_updated",
        "chat_archived",
        "chat_restored",
        "message_created"
      ],
      "description": "Committed native operation. No business operation, provider or agent was run."
    },
    "changed": {
      "type": "boolean",
      "description": "Whether this operation changed native fields."
    },
    "appliedFromRevision": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^fsv1:-?\\d{1,12}:\\d{1,9}$",
          "description": "Exact Firestore update-time revision returned by the corresponding get action. No revision field is stored in the native document."
        },
        {
          "type": "null"
        }
      ],
      "description": "Parent revision checked before the change; null for chat creation. Read again for the current revision."
    }
  },
  "required": [
    "chatId",
    "messageId",
    "operation",
    "changed",
    "appliedFromRevision"
  ],
  "additionalProperties": false
}