Server
Server-to-server API
Signed moderation actions for your backend: kick, mute, ban and more.
Moderate from your backend without being in the room. This API signs each request with query parameters, and doesn't use the X-App-* headers.
GET https://stream.zavryn.online/api/v1/server?Action=<Action>&<params>Sign a request
Add these parameters to every request:
| Parameter | Description |
|---|---|
AppId | Your App ID |
SignatureNonce | A random value for each request |
Timestamp | The current Unix time in seconds, within 600 seconds of server time |
Signature | md5(AppId + SignatureNonce + ServerSecret + Timestamp) in lowercase hex |
import crypto from "node:crypto";
const ts = Math.floor(Date.now() / 1000);
const nonce = crypto.randomBytes(8).toString("hex");
const signature = crypto
.createHash("md5")
.update(`${appId}${nonce}${serverSecret}${ts}`)
.digest("hex");
const url =
"https://stream.zavryn.online/api/v1/server?Action=KickUser" +
`&AppId=${appId}&SignatureNonce=${nonce}&Timestamp=${ts}&Signature=${signature}` +
"&RoomId=team-meeting&UserId=user-456";
await fetch(url);Response
{ "Code": 0, "Message": "success", "RequestId": "a1b2-...", "Data": {} }Code is 0 on success. Auth failures return 401 or 403, with a message such as Invalid signature, Timestamp expired or invalid or Project is suspended. An unknown action returns 400 Unknown action.
Actions
| Action | Parameters | Description |
|---|---|---|
KickUser | RoomId, UserId | Removes a user from a room and their seat |
MuteUser | RoomId, UserId, MuteAudio (0 or 1), MuteVideo (0 or 1) | Force-mutes a user's tracks |
BanUser | UserId, optional RoomId, optional DurationSeconds | Bans a user. Without RoomId, the ban is project-wide. |
SendCustomCommand | RoomId, MessageContent, optional FromUserId, optional ToUserIds[] | Sends a custom data message to a room or to specific users |
DescribeUserList | RoomId | Lists participants: Data: { TotalCount, UserList: [{ UserId, UserName, JoinedAt }] } |