Skip to content

Enrollment

Enrollments are associations between users and groups or course sections. They link a user (student, teacher, or other) to a realm (group or section) and include role and status information used throughout the API.

Field Name Description Type
id Enrollment ID The Schoology assigned ID of the enrollment record. string
uid* User ID The Schoology ID of the user. string
admin* Admin Whether this user is an administrator (e.g. teacher) as opposed to a regular member (e.g. student). Values: 0 (member), 1 (admin). {0,1}
status* Status The current status of the enrollment. Values: 1 = Active, 2 = Expired, 3 = Invite pending, 4 = Request pending, 5 = Archived (course-specific pre-unenroll status). {1-5}

* = Required

View a list of enrollments (paged). Optional query parameters: uid, enrollment_status, type, picture_size. For each parameter you can specify a comma-delimited list of values (for example uid=123,456). Retrieving this endpoint without parameters returns a paged list of all enrollments in the given realm.

Return A list of enrollment objects (see Fields).

{
"enrollment": [
{
"id": "43807916",
"uid": "45552",
"school_uid": "",
"name_title": "",
"name_title_show": "0",
"name_first": "Mr.",
"name_first_preferred": "",
"name_middle": "",
"name_middle_show": "0",
"name_last": "Strickland",
"name_display": "Mr. Strickland",
"admin": 1,
"status": "1",
"picture_url": "http:\/\/..\/images\/avatar1.png",
"links": {
"self": "http:\/\/...enrollments\/43807916"
}
},
{
"id": "44783136",
"uid": "48289",
"school_uid": "s1",
"name_title": "",
"name_title_show": "0",
"name_first": "James",
"name_first_preferred": "",
"name_middle": "",
"name_middle_show": "0",
"name_last": "Howlett",
"name_display": "James Howlett",
"admin": 0,
"status": "1",
"picture_url": "http:\/\/...\/default_user.gif",
"links": {
"self": "http:\/\/...\/enrollments\/44783136"
}
}
],
"total": "2",
"links": {
"self": "http:\/\/...enrollment_status=1&start=0&limit=20"
}
}

View a specified enrollment.

Return An enrollment object (see Fields).

{
"id": "44783136",
"uid": "48289",
"school_uid": "s1",
"name_title": "",
"name_title_show": "0",
"name_first": "James",
"name_first_preferred": "",
"name_middle": "",
"name_middle_show": "0",
"name_last": "Howlett",
"name_display": "James Howlett",
"admin": 0,
"status": "1",
"picture_url": "http:\/\/..\/default_user.gif"
}

Create an enrollment.

Content An enrollment object (see Fields).

{
"uid": "2461632",
"admin": "0",
"status": "1"
}

Return The created enrollment object.

{
"id": "44783136",
"uid": "48289",
"school_uid": "s1",
"name_title": "",
"name_title_show": "0",
"name_first": "James",
"name_first_preferred": "",
"name_middle": "",
"name_middle_show": "0",
"name_last": "Howlett",
"name_display": "James Howlett",
"admin": 0,
"status": 1,
"picture_url": "http:\/\/..\/default_user.gif",
"links": {
"self": "http:\/\/...\/enrollments\/44783136"
}
}

Create an enrollment using an access code.

Content An object with access_code.

{
"access_code": "VCVKF-4MJG9"
}

Return The created enrollment object.

{
"id": "54179017",
"uid": "45552",
"school_uid": "",
"name_title": "",
"name_title_show": "0",
"name_first": "Mr.",
"name_first_preferred": "",
"name_middle": "",
"name_middle_show": "0",
"name_last": "Strickland",
"name_display": "Mr. Strickland",
"admin": 0,
"status": "1",
"picture_url": "http:\/\/...\/default_user.gif"
}

Create multiple enrollments at a time in one realm (up to 50). Wrap multiple enrollments in enrollments with each enrollment in enrollment.

Content Multiple enrollment objects (see Fields) wrapped in enrollments.

{
"enrollments": {
"enrollment": [
{
"uid": "2461632",
"admin": "0",
"status": "1"
},
{
"uid": "23453322",
"admin": "0",
"status": "1"
}
]
}
}

Return The API endpoint (location) and status for each enrollment created.

{
"enrollments": {
"enrollment": [
{
"response_code": 200,
"id": "54302505",
"uid": 248101,
"location": "http:\/\/...\/54302505"
},
{
"response_code": 200,
"id": "54302521",
"uid": 48489,
"location": "http:\/\/...\/54302521"
}
]
}
}

Create multiple enrollments across multiple realms (up to 50). Include realm (section or group) and section_id or group_id as appropriate in each enrollment object. This endpoint supports the update_existing flag.

Content Multiple enrollment objects with realm and realm-specific id fields (see Fields).

{
"enrollments": {
"enrollment": [
{
"realm": "section",
"section_id": 12345,
"status": 1,
"admin": 1,
"uid": 87942
},
{
"realm": "section",
"section_id": 98762,
"status": 1,
"admin": 0,
"uid": 87942
},
{
"realm": "group",
"group_id": 65371,
"status": 1,
"admin": 1,
"uid": 12873
}
]
}
}

Return The API endpoint (location), id, and realm info for each enrollment created.

{
"enrollments": {
"enrollment": [
{
"response_code": 200,
"location": "http:\/\/...\/54302505",
"uid": 248101,
"id": "54302505",
"realm": "section",
"realm_id": "3719526"
},
{
"response_code": 200,
"location": "http:\/\/...\/44783161",
"uid": 48489,
"id": "44783161",
"realm": "section",
"realm_id": "4318461"
}
]
}
}

POST enrollments/import/course/{grading period id}

Section titled “POST enrollments/import/course/{grading period id}”

Create and update many course enrollments at a time by grading_period_id, course_code, section_code, and school_uid. This endpoint does not require Schoology IDs for course/section/user; it requires a Schoology grading period ID (or comma-separated IDs). Importing with multiple grading period ids will apply across sections spanning those grading periods. This endpoint is for courses only (not groups).

Content Multiple enrollments (up to 50) including course_code, section_code, and school_uid. You may pass admin to mark teacher or delete to remove an enrollment.

{
"enrollments": {
"enrollment": [
{
"course_code": "E200",
"section_code": "34",
"school_uid": "test1234",
"admin": "1"
},
{
"course_code": "E200",
"section_code": "34",
"school_uid": "test456",
"admin": "0"
}
]
}
}

Return The API endpoint (location) and identifying codes for each enrollment processed.

{
"enrollments": {
"enrollment": [
{
"response_code": 200,
"location": "http:\/\/...\/54302505",
"school_uid": "s2",
"course_code": "CC106",
"section_code": "SC101"
},
{
"response_code": 200,
"location": "http:\/\/...\/54302521",
"school_uid": "s3",
"course_code": "CC106",
"section_code": "SC101"
}
]
}
}

Create and update multiple course enrollments using section_school_code and school_uid. This alternative does not require grading_period_id; instead, unique section_school_code values determine the target sections.

Content Multiple enrollments (up to 50) including section_school_code and school_uid. You may pass admin or delete.

{
"enrollments": {
"enrollment": [
{
"section_school_code": "23",
"school_uid": "test1234",
"admin": "1"
},
{
"section_school_code": "344",
"school_uid": "test456",
"delete": "1"
}
]
}
}

Return The API endpoint (location) and identifying codes for each enrollment processed.

{
"enrollments": {
"enrollment": [
{
"response_code": 200,
"location": "http:\/\/...\/54302505",
"school_uid": "s2",
"section_school_code": "SC111",
"course_code": "CC106",
"section_code": ""
},
{
"response_code": 200,
"location": "http:\/\/...\/54302521",
"school_uid": "s3",
"section_school_code": "SC111",
"course_code": "CC106",
"section_code": ""
}
]
}
}

Modify an enrollment.

Content An enrollment object (see Fields) containing the fields to update.

{
"uid": "2461632",
"status": "2"
}

Modify multiple enrollments (up to 50) by wrapping them in enrollments with each enrollment in enrollment.

Content Multiple enrollment objects (see Fields).

{
"enrollments": {
"enrollment": [
{
"id": "2461632",
"status": "2"
},
{
"id": "23453322",
"status": "2"
}
]
}
}

Return The Schoology ID of each enrollment updated, or an error message if there was a problem.

{
"enrollments": {
"enrollment": [
{
"response_code": 200,
"id": "44783151"
},
{
"response_code": 200,
"id": "44783156"
}
]
}
}

Delete an enrollment (cannot be undone).

DELETE enrollments?enrollment_ids={comma separated enrollment ids} (bulk)

Section titled “DELETE enrollments?enrollment_ids={comma separated enrollment ids} (bulk)”

Delete up to 50 enrollments. Pass comma-separated Schoology IDs in the enrollment_ids query parameter.