FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
SECURITY.MdAPI Reference
WebSocket Protocol Specs
DocsSECURITY.mdAPI ReferenceWebSocket Protocol Specs
GitHub Live Sync

WebSocket Protocol Specs

Live technical documentation fetched from GitHub repository omghante/metapilot/docs/api/websockets.md

WebSocket Protocol Specification

Specification for realtime WebSocket connections over
/ws/inbox/<tenant_id>/
.

Connection Handshake

  • URL Protocol:
    ws://
    (Dev) /
    wss://
    (Production)
  • Endpoint:
    /ws/inbox/<tenant_id>/
  • Authentication: Validated via session or query param JWT token.
javascript
const ws = new WebSocket("ws://localhost:8000/ws/inbox/96598ec0-9ee5-4e10-9948-85894cbc9fcf/");

Event Frames Sent by Server

1.
new_message
Frame

Dispatched when an inbound WhatsApp message arrives or an outbound message is created:
json
{
  "type": "new_message",
  "data": {
    "id": "c7a812e9-45bc-48d2-81e1-92fa023bf891",
    "conversation_id": "96598ec0-9ee5-4e10-9948-85894cbc9fcf",
    "sender_phone": "+14155552671",
    "content": "Hi, I have a question regarding pricing.",
    "direction": "inbound",
    "timestamp": "2026-07-24T01:25:00Z"
  }
}

2.
message_status_update
Frame

Dispatched when Meta delivers a message status webhook:
json
{
  "type": "message_status_update",
  "data": {
    "message_id": "c7a812e9-45bc-48d2-81e1-92fa023bf891",
    "status": "read"
  }
}