Join a call room
Upgrade to a WebSocket as either Contact in a live Call. This socket is signaling only: every frame is JSON text and media never passes through it. Each participant sends join when the socket opens, and again after any reconnect; the callee answers a ringing Call by sending join. Relay answers every join with iceServers, the STUN and TURN servers for the RTCPeerConnection, then roomState. Each participant then sends an offer publishing a WebRTC track named audio, and later one adding a track named video the first time its camera turns on; Relay returns answer. After applying that answer, send connected only when the RTCPeerConnection connectionState is connected. Once both participants have published and reported connected, Relay pulls every track each participant has published into the other Cloudflare SFU Session, one at a time, and sends that participant an offer naming the track; answer it with answer to complete renegotiation. A participant whose PeerConnection is dead sends offer with restart: true from a new PeerConnection: Relay moves it onto a new SFU Session, the Call stays in progress, and both directions are pulled again after it sends connected. The room is scoped to the Call and accepts only its authenticated user or agent Contact. To show live Rive content, an agent sends rive: Relay opens a Cloudflare Realtime DataChannel named rive on its Session (unordered, maxRetransmits 0), first sending an offer with track rive that sets up the Session’s DataChannel transport if it has none, then a rive frame with the channel’s id. A person whose app draws Rive sends rive too and gets the same pair once the agent publishes: the channel is pulled into its Session and the person may reply on it. Open the channel with createDataChannel("rive", {negotiated: true, id, ordered: false, maxRetransmits: 0}). After a restart onto a new Session, Relay opens it again with a new id.
curl --request GET \
--url https://api.staging.relayapp.im/v1/calls/{callId}/room \
--header 'Authorization: Bearer <token>' \
--header 'Upgrade: <upgrade>'{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}Authorizations
Bearer token authentication. Include your API token in the Authorization header.
Format: Authorization: Bearer <your-token>
Headers
"websocket"Path Parameters
Response
WebSocket upgrade accepted. See x-relay-call-room-frames for frame schemas.
curl --request GET \
--url https://api.staging.relayapp.im/v1/calls/{callId}/room \
--header 'Authorization: Bearer <token>' \
--header 'Upgrade: <upgrade>'{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}
