Rooms / Sessions API
Everything on MediaSFU runs inside a room — meetings, calls and AI agents all start here.
Endpoint: https://mediasfu.com/v1/rooms
Authenticate with Authorization: Bearer <api-username>:<api-key> from your server. Try every action and copy the request in the API Sandbox.
Create a room
POST https://mediasfu.com/v1/rooms with action: "create"
Spin up a new meeting, webinar, broadcast or recording room.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
userName | text | Host username. Who owns the room. Must be unique among your active rooms. | "host" |
duration | number (5–1440) | Duration (minutes). How long the room stays open before it auto-closes. | 30 |
capacity | number (1–500000) | Capacity. Maximum people allowed in at once. Capped by the room type. | 5 |
eventType | conference, webinar, broadcast, chat | Room type. Shapes who can speak and how many can join. | "conference" |
Optional: Scheduling & access
Add these to schedule ahead or set your own room ID / secure code.
| Field | Type | Description | Default |
|---|---|---|---|
scheduledDate | date (ISO 8601) | Scheduled start. When the room should open. Defaults to now. | |
meetingID | text | Room ID. The room to act on. Starts with d, p or s. Leave blank on create to auto-generate. | |
secureCode | text | Secure code. Host's secret for privileged actions. Auto-generated if left blank. |
Optional: Recording
Add these only if you want the session recorded.
| Field | Type | Description | Default |
|---|---|---|---|
recordingParams.recordingAudioSupport | boolean | Record audio | true |
recordingParams.recordingVideoSupport | boolean | Record video | true |
recordingParams.recordingHLSSupport | boolean | HLS stream. Also produce an HLS live stream of the room. | false |
recordingParams.recordingPreferredOrientation | landscape, portrait, neutral | Recording orientation | "landscape" |
recordOnly | boolean | Recording-only room. No live participants — the room exists purely to capture a recording. | false |
Optional: Room controls
Add these to change what participants may do by default.
| Field | Type | Description | Default |
|---|---|---|---|
meetingRoomParams.audioSetting | allow, approval, disallow | Microphone. Whether participants may turn on their mic. | "allow" |
meetingRoomParams.videoSetting | allow, approval, disallow | Camera | "allow" |
meetingRoomParams.screenshareSetting | allow, approval, disallow | Screen share | "allow" |
meetingRoomParams.chatSetting | allow, disallow | Chat | "allow" |
meetingRoomParams.targetResolution | sd, hd, fhd, qhd, QnHD | Max resolution (participants) | "hd" |
meetingRoomParams.addCoHost | boolean | Allow co-hosts | false |
Optional: Telephony / SIP
Add these to let phone callers dial into the room.
| Field | Type | Description | Default |
|---|---|---|---|
supportSIP | boolean | Enable SIP. Let phone/SIP callers dial into this room. | false |
directionSIP | both, inbound, outbound | SIP direction | "both" |
curl -X POST https://mediasfu.com/v1/rooms \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"create","userName":"host","duration":30,"capacity":5,"eventType":"conference"}'
Example response:
{
"success": true,
"message": "Room created successfully",
"roomName": "s9x2k7mp4q81ab3c",
"userName": "host",
"displayName": "host",
"secureCode": "<host secure code>",
"publicURL": "https://<node>.mediasfu.com/meet/s9x2k7mp4q81ab3c/<host token>",
"link": "https://<node>.mediasfu.com",
"scheduledDate": "2026-10-26T14:00:00.000Z",
"roomStatus": "ready",
"allocationPending": false,
"secret": "<room secret>"
}
Join a room
POST https://mediasfu.com/v1/rooms with action: "join"
Get a join link/token for an existing room.