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​
| Header | Required | Description |
|---|---|---|
VF-ORG-ID | Yes | Your organization ID |
URL Parameters​
| Parameter | Description |
|---|---|
roomId | The 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​
| Field | Type | Description |
|---|---|---|
roomId | string | The room that was destroyed |
participantsDisconnected | number | How many participants were kicked |
wasRecording | boolean | Whether recording was active (now stopped) |
endedAt | string | When the room was closed (ISO date) |
What Happens​
When you destroy a room:
- All participants are disconnected — Everyone gets booted immediately
- Recording stops — Any active recording is stopped and saved
- Room is marked as ended — Cannot be rejoined
- Recordings become available — Download them within 6 hours
Errors​
| Status | Message | Description |
|---|---|---|
| 400 | Missing roomId | roomId parameter is required |
| 404 | Room not found | Room doesn't exist or belongs to another org |
| 410 | Room already ended | Room 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​
- Confirm before destroying — This is irreversible, so ask for confirmation in UIs
- Log the action — Record who ended the room and why for audit purposes
- Save recordings first — If you need the recording, make sure it's saved before cleanup
- 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.