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: object · ApichatWebhookAgentrequired
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.- idType: numberrequired
Bot ID for bot-sent; agent user-account ID for human-sent. Positive integer.
- typeType: stringenumrequiredvalues
- bot
- human
- emailType: string
Human agent's account email. Present only when type == "human".
- nameType: string
Human agent's account display name. Present only when type == "human".
- channelType: object · ApichatWebhookChannelrequired
The APIchat channel. Note: there is NO
channel.typefield — its absence is the reliable discriminator that you're reading an APIchat (not Platform) envelope.- idType: number
- nameType: string
- customerType: object · ApichatWebhookCustomerrequired
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).
- emailType: string | null
Default placeholder Field; null if unset.
- idType: number
Landbot-assigned internal customer ID, stable across messages.
- nameType: string | null
Default placeholder Field; null if unset.
- phoneType: string | null
Default placeholder Field; null if unset.
- registerType: number
_date Unix epoch seconds (integer floor).
- tokenType: string
The
customer_tokenfrom POST /send/{customer_token}/ — use it to correlate envelopes. - propertyType: anything
Name
- messagesType: array · ApichatWebhookMessage[]required
A single APIchat webhook message (flat fields, discriminated on
type). Observed bot-side: text, dialog, image.A single APIchat webhook message (flat fields, discriminated on
type). Observed bot-side: text, dialog, image.- typeDiscriminatorenumconst:textrequiredvalues
- text
- messageType: stringrequired
Text content — flat on the message, no
data.bodywrapper. - timestampType: numberrequired
Unix epoch seconds with fractional microseconds (e.g. 1780054017.039184). Not a string, not milliseconds.