Skip to main content
The WebSocket Send command (Command Type: 3) sends a message over the active WebSocket connection. Typically used inside onConnect or onInterval hooks of the WebSocket command.

Command Type

Command Type ID: 3

Parameters

Message Format

sendMessage is always a string, sent over the socket as-is (a text frame). The feed decides what that string must contain:
  • JSON feeds: pass the JSON already stringified (escape the inner quotes), e.g. "{\"action\":\"subscribe\",\"channel\":\"live_odds\"}". Do not pass a JSON object — it must be a string.
  • Plain-text feeds: pass the literal token the feed expects, e.g. "ping".
  • Placeholders (e.g. ${state.eventId}) are resolved before the message is sent, so you can build the payload from earlier results.
This command must run inside an active WebSocket connection (typically an onConnect, onInterval, or onMessage hook); on its own, with no live socket, there is nothing to send.

Usage Examples

Send Subscription Message on Connect

Used inside the onConnect hook of a WebSocket command:

Send Periodic Heartbeat

Used inside an onInterval hook:
  • WebSocket - The parent command that provides the connection context
  • WebSocket Close - Close the connection after sending