Skip to main content
The enrollments endpoint lets you assign a course to a student. Assigning does two things at once: it records a course grant (the access itself, the same thing the dashboard’s “Assign course” does) and creates an enrollment so the course appears in the student’s My Learning immediately. You can call this endpoint multiple times for the same student and course, it is idempotent. Both the student and the course must exist in your academy, and the course must be published.

Enroll a student

Path parameters

string
required
UUID of the student to enroll. The student must already be a member of your academy, add them first using POST /api/v1/students if needed.

Body parameters

string
required
UUID of the course to enroll the student in. The course must belong to your academy and be published. Draft courses return a 400 error.

Constraints

  • The student identified by studentId must be an active member of your academy. A 404 is returned if they are not found.
  • The course identified by course_id must exist in your academy and have a published status. A 404 is returned if it does not exist; a 400 is returned if it exists but is not published.

Response fields

Returns the enrollment record with a 201 status code.
object
required

Example request

Example response

Error responses


Revoke an enrollment

Revokes an assigned course: ends the student’s course grant and marks the enrollment record as revoked (the record is preserved). Re-assigning later through POST /api/v1/students/:studentId/enrollments restores access on the same record. Access in Fayne is layered. If the course is free for everyone, was purchased by the student, or is covered by an offer they hold, revoking the assignment does not lock the course. The response tells you whether the student can still open the course after the revoke, so your automation never has to guess.

Path parameters

string
required
UUID of the student whose enrollment you are revoking.
string
required
UUID of the enrollment record to revoke. This is the id returned when the enrollment was created.

Response fields

object
required

Example request

Example response

Error responses