Skip to main content

Facilities

List Facilities

Retrieve all facilities the current user has access to.
GET /api/auth/facility
curl http://localhost:8080/api/auth/facility

Response Fields

id
string
Facility unique identifier
name
string
Facility name
num_users
integer
Total number of users in the facility
num_classrooms
integer
Total number of classrooms in the facility
dataset
object
Dataset configuration object
last_successful_sync
string
ISO 8601 timestamp of last successful sync
last_failed_sync
string
ISO 8601 timestamp of last failed sync

Get Facility

Retrieve details of a specific facility.
GET /api/auth/facility/:id
curl http://localhost:8080/api/auth/facility/facility-uuid-here

Create Facility

Create a new facility (superuser only).
POST /api/auth/facility/create_facility
curl -X POST http://localhost:8080/api/auth/facility/create_facility \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New School"
  }'

Facility Dataset Settings

Get Facility Dataset

Retrieve the dataset settings for a facility.
GET /api/auth/facilitydataset
curl "http://localhost:8080/api/auth/facilitydataset?facility_id=facility-uuid"

Query Parameters

facility_id
string
Facility UUID to get settings for

Response Fields

id
string
Dataset unique identifier
learner_can_edit_username
boolean
Whether learners can edit their own username
learner_can_edit_name
boolean
Whether learners can edit their full name
learner_can_edit_password
boolean
Whether learners can change their password
learner_can_sign_up
boolean
Whether learners can self-register
learner_can_delete_account
boolean
Whether learners can delete their own account
learner_can_login_with_no_password
boolean
Whether password-less login is enabled
show_download_button_in_learn
boolean
Whether to show download button in Learn
description
string
Facility description
location
string
Facility location
registered
boolean
Whether facility is registered with Kolibri Data Portal
preset
string
Preset type: formal, nonformal, informal

Update Facility Dataset

Update facility dataset settings.
PATCH /api/auth/facilitydataset/:id
curl -X PATCH http://localhost:8080/api/auth/facilitydataset/dataset-uuid \
  -H "Content-Type: application/json" \
  -d '{
    "learner_can_sign_up": true
  }'

Reset Facility Settings

Reset facility settings to defaults.
POST /api/auth/facilitydataset/:id/resetsettings
curl -X POST http://localhost:8080/api/auth/facilitydataset/dataset-uuid/resetsettings

Classrooms

List Classrooms

Retrieve all classrooms in a facility.
GET /api/auth/classroom
curl "http://localhost:8080/api/auth/classroom?parent=facility-uuid"

Query Parameters

parent
string
Filter by parent facility UUID
role
string
Filter by user role (e.g., “coach”)

Response Fields

id
string
Classroom unique identifier
name
string
Classroom name
parent
string
UUID of parent facility
learner_count
integer
Number of learners in the classroom
coaches
array
Array of coach user objects assigned to this classroom

Get Classroom

Retrieve details of a specific classroom.
GET /api/auth/classroom/:id
curl http://localhost:8080/api/auth/classroom/classroom-uuid-here

Create Classroom

Create a new classroom.
POST /api/auth/classroom
curl -X POST http://localhost:8080/api/auth/classroom \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Grade 5A",
    "parent": "facility-uuid-here"
  }'

Request Parameters

name
string
required
Classroom name
parent
string
required
UUID of the parent facility

Update Classroom

Update an existing classroom.
PATCH /api/auth/classroom/:id
curl -X PATCH http://localhost:8080/api/auth/classroom/classroom-uuid \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Classroom Name"
  }'

Delete Classroom

Delete a classroom.
DELETE /api/auth/classroom/:id
curl -X DELETE http://localhost:8080/api/auth/classroom/classroom-uuid-here

Learner Groups

List Learner Groups

Retrieve all learner groups in a classroom.
GET /api/auth/learnergroup
curl "http://localhost:8080/api/auth/learnergroup?parent=classroom-uuid"

Query Parameters

parent
string
Filter by parent classroom UUID

Response Fields

id
string
Learner group unique identifier
name
string
Group name
parent
string
UUID of parent classroom
user_ids
array
Array of learner UUIDs in this group

Get Learner Group

Retrieve details of a specific learner group.
GET /api/auth/learnergroup/:id
curl http://localhost:8080/api/auth/learnergroup/group-uuid-here

Create Learner Group

Create a new learner group within a classroom.
POST /api/auth/learnergroup
curl -X POST http://localhost:8080/api/auth/learnergroup \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Advanced Learners",
    "parent": "classroom-uuid-here"
  }'

Request Parameters

name
string
required
Group name
parent
string
required
UUID of the parent classroom

Update Learner Group

Update an existing learner group.
PATCH /api/auth/learnergroup/:id
curl -X PATCH http://localhost:8080/api/auth/learnergroup/group-uuid \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Group Name"
  }'

Delete Learner Group

Delete a learner group.
DELETE /api/auth/learnergroup/:id
curl -X DELETE http://localhost:8080/api/auth/learnergroup/group-uuid-here

Memberships

Memberships connect users to collections (classrooms and groups).

Create Membership

Add a user to a classroom or group.
POST /api/auth/membership
curl -X POST http://localhost:8080/api/auth/membership \
  -H "Content-Type: application/json" \
  -d '{
    "user": "user-uuid",
    "collection": "classroom-uuid"
  }'

Delete Membership

Remove a user from a classroom or group.
DELETE /api/auth/membership/:id
curl -X DELETE http://localhost:8080/api/auth/membership/membership-uuid

Roles

Roles assign permissions to users within collections.

Create Role

Assign a role to a user.
POST /api/auth/role
curl -X POST http://localhost:8080/api/auth/role \
  -H "Content-Type: application/json" \
  -d '{
    "user": "user-uuid",
    "collection": "classroom-uuid",
    "kind": "coach"
  }'

Role Kinds

  • admin - Facility administrator
  • coach - Classroom coach
  • assignable_coach - Can be assigned as coach

Delete Role

Remove a role from a user.
DELETE /api/auth/role/:id
curl -X DELETE http://localhost:8080/api/auth/role/role-uuid

Build docs developers (and LLMs) love