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,
"roomName": "m-9f3a2b7c",
"meetingID": "m-9f3a2b7c",
"secureCode": "A1B2C3",
"publicURL": "https://mediasfu.com/meeting/m-9f3a2b7c"
}
Join a room
POST https://mediasfu.com/v1/rooms with action: "join"
Get a join link/token for an existing room.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
userName | text | Host username. Who owns the room. Must be unique among your active rooms. | "host" |
meetingID | text | Room ID. The room to act on. Starts with d, p or s. Leave blank on create to auto-generate. |
Optional: Access
Add the secure code if the room requires one.
| Field | Type | Description | Default |
|---|---|---|---|
secureCode | text | Secure code. Host's secret for privileged actions. Auto-generated if left blank. |
curl -X POST https://mediasfu.com/v1/rooms \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"join","userName":"host","meetingID":"d1a2b3c4"}'
List / get rooms
GET https://mediasfu.com/v1/rooms with action: "get"
List your rooms, or fetch one by ID. No body — everything is optional.
No fields are required.
Optional: Filters
All optional. Give a Room ID for one room, or page through the list.
| Field | Type | Description | Default |
|---|---|---|---|
meetingID | text | Room ID. The room to act on. Starts with d, p or s. Leave blank on create to auto-generate. | |
eventStatus | "" (any), active, inactive | Status filter | "" |
startIndex | number | Start index | 0 |
pageSize | number (1–100) | Page size | 20 |
curl "https://mediasfu.com/v1/rooms?action=get" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY"
Example response:
{
"success": true,
"rooms": [
{
"meetingID": "m-9f3a2b7c",
"startedAt": 1767225600000,
"endedAt": null,
"recordStartedAt": null,
"recordEndedAt": null,
"duration": null,
"scheduledDate": 1767225000000,
"passCode": "A1B2C3",
"capacity": 100,
"recordOnly": false,
"eventVideoUsage": 12.5,
"eventAudioUsage": 30.2,
"eventScreenUsage": 0,
"hasUsageLogs": true,
"hasMessages": true,
"hasRecordUsageLogs": false
}
],
"total": 1,
"startIndex": 0,
"pageSize": 20
}
Room statistics
GET https://mediasfu.com/v1/rooms with action: "stats"
Account and API-key environment counts: active, future scheduled, overdue, unscheduled, ended and cancelled. Database state, not live media presence; excludes archives.
No fields are required.
curl "https://mediasfu.com/v1/rooms" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY"
Delete a room
POST https://mediasfu.com/v1/rooms with action: "delete"
End and remove a room by ID.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
meetingID | text | Room ID. The room to act on. Starts with d, p or s. Leave blank on create to auto-generate. |
curl -X POST https://mediasfu.com/v1/rooms \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"delete","meetingID":"d1a2b3c4"}'
See errors and response format for failure handling.