ApichatWebhookPayload
APIchat webhook delivery body. Unlike Platform, customer/channel/agent are TOP-LEVEL, not nested per message. Always exactly one entry in messages (no batching).
- agentType:requiredProperties: 4
Who emitted the message — shared across the whole envelope (APIchat has no per-message sender). Conditional shape: bot envelopes carry only { id, type }; human-agent envelopes also carry { name, email } from the agent's Landbot account. Switch on
typefor attribution. - channelType:requiredProperties: 2
The APIchat channel. Note: there is NO
channel.typefield — its absence is the reliable discriminator that you're reading an APIchat (not Platform) envelope. - customerType:requiredProperties: 7
The customer this conversation belongs to: Landbot identifiers plus the customer's Field bag. Custom Fields set by a Set-Field block appear as ADDITIONAL top-level keys (only on webhooks emitted after the block runs) and may be type-mangled — treat values as strings unless guaranteed otherwise. No Platform-style metadata (agent_id/is_external/country/url/archived).
- messagesType:required