Rooms & Channels

Create and manage voice rooms. Connect users to them via WebSocket.

Create a room

POST /api/channels
Authorization: Bearer your_session_token
Content-Type: application/json

{ "name": "general" }

// Response 201
{ "id": 1, "name": "general" }

List rooms

GET /api/channels
Authorization: Bearer your_session_token

// Response 200
[
  { "id": 1, "name": "general" },
  { "id": 2, "name": "announcements" }
]

Join a room

Connect to the signaling server and send a join_channel message. Your app will receive the necessary messages to establish the audio connection.

// 1. Connect
const ws = new WebSocket('wss://your-api.com/ws?token=' + token);

// 2. Join a channel
ws.send(JSON.stringify({
  type: 'join_channel',
  payload: {
    channel_id: 1,
    role: 'speaker'  // or 'listener'
  }
}));

// 3. Handle signaling messages
ws.onmessage = ({ data }) => {
  const { type, payload } = JSON.parse(data);
  switch (type) {
    case 'webrtc_offer':   // Handle SDP offer
    case 'webrtc_answer':  // Handle SDP answer
    case 'ice_candidate':  // Handle ICE candidate
    case 'channel_users':  // User presence update
  }
};

Roles

RoleDescription
hostRoom creator. Can speak, cannot be forcefully muted.
speakerCan speak. Assigned when joining as 'speaker'.
listenerHear only. Cannot send audio.
guestDefault when joining. Can speak but treated as a participant.
Next: API Reference →