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).

  • agent
    Type: object · ApichatWebhookAgent
    required

    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 type for attribution.

    • id
      Type: number
      required

      Bot ID for bot-sent; agent user-account ID for human-sent. Positive integer.

    • type
      Type: stringenum
      required
      values
      • bot
      • human
    • email
      Type: string

      Human agent's account email. Present only when type == "human".

    • name
      Type: string

      Human agent's account display name. Present only when type == "human".

  • channel
    Type: object · ApichatWebhookChannel
    required

    The APIchat channel. Note: there is NO channel.type field — its absence is the reliable discriminator that you're reading an APIchat (not Platform) envelope.

    • id
      Type: number
    • name
      Type: string
  • customer
    Type: object · ApichatWebhookCustomer
    required

    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).

    • email
      Type: string | null

      Default placeholder Field; null if unset.

    • id
      Type: number

      Landbot-assigned internal customer ID, stable across messages.

    • name
      Type: string | null

      Default placeholder Field; null if unset.

    • phone
      Type: string | null

      Default placeholder Field; null if unset.

    • register_date
      Type: number

      Unix epoch seconds (integer floor).

    • token
      Type: string

      The customer_token from POST /send/{customer_token}/ — use it to correlate envelopes.

    • propertyName
      Type: anything
  • messages
    Type: 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.

      • type
        Discriminator
        enum
        const:  
        text
        required
        values
        • text
      • message
        Type: string
        required

        Text content — flat on the message, no data.body wrapper.

      • timestamp
        Type: number
        required

        Unix epoch seconds with fractional microseconds (e.g. 1780054017.039184). Not a string, not milliseconds.