Skip to main content

Destroy Room

DELETE /v1/room/:roomId

End a classroom session immediately. This disconnects all participants and closes the room permanently.

Irreversible Action

Once you destroy a room, it cannot be reopened. All participants will be disconnected, and new join attempts for this roomId will fail. Crucially, you cannot create a new room using the same roomId. You must create a new room with a different ID if you need to start another session.

When to Use This​

  • Force-end classes — When a teacher forgets to end a class properly
  • Emergency shutdown — Quickly close a room with problematic content
  • Cleanup — End rooms that are stuck or have issues
  • Automation — Scheduled room cleanup after a time limit

Request​

Headers​

HeaderRequiredDescription
VF-ORG-IDYesYour organization ID

URL Parameters​

ParameterDescription
roomIdThe room to destroy

Example Request​

curl -X DELETE https://api.verriflo.com/v1/room/math-101 \
-H "VF-ORG-ID: your-organization-id"

Response​

Success (200)​

{
"success": true,
"message": "Room destroyed successfully",
"data": {
"roomId": "math-101",
"participantsDisconnected": 15,
"wasRecording": true,
"endedAt": "2024-01-15T11:30:00.000Z"
}
}

Response Fields​

FieldTypeDescription
roomIdstringThe room that was destroyed
participantsDisconnectednumberHow many participants were kicked
wasRecordingbooleanWhether recording was active (now stopped)
endedAtstringWhen the room was closed (ISO date)

What Happens​

When you destroy a room:

  1. All participants are disconnected — Everyone gets booted immediately
  2. Recording stops — Any active recording is stopped and saved
  3. Room is marked as ended — Cannot be rejoined
  4. Recordings become available — Download them within 6 hours

Errors​

StatusMessageDescription
400Missing roomIdroomId parameter is required
404Room not foundRoom doesn't exist or belongs to another org
410Room already endedRoom was already destroyed

Examples​

JavaScript: Admin Panel​

async function forceEndClass(roomId) {
if (
!confirm(`Are you sure you want to end "${roomId}"? This cannot be undone.`)
) {
return;
}

const response = await fetch(`https://api.verriflo.com/v1/room/${roomId}`, {
method: "DELETE",
headers: { "VF-ORG-ID": process.env.VERRIFLO_ORG_ID },
});

const data = await response.json();

if (data.success) {
showToast(
`Room ended. ${data.data.participantsDisconnected} participants disconnected.`
);
} else {
showError(data.message);
}
}

Python: Scheduled Cleanup​

import requests
import os
from datetime import datetime, timedelta

def cleanup_old_rooms(max_duration_hours: int = 4):
"""End rooms that have been running too long."""

active_rooms = get_active_rooms() # Your function to get active rooms

for room in active_rooms:
started_at = datetime.fromisoformat(room['startedAt'].replace('Z', '+00:00'))
running_hours = (datetime.now() - started_at).total_seconds() / 3600

if running_hours > max_duration_hours:
response = requests.delete(
f"https://api.verriflo.com/v1/room/{room['roomId']}",
headers={'VF-ORG-ID': os.environ['VERRIFLO_ORG_ID']}
)

if response.ok:
print(f"Ended room {room['roomId']} after {running_hours:.1f} hours")

Best Practices​

  1. Confirm before destroying — This is irreversible, so ask for confirmation in UIs
  2. Log the action — Record who ended the room and why for audit purposes
  3. Save recordings first — If you need the recording, make sure it's saved before cleanup
  4. Use unique room IDs — Always generate unique IDs (e.g., math-101-2024-01-15) for each session. Attempting to create a room with an ID that has been used before (even if destroyed) will result in an error.

Tip: Instead of reusing room IDs, create new ones for each session. This avoids conflicts and makes it easier to track class history.