Enroll a user in a Brightspace course offering via the Valence enrollment API

domain: docs.valence.desire2learn.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Authenticate via OAuth 2.0 to obtain a bearer token with the appropriate enrollment management scope for the Brightspace tenant
  2. Resolve the target user's Brightspace userId by calling GET /d2l/api/lp/{ver}/users/?userName={username} if you only have a username or email
  3. Resolve the courseOfferingId (OrgUnitId) for the target course offering via GET /d2l/api/lp/{ver}/orgstructure/?orgUnitType=3 or by known ID
  4. POST /d2l/api/lp/{ver}/enrollments/ with a JSON body containing OrgUnitId, UserId, and RoleId (e.g., 110 for Student role) to create the enrollment
  5. Confirm the 200 response body contains the enrollment details including the resolved role and org unit; a 409 indicates the user is already enrolled
  6. To unenroll, DELETE /d2l/api/lp/{ver}/enrollments/orgUnits/{orgUnitId}/users/{userId} to remove the enrollment without deleting the user or course

Known gotchas

Related routes

Implement the Brightspace Valence OAuth 2.0 Authorization Code grant with refresh tokens for a user-facing application
education · 5 steps · unrated
Retrieve a Brightspace learner's scheduled and overdue content items across their courses via the Valence Content API myItems endpoints
education · 5 steps · unrated
Retrieve a Brightspace course's content structure (modules and topics) via the Valence Content API
education · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans