Virbe Documentation

Message Action Schema

Complete reference for all action types available when sending messages via the Virbe API.

When sending a message via POST /api/v1/conversations/:id/messages/add, the request body has this structure:

{
  "senderId": "...",
  "senderType": "...",
  "replyTo": "...",
  "action": {
    "text": { ... },
    "customAction": { ... },
    "variableStore": { ... },
    "uiAction": { ... },
    "behaviorAction": { ... }
  }
}
FieldTypeRequiredDescription
senderIdstringyesA string of your choice that identifies the source of the message (e.g. "operator-panel")
actionobjectyesThe action to perform – see below
senderTypestringnoType of sender (e.g. "EndUser", "User", "Api")
replyTostring (UUID)noID of the message this is replying to

The action object can include one or more action types simultaneously. All action fields are optional – include only the types you need.


Text Action

Send a text message to the conversation. The virtual being will process this as user input.

FieldTypeRequiredDescription
textstringyesThe message text
rawstringnoRaw/unprocessed version of the text
htmlstringnoHTML-formatted version
ssmlstringnoSSML markup for speech synthesis
languagestringnoLanguage code (e.g. en-US)
{
  "senderId": "operator-panel",
  "action": {
    "text": {
      "text": "Hello from the operator!",
      "language": "en-US"
    }
  }
}

Custom Action

Trigger a named custom action. Use this for application-specific actions like navigation commands or feature triggers.

FieldTypeRequiredDescription
namestringyesAction name
valueanynoOptional payload of any type
{
  "senderId": "operator-panel",
  "action": {
    "customAction": {
      "name": "navigate",
      "value": { "screen": "product-details", "id": 42 }
    }
  }
}

Variable Store

Set a key-value pair on the conversation. Variables are persisted and accessible in conversation flows.

FieldTypeRequiredDescription
keystringyesVariable name
valueanyyesVariable value (any type)
{
  "senderId": "operator-panel",
  "action": {
    "variableStore": {
      "key": "operatorName",
      "value": "John"
    }
  }
}

UI Action

Display interactive UI elements to the end user – buttons, cards, input fields, or web views. This is the most feature-rich action type.

The UI action always uses the envelope format:

{
  "senderId": "operator-panel",
  "action": {
    "uiAction": {
      "name": "virbe-payload-v3",
      "value": {
        "type": "buttons | cards | input | webView",
        "timeoutMs": 10000,
        ...
      }
    }
  }
}
FieldTypeRequiredDescription
namestringyesAlways "virbe-payload-v3"
value.typestringnoUI type: buttons, cards, or webView
value.timeoutMsnumbernoAuto-dismiss timeout in milliseconds (default: 10000)

Buttons

Show a set of quick-reply buttons. When the user taps a button, its id is sent back as input.

FieldTypeRequiredDescription
idstringyesUnique button identifier (sent back on click)
labelstringyesButton display text
{
  "senderId": "operator-panel",
  "action": {
    "uiAction": {
      "name": "virbe-payload-v3",
      "value": {
        "type": "buttons",
        "timeoutMs": 15000,
        "buttons": [
          { "id": "yes", "label": "Yes, please" },
          { "id": "no", "label": "No, thanks" },
          { "id": "more", "label": "Tell me more" }
        ]
      }
    }
  }
}

Cards

Show a set of rich cards with optional images. Each card can trigger either a text response or a signal when selected.

FieldTypeRequiredDescription
idstringyesUnique card identifier
titlestringnoCard title
imageUrlstringnoURL of the card image
payloadTypestringyesWhat happens on selection: "text" or "signal"
textstringnoText sent back when payloadType is "text"
signalobjectnoSignal triggered when payloadType is "signal" (see Signal)
{
  "senderId": "operator-panel",
  "action": {
    "uiAction": {
      "name": "virbe-payload-v3",
      "value": {
        "type": "cards",
        "timeoutMs": 20000,
        "cards": [
          {
            "id": "product-a",
            "title": "Product A",
            "imageUrl": "https://example.com/product-a.jpg",
            "payloadType": "text",
            "text": "I want Product A"
          },
          {
            "id": "product-b",
            "title": "Product B",
            "imageUrl": "https://example.com/product-b.jpg",
            "payloadType": "signal",
            "signal": { "name": "select-product", "value": "b" }
          }
        ]
      }
    }
  }
}

Web View

Open a web page or render custom HTML inside the conversation UI. Ideal for forms, maps, or embedded content.

FieldTypeRequiredDescription
typestringno"URL" to load a URL, or "HTML" to render inline HTML (default: "URL")
urlstringnoURL to load (when type is "URL")
htmlstringnoHTML content to render (when type is "HTML")
fullscreenbooleannoShow in fullscreen mode
transparentbooleannoTransparent background
closeAfterInactivitybooleannoAuto-close after inactivity (default: true)
closeAfterInactivityTimeoutnumbernoInactivity timeout in milliseconds
closeOnOutsideClickbooleannoClose when user clicks outside (default: false)
showCloseButtonbooleannoShow a close button
allowRedirectbooleannoAllow navigation within the web view (default: false)
disableKeyboardbooleannoDisable keyboard input in the web view (default: false)
overrideSettingsbooleannoOverride default web view settings (default: false)
{
  "senderId": "operator-panel",
  "action": {
    "uiAction": {
      "name": "virbe-payload-v3",
      "value": {
        "type": "webView",
        "webView": {
          "type": "URL",
          "url": "https://example.com/feedback-form",
          "fullscreen": false,
          "showCloseButton": true,
          "closeOnOutsideClick": true,
          "allowRedirect": false
        }
      }
    }
  }
}

Inline HTML example:

{
  "senderId": "operator-panel",
  "action": {
    "uiAction": {
      "name": "virbe-payload-v3",
      "value": {
        "type": "webView",
        "webView": {
          "type": "HTML",
          "html": "<div style='padding:20px'><h2>Welcome!</h2><p>Custom content here.</p></div>",
          "fullscreen": false,
          "showCloseButton": true
        }
      }
    }
  }
}

Behavior Action

Trigger animations and emotions on the virtual being. Controls gestures and facial expressions with precise timing.

The behavior action uses the same envelope format as UI actions:

FieldTypeRequiredDescription
namestringyesAlways "virbe-payload-v3"
value.gesturesarrayyesList of gesture animations
value.emotionsarrayyesList of emotion animations

Each animation object:

FieldTypeRequiredDescription
namestringyesAnimation name
startnumberyesStart time in seconds
durationnumbernoDuration in seconds
{
  "senderId": "operator-panel",
  "action": {
    "behaviorAction": {
      "name": "virbe-payload-v3",
      "value": {
        "gestures": [
          { "name": "wave", "start": 0, "duration": 2.5 }
        ],
        "emotions": [
          { "name": "happy", "start": 0, "duration": 3.0 }
        ]
      }
    }
  }
}

On this page