Ilmfun Docs

Schools & Rooms API

Manage educational spaces, user memberships, and real-time WebRTC rooms in Ilmfun.

Overview

Schools in Ilmfun are hierarchical spaces that can contain multiple Rooms. Users can join Schools as members, and Rooms can have granular permissions controlling who can join their WebRTC sessions.

Room Permissions (allowed_roles)

Each room now supports granular access control through the allowed_roles property. When creating or managing a room, you can specify who is permitted to join:

Owner Access: The creator of a school (the Owner) bypasses all room-level role restrictions and can join any room in their school.

Listing Rooms

To list rooms for a school, use GET /schools/{id}/rooms.

If a school is set to Public, any user (including Visitors) can list its rooms to browse the available spaces. However, joining those rooms is still strictly enforced by each room's allowed_roles configuration.

Membership & Roles

When fetching a school via GET /schools/{id}, the response includes a role field indicating the user's current membership status within that school.

{
  "id": 1,
  "name": "Global Academy",
  "is_public": true,
  "role": "Student"
}

Visitor Status: If a user is not a member of the school, the role field will be omitted entirely. Do not assume non-members have a "Visitor" role in the school_members database.