Rooms and participants
List and close rooms, send data, and manage participants and admins.
These in-room routes take the user_token from the Token API, sent as Authorization: Bearer <user_token>. Paths start with https://stream.zavryn.online/api/v1.
List endpoints take page (default 1) and per_page (default 20, maximum 100), and return { "data": [...], "pagination": { "page", "per_page", "total", "total_pages" } }.
Rooms
| Method and path | Description |
|---|---|
GET /rooms | Lists active rooms |
GET /rooms/:room_name | Returns the room and its live participants. 404 Room not found if it isn't active. |
DELETE /rooms/:room_name | Removes everyone and closes the room |
PUT /rooms/:room_name/metadata | Sets the room's metadata: { "metadata": { ... } } |
POST /rooms/:room_name/send-data | Sends data to the room |
Send data
{
"data": { "type": "chat", "message": "Hello everyone!" },
"destination_identities": ["user-456"]
}Leave out destination_identities to send to everyone. This isn't affected by locked chat.
Participants
| Method and path | Description |
|---|---|
GET /rooms/:room_name/participants/:identity | Returns one participant and their tracks |
GET /rooms/:room_name/participants/by-role?role=host | Lists connected participants with a role |
PUT /rooms/:room_name/participants/:identity/role | Changes a role. Owner only. |
DELETE /rooms/:room_name/participants/:identity | Removes a participant |
PUT /rooms/:room_name/participants/:identity/permissions | Sets can_publish, can_subscribe and can_publish_data. All are optional. |
PUT /rooms/:room_name/participants/:identity/mute | Mutes: { "audio": true, "video": false }, or { "track_sid": "TR_abc", "muted": true } |
PUT /rooms/:room_name/participants/:identity/metadata | Sets the participant's metadata |
PUT /rooms/:room_name/participants/:identity/forbid-stream | Removes the ability to publish, and keeps the role |
PUT /rooms/:room_name/participants/:identity/resume-stream | Restores the ability to publish |
To change a role, send { "actor_identity": "owner-user", "role": "admin" }.
Roles
Every role can subscribe and send data, such as chat and gifts. These are the media permissions:
| Role | Microphone | Camera | Screen share |
|---|---|---|---|
host | Yes | Yes | Yes |
admin | Yes | Yes | Yes |
guest | Yes | Yes | No |
audience | No | No | No |
visitor | No | No | No |
- In a seated room, someone who isn't on a seat can't publish, unless they're a host or admin.
live_streamrooms work differently. See Stage.audienceandvisitorhave the same permissions. The difference is yours to use.
Admins
Admins are saved on the room, so the owner can assign someone who's offline. A client asking for role: "admin" is ignored.
| Method and path | Description |
|---|---|
GET /rooms/:room_name/admins?presence=all | Lists admins. presence is all, online or offline. |
PUT /rooms/:room_name/admins/:identity | Assigns an admin. Owner only. |
DELETE /rooms/:room_name/admins/:identity | Revokes an admin. Owner only. |
{
"actor_identity": "owner-user",
"name": "Moderator",
"attributes": { "avatar": "https://example.com/mod.webp" }
}The response's applied_online is true if a connected user's permissions were updated immediately. If it's false, the assignment is still saved and applies when they next join or reconnect.
Bans
| Method and path | Description |
|---|---|
POST /rooms/ban | Bans a user |
DELETE /rooms/ban | Removes a ban: { "identity", "room_name" }. Leave out room_name to remove all of the user's bans. |
GET /rooms/bans | Lists active bans |
{
"identity": "user-789",
"room_name": "public-chat",
"reason": "Violation of community guidelines",
"duration": 3600
}Leave out room_name for a project-wide ban, and duration for a permanent one. A ban removes the user from active rooms, and they get 403 User is banned when they ask for a token.
Project info
GET /project with X-App-Id and X-App-Secret returns your project's status, limits, enabled_types and active_rooms.