Auth modes
Every request carries at most one credential. Which one decides what the API lets you do.
| Mode | How the client gets it | Acts as |
|---|---|---|
No tokengetTokensession | A visitor: public courses only | |
credentials: 'include'LH_accesstokengetTokenauth.login() | That user, with their roles in each org | |
token: 'lh_…' | The organization, with the token's rights, capped by its creator's role | |
sessiongetSessionembed.createSession() | One learner, inside one org, on the embed routes only |
A cookie session and a bearer user token are the same mode: the API treats them identically. The tables below call both Session.
The tables were checked against a running API (OSS, single organization) with the SDK's integration suite and a probe of each method in each mode. "Yes" means the API accepts the credential; the user still needs the right role for the data (RBAC applies on top). On LearnHouse Cloud some resources also need a plan: certificates and learning paths (Pro), communities and user groups (Standard), the Admin API and API tokens (Pro).
What a refused mode returns:
| Situation | Status | err.code |
|---|---|---|
| No credential on a route that needs one | 401 | HTTP_ERROR |
| API token on a session-only route (accounts, progress, notifications…) | 403 | HTTP_ERROR |
| Embed session outside the embed routes | 403 | EMBED_SESSION_ROUTE_NOT_ALLOWED |
| Embed session for another organization | 403 | SESSION_NOT_BOUND_TO_ORG |
| User session on the Admin API | 403 | HTTP_ERROR |
Content
| Method | Anonymous | Session | API token | Embed |
|---|---|---|---|---|
orgs.getorgs.getByUuid | Yes | Yes | Yes | |
orgs.resolveDomain | Yes | Yes | Yes | Yes |
courses.listcourses.listAllcourses.countcourses.search | Yes (public courses) | Yes | Yes | No |
courses.getcourses.getByIdcourses.getMeta | Yes (public courses) | Yes | Yes | Yes |
courses.listUpdates | Yes | Yes | Yes | No |
chapters.getactivities.listForChapter | Yes | Yes | Yes | No |
chapters.listForCourseactivities.getactivities.getByIdactivities.resolve | Yes | Yes | Yes | Yes |
search.orgsearch.orgPages | Yes | Yes | Yes (search | No |
podcasts.* | Yes (public podcasts) | Yes | Yes | No |
instance.info | Yes | Yes | Yes | Yes |
orgs.get() refuses API tokens: the organizations router only takes user sessions. On a server, read the org's
courses directly with courses.list(orgSlug); auth.me() tells you the token's org_id and org_slug.
Accounts
| Method | Anonymous | Session | API token | Embed |
|---|---|---|---|---|
auth.loginauth.loginMfaauth.loginWithOAuthauth.signupauth.requestMagicLinkauth.verifyMagicLinkauth.verifyEmailauth.resendVerificationauth.requestPasswordResetauth.resetPassword | Yes (no credential is sent) | n/a | n/a | n/a |
auth.refresh | With a refresh token | n/a | No | No |
auth.me | No (401) | Yes | Yes | No |
auth.logout | No (401) | Yes | No (401) | Yes: revokes every session of that learner |
auth.mfa.* | No | Yes | No | No |
users.session | No | Yes | No | Yes |
users.getByIdusers.getByUuidusers.getByUsername | No (401) | Yes | No | Yes |
users.profile | Placeholder (id 0) | Yes | No | No |
users.updateusers.updateAvatarusers.changePasswordusers.getPreferencesusers.updatePreferencesusers.deleteAccountusers.listCourses | No | Yes | No | No |
orgs.listMineorgs.joinorgs.leave | No | Yes | No | No |
Learning
| Method | Anonymous | Session | API token | Embed |
|---|---|---|---|---|
trail.gettrail.startCoursetrail.leaveCourse | No (401) | Yes | No | No |
trail.getForOrgtrail.getCourseProgresstrail.completeActivitytrail.uncompleteActivity | No (401) | Yes | No | Yes |
assignments.getassignments.getForActivityassignments.listTasksassignments.getTask | No | Yes | Yes | Yes |
assignments.listForCourse | No | Yes | Yes | No |
assignments.listMineassignments.getMySubmissionassignments.getMyTaskSubmissionsassignments.getMyTaskSubmissionassignments.uploadTaskFileassignments.retry | No | Yes | No | Yes |
assignments.saveTaskSubmissionassignments.submit | No | Yes | Yes, with onBehalfOfUserId | Yes |
assignments.getGrade | No | Own grade | Yes | Own grade |
certificates.getcertificates.verifycertificates.getForCourse | Yes | Yes | Yes | No |
certificates.listMinecertificates.listMineForCourse | No | Yes | No | No |
paths.listpaths.listForCoursepaths.getpaths.getCertificate | Yes | Yes | Yes | No |
paths.listMinepaths.enrollpaths.leavepaths.listMyCertificates | No | Yes | No | No |
notes.*calendar.events | No | Yes | No | No |
Community and inbox
| Method | Anonymous | Session | API token | Embed |
|---|---|---|---|---|
communities.listcommunities.listAllcommunities.summary | Yes (public communities) | Yes | Yes | No |
communities.activity | No (401) | Admins only | Yes | No |
communities.getcommunities.getForCoursecommunities.listDiscussions | Yes (public communities) | Yes | No | No |
discussions.labels | Yes | Yes | Yes | Yes |
discussions.getdiscussions.listCommentsdiscussions.countCommentsdiscussions.listReactions | Yes (public communities) | Yes | No | No |
communities.createDiscussiondiscussions.updatediscussions.deletediscussions.replydiscussions.updateCommentdiscussions.deleteCommentdiscussions.votediscussions.unvotediscussions.voteCommentdiscussions.unvoteCommentdiscussions.react | No | Yes | No | No |
notifications.* | No | Yes | No | No |
usergroups.listMineusergroups.join | No | Yes | No | No |
Server side
| Method | Anonymous | Session | API token | Embed |
|---|---|---|---|---|
embed.createSession | No | No (403) | Yes (users: update | No |
admin.* | No | No (403) | Yes (see each method's right) | No |
The Agent API
lh.agent (Atlas, the learner copilot, custom agents) is an Enterprise feature with its own rules; see
Agent API security. Embed sessions reach the learner side of it.