Expire Student Course Access
The expireStudentCourseAccess
mutation allows you to mark a student’s course access as expired while retaining their course data. This is useful when you want to temporarily revoke a student’s access without removing their progress and enrollment records.
Input Parameters
Field | Type | Description |
---|---|---|
userId | String! | ID of the student (User) whose access should be expired |
courseId | String! | ID of the course to expire access for |
customEndedAt | Int | Custom expiration date (Unix Timestamp). Defaults to current time |
reason | String | Optional reason for expiring the access |
Return Fields
The updated enrollment with expired access(StudentCourseShip).
Field | Type | Description |
---|---|---|
id | String! | id of the enrollment |
completionRate | Float | the completion rate of the enrolled course which student achieved |
course | AdminCourse! | information of the enrolled course |
user | AdminUser! | user information of the enrolled course |
updatedAt | Int! | last updated date of the enrollment |
createdAt | Int! | created date of the enrollment |
endedAt | Int | expiration date for the enrollment (Unix Timestamp) |
type ExpireStudentCourseAccessPayload { enrollment { id completionRate course { id slug } user { id name email } endedAt }}
Example
mutation { expireStudentCourseAccess( userId: "a1b2c3d4-5678-90ef-ghij-klmnopqrstuv" courseId: "ab6ee332-614d-475d-93b5-abc5ebb1fc84" ) { enrollment { id course { id slug } user { id name } endedAt } }}
Sample Response
{ "data": { "expireStudentCourseAccess": { "enrollment": { "id": "619ad939-8591-40ad-9364-cf3825a9bf70", "completionRate": 0.25, "createdAt": 1672531200, "updatedAt": 1747297936, "endedAt": 1747297936, "course": { "id": "9a1216f7-36de-4c50-8094-2ebfb7d3c383", "slug": "course-slug" }, "user": { "id": "387b0c87-0f85-44cc-833e-7306c1b5d3e6", } } } }}