Enroll
B2B Learn
Enroll
Enroll the header learner in a listed, in-org course.
Auth: portal API key + X-Learner-Email header (see module docstring).
Idempotent: a repeat enroll does not error or reset progress; it bumps
last_opened_at and returns the existing enrollment_id + current
completion_pct.
404 (opaque, no oracle) whenever the course cannot be enrolled into:
course not found, not listed in the caller's org catalog, wrong owner,
cross-org, or unverified when the org requires verification. All of these
collapse to the same "Course not found" response so a caller cannot probe
catalog visibility rules by watching the error vary.
Returns 200 {enrollment_id: int, completion_pct: float} (0.0 on first
enroll).
POST
Enroll