# List Course Enrollments

`GET https://api.suger.cloud/ai/org/{orgId}/prm/enrollment`

List course enrollments: send `courseId`, `mine=true`, or both (neither is a 400). `courseId` lists the enrollments in that course: each learner (`userName` when known, otherwise only `userId`), their organization (`organizationName`), their `status`, `percentComplete`, and when they last opened it: `lastAccessedAt` for SCORM courses, `externalState.lastOpenedAt` for external ones (native courses record no such time). For a course this organization authored it covers every partner organization's learners; for a course shared with it, only this organization's own. `courseId` is the `id` of a row from ListCourses. `mine=true` lists the calling user's own enrollments across courses (leaving out the courses of an ISV that hides Training); with `courseId` too, the caller's own enrollment in that course. For counts across every course, call GetPartnerTrainingProgress. Needs partners.read.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `courseId` | query | string | no | The course whose enrollments to list (a ListCourses row's id) |
| `mine` | query | boolean | no | true for the calling user's own enrollments |

## Responses

### 200 — Enrollments

Content-Type: `application/json`

**`CourseEnrollmentView`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `assignedByUserId` | string | no | Set when source = ASSIGNED — the partner-admin who assigned |
| `courseId` | string | no |  |
| `courseKind` | string | no | CourseKind lets a client tell an EXTERNAL enrollment from a native/scorm one without a second fetch. Three surfaces need it and had no way to ask: the journey/overview launcher (which must hand off to the external LMS rather than open the in-app player), the player itself, and the roster's "view responses" action. Without it they all silently treat an external enrollment as native and render lesson UI that does not exist. |
| `courseName` | string | no |  |
| `courseVersionId` | string | no | The PINNED version the learner is taking |
| `createTime` | string | no | Creation timestamp |
| `enrolledAt` | string | no | When the enrollment was created |
| `externalProvider` | string | no | ExternalProvider is the LMS display name for an external enrollment, so the same surfaces can say "Open in Skilljar" rather than a generic label. |
| `externalState` | ExternalState | no |  |
| `id` | string | no | ID of the ent. Unique enrollment identifier (UUID) |
| `lastAccessedAt` | string | no |  |
| `lastResetAt` | string | no | Set when progress was wiped for a certificate-renewal retake (manual or auto re-enroll); gates renewal issuance |
| `lastUpdateTime` | string | no | Last update timestamp |
| `organizationId` | string | no | Consumer org (the learner's org context); part of the uniqueness key |
| `organizationName` | string | no | OrganizationName is the learner's consumer-org name, resolved on read. Unlike the learner's display name (which a course owner can't resolve for another org's user — hence the raw-id fallback in the roster), an org's name IS globally resolvable, so the owner can always attribute a cross-org learner to their partner org. Empty if unresolved. |
| `percentComplete` | integer | no | PercentComplete 0..100 (derived from required-lesson completion). |
| `resetHistory` | array<EnrollmentResetRecord> | no | Archived progress snapshots from certificate-renewal retakes (newest last, bounded) — the assessment evidence of wiped passes |
| `scorePercent` | number | no | SCORM dashboard fields — derived from scorm_state on read; nil/0 for native courses. ScorePercent is the package-reported aggregate/single score, TimeSpentSeconds the summed normalized time, LastAccessedAt the most recent CMI write. |
| `scormState` | ScormState | no |  |
| `source` | string | no | SELF (self-enroll) \| ASSIGNED (partner-admin assigned) |
| `status` | string | no | Status: Not Started \| Opened \| In Progress \| Completed \| Failed (derived). |
| `timeSpentSeconds` | integer | no |  |
| `userId` | string | no | The learner's user id |
| `userName` | string | no | Learner display name |
| `versionNo` | integer | no | VersionNo is the PINNED version's number (course_version.version_no for this enrollment's course_version_id). Learners can sit on older versions after a re-publish, so the owner roster shows which edition each learner is taking. Resolved on read; 0 if unresolved. |

**`ExternalState`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `completedAt` | string | no |  |
| `completionCheckedAt` | string | no | CompletionCheckedAt is when the completion POLL last asked the LMS about this enrollment -- bookkeeping for the poll's queue, not a fact about the learner, and nothing derives status from it. It exists because the only way to learn of a completion by polling is one call per learner against a rate limit that belongs to the CUSTOMER, so a run takes a small slice ordered by this field and leaves the rest for the next one. Without it a run would always re-ask about the same learners and the tail would never be reached. Unlike CompletedAt this is NOT a high-water mark: it is overwritten on every check, and losing it costs one redundant call. |
| `firstOpenedAt` | string | no |  |
| `lastOpenedAt` | string | no |  |
| `openCount` | integer | no |  |

**`EnrollmentResetRecord`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `lessonStates` | object | no | LessonStates maps lessonId → progress state at reset time. |
| `quizStats` | object | no | QuizStats maps quizBlockId → the learner's attempt summary at reset time. |
| `resetAt` | string | no |  |
| `scormState` | ScormState | no |  |

**`ScormState`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `completedAt` | string | no | CompletedAt is the completion high-water mark: stamped the first time every required SCO reports complete, then never cleared. Completion is MONOTONIC — once set, the enrollment derives Completed regardless of later CMI. This matches the issue-once/never-revoke certificate: a learner who passed and earned a cert must not be downgraded to In Progress when a later re-launch re-reports an incomplete fresh attempt. |
| `scos` | object | no |  |

### 400 — Neither courseId nor mine=true, or a mine that is not true or false

Content-Type: `text/plain`

### 404 — The course is not shared with this organization

Content-Type: `text/plain`

## Example

_Generated from this operation's schema. Values are placeholders — substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.fours.com/settings/oauth-app/)._

### Request

```bash
curl -X GET 'https://api.suger.cloud/ai/org/{orgId}/prm/enrollment' \
  -H "Authorization: Bearer $SUGER_TOKEN"
```

### Response — 200

```json
[
  {
    "assignedByUserId": "01H0000000000000000000",
    "courseId": "01H0000000000000000000",
    "courseKind": "string",
    "courseName": "Acme Corp",
    "courseVersionId": "01H0000000000000000000",
    "createTime": "2026-01-31T12:00:00Z",
    "enrolledAt": "string",
    "externalProvider": "string",
    "externalState": {
      "completedAt": "string",
      "completionCheckedAt": "string",
      "firstOpenedAt": "string",
      "lastOpenedAt": "string",
      "openCount": 1
    },
    "id": "01H0000000000000000000",
    "lastAccessedAt": "string",
    "lastResetAt": "string"
  }
]
```

### Error — 400

```json
"string"
```

---

API reference: https://doc.fours.com/api/
