Overview
The OneRoster client provides access to the OneRoster 1.2 API, supporting:- Rostering: Users, orgs, schools, courses, classes, enrollments
- Gradebook: Categories, line items, results, score scales
- Assessment: Assessment line items and results
- Resources: Learning resources linked to courses
Installation
Quick Start
Rostering
Users
| Method | Returns | Description |
|---|---|---|
list() | PageResult | List users (supports where filter) |
first() | User | undefined | Get first matching user |
listAll() | User[] | Fetch all pages |
get() | User | Get user by ID |
exists() | boolean | Check if user exists (lightweight) |
create() | CreateResponse | Create user (returns sourcedIdPairs) |
update() | void | Update user (throws if not found) |
upsert() | void | Create or update user |
delete() | void | Delete user |
exists(), update(), and upsert() are available on all writable OneRoster resources.update(id, data): strict (throws if the resource doesn’t exist)upsert(id, data): loose (creates the resource if it doesn’t exist)exists(id): lightweight existence check
Scoped User Operations
Access user-specific data using the callable pattern:Students & Teachers
Dedicated read-only resources for role-specific queries:Schools & Organizations
Courses & Classes
Enrollments
Terms & Academic Sessions
Demographics
Gradebook
Gradebook resources are top-level on the client:For gradebook + assessment resources, write methods return the entity:
update(id, data): strict (throws on 404), returns entityupsert(id, data): loose (creates/updates), returns entity
void.| Resource family | update() / upsert() return |
|---|---|
| Rostering + Resources | void |
| Gradebook + Assessment | Updated entity |
Resources
Pagination
Alllist() methods return PageResult<T> with { data, hasMore, total, nextOffset }.
| Method | Returns | Description |
|---|---|---|
list() | PageResult<T> | Single page with pagination info |
listAll() | T[] | Auto-fetches all pages |
stream() | AsyncIterable<T> | Memory-efficient streaming iterator |
Filtering
Use thewhere parameter to filter results:
Error Handling
Next Steps
EduBridge
Simplified analytics queries
Caliper
Learning event tracking
Types
OneRoster type definitions