WebSocket /v1/ws

Reference for connecting to the Blendlix Call Service WebSocket signaling endpoint.

WebSocket /v1/ws

The WebSocket endpoint is used for realtime call signaling.

URL

wss://rtc-svc.blendlix.com/v1/ws

Browser authentication

Browser clients should use the jwt subprotocol:

const ws = new WebSocket('wss://rtc-svc.blendlix.com/v1/ws', ['jwt', sessionToken])

Server-side authentication

Server-side clients may use:

Authorization: Bearer <session_token>

Successful connection event

After authentication, the client receives:

{
  "event": "auth.ok",
  "success": true,
  "data": {
    "socket_id": "socket-id",
    "user_id": "caller-123",
    "role": "caller",
    "display_name": "Caller One"
  }
}

Event envelope

All client-to-service messages use this shape:

{
  "event": "call.invite",
  "request_id": "req-1",
  "data": {}
}

Common events

EventDirectionPurpose
call.inviteclient to serviceStart ringing the receiver.
call.ringingservice to receiverIncoming call notification.
call.acceptclient to serviceAccept a ringing call.
call.acceptedservice to participantNotify the other participant that the call was accepted.
call.rejectclient to serviceReject a ringing call.
call.rejectedservice to participantNotify the other participant that the call was rejected.
call.cancelclient to serviceCaller cancels before answer.
call.canceledservice to participantNotify the receiver that the call was canceled.
call.connectedclient/serviceMark a call as connected.
call.endclient to serviceEnd an active call.
call.endedservice to participantNotify the other participant that the call ended.
call.missedservice to participantRinging timeout reached.
call.errorservice to clientThe request failed.
webrtc.offerparticipant to participantSend WebRTC offer.
webrtc.answerparticipant to participantSend WebRTC answer.
webrtc.ice_candidateparticipant to participantSend ICE candidate.

Error envelope

{
  "event": "call.error",
  "request_id": "req-1",
  "success": false,
  "error": {
    "code": "CALL_INVALID_STATE",
    "message": "call can only be accepted while ringing"
  }
}