Names & Roles (Roster Sync)
Make sure you've read about authenticating API requests before proceeding to the guide below.
The Memberships endpoint accepts both the ltik based and service key based API authentication methods.
The LTI® protocol allows you to retrieve roster information for an LMS context through the Names and Roles Provisioning service (NRPS). Users that are part of an LMS context are called members, and the Names and Roles Provisioning service exposes each member's identifier, optional name and email, list of LTI® roles within the context, and active/inactive status. LTIAAS gives you access to this service through the /api/memberships API endpoint.
This flow shows the end-to-end pattern for keeping a roster in sync between an LMS and your tool: deciding when to trigger the sync, checking that the service is available in the current launch context, paginating over the membership list, mapping LTI® roles to your tool's own role model, and upserting each member into your application's database.
Your application triggers the sync
Step 1 of 6The Names and Roles Provisioning service is pull-based — the LMS will not push notifications to your tool when students enroll or drop out of a course. Your application decides when to refresh the roster, and the right trigger depends on how fresh the roster needs to be and how big your courses are. Common triggers include a "Sync class roster" button on the teacher's dashboard, a sync on every launch, a nightly cron job that uses the stored serviceKey, or a just-in-time sync when a previously unknown student first launches into your tool.
// Inside your "sync roster" handler
const ltik = req.session.ltik // captured during the most recent launch
await syncRoster(ltik)
Stale rosters are a common source of support tickets. It's recommended to surface the "last synced" timestamp prominently in the teacher's view and make the refresh action easy to discover, so that a teacher noticing a missing student can fix it themselves rather than escalating to support.
What's next
- Launch + idtoken SSO flow — the same identity model (
platform.id+user.id) you use here is established at launch time. - Grade Passback flow — now that you know which students belong to the class, submit their scores to the gradebook.
- Async / Service-Key Grading flow — use the stored
serviceKeyto refresh rosters from a cron job, outside of a live launch.
