Inbound messages

When a confirmed client sends ordinary text in a private conversation with a company bot, MassAccess sends a message.inbound event to the company Webhook URL.

See also: Webhook Format · Signature Verification · Delivery and retries

Event data example

json
{
  "event": "message.inbound",
  "event_version": 1,
  "event_id": "728b70f4-6cf3-5d85-9f39-0a2df2dbe01d",
  "timestamp": "2026-09-21T08:16:31Z",
  "data": {
    "service": "max",
    "bot_name": "support_max_bot",
    "phone_number": "12345678901",
    "text": "I need help with my order"
  }
}

Schema and examples

Event fields

NameTypeRequiredDescription
event"message.inbound"YesConstant message.inbound event name.
event_versionintegerYesEvent format version; always 1 for this schema.
event_idUUIDYesUnique event UUID. It equals the Idempotency-Key header on every delivery attempt.
timestampstring (date-time)YesEvent creation time in UTC, formatted as RFC 3339/ISO 8601.
dataobjectYesInbound message data.
data.service"telegram" | "max"YesMessage channel: telegram or max.
data.bot_namestringYesName of the company bot that received the message.
data.phone_numberstringYesConfirmed client phone number.
data.textstringYesOriginal text without truncation or HTML/Markdown conversion.

All listed fields are required and cannot be null. Additional fields are not allowed.

timestamp is the MassAccess event creation time, not the Telegram or MAX message time.

The length of data.text is counted after JSON decoding in Unicode scalar values (code points excluding surrogates): from 1 to 4096. For example, the code point U+1F44B counts as one value. Text is not truncated, normalized, or trimmed; unpaired surrogates are rejected. A company can set a lower maximum.

Company configuration

Inbound messages are disabled by default.

  1. Enable the Accept text messages switch.
  2. If needed, set the maximum length of one message and the number of messages accepted from one client during the selected period. The settings show the allowed values.

If the text is longer than the configured maximum, no notification is created for it. If a client exceeds the allowed number of messages during the selected period, notifications for messages over the limit are not created and are not sent later. New messages are accepted again when their number in the current period falls below the limit.