Skip to main content

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​

FieldTypeDescriptionDefault
userNametextHost username. Who owns the room. Must be unique among your active rooms."host"
durationnumber (5–1440)Duration (minutes). How long the room stays open before it auto-closes.30
capacitynumber (1–500000)Capacity. Maximum people allowed in at once. Capped by the room type.5
eventTypeconference, webinar, broadcast, chatRoom 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.

FieldTypeDescriptionDefault
scheduledDatedate (ISO 8601)Scheduled start. When the room should open. Defaults to now.
meetingIDtextRoom ID. The room to act on. Starts with d, p or s. Leave blank on create to auto-generate.
secureCodetextSecure code. Host's secret for privileged actions. Auto-generated if left blank.

Optional: Recording​

Add these only if you want the session recorded.

FieldTypeDescriptionDefault
recordingParams.recordingAudioSupportbooleanRecord audiotrue
recordingParams.recordingVideoSupportbooleanRecord videotrue
recordingParams.recordingHLSSupportbooleanHLS stream. Also produce an HLS live stream of the room.false
recordingParams.recordingPreferredOrientationlandscape, portrait, neutralRecording orientation"landscape"
recordOnlybooleanRecording-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.

FieldTypeDescriptionDefault
meetingRoomParams.audioSettingallow, approval, disallowMicrophone. Whether participants may turn on their mic."allow"
meetingRoomParams.videoSettingallow, approval, disallowCamera"allow"
meetingRoomParams.screenshareSettingallow, approval, disallowScreen share"allow"
meetingRoomParams.chatSettingallow, disallowChat"allow"
meetingRoomParams.targetResolutionsd, hd, fhd, qhd, QnHDMax resolution (participants)"hd"
meetingRoomParams.addCoHostbooleanAllow co-hostsfalse

Optional: Telephony / SIP​

Add these to let phone callers dial into the room.

FieldTypeDescriptionDefault
supportSIPbooleanEnable SIP. Let phone/SIP callers dial into this room.false
directionSIPboth, inbound, outboundSIP 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​

FieldTypeDescriptionDefault
userNametextHost username. Who owns the room. Must be unique among your active rooms."host"
meetingIDtextRoom 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.

FieldTypeDescriptionDefault
secureCodetextSecure 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.

FieldTypeDescriptionDefault
meetingIDtextRoom ID. The room to act on. Starts with d, p or s. Leave blank on create to auto-generate.
eventStatus"" (any), active, inactiveStatus filter""
startIndexnumberStart index0
pageSizenumber (1–100)Page size20
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​

FieldTypeDescriptionDefault
meetingIDtextRoom 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.