---
title: "API: enrollSessionHistory"
slug: "api-enrollsessionhistory"
updated: 2022-08-30T16:12:44Z
published: 2022-08-30T16:12:44Z
canonical: "support.smarteru.com/api-enrollsessionhistory"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.
# API: enrollSessionHistory
- SmarterU requires all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
- If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
- Tags are required unless specified.
## Description
The enrollSessionHistory method [enrolls users in a historical, instructor-led session](/v1/docs/adding-historical-training).
To enroll users in a historical online or SCORM course, use the [enrollmentHistoryImport](/v1/docs/api-enrollmenthistoryimport) method.
## Who Has Access
The following users have access to the enrollmentHistoryImport method:
- Users with the [Group Manager](/v1/docs/group-permission-group-manager-gm) or [Manage Group Users](/v1/docs/group-permission-manage-group-users-mgu) group permission.
- [Administrators or owners](/v1/docs/user-profile-information#access-level).
## API Call XML Package
```markup
enrollSessionHistory
- OR -
- OR -
```
##
## LearningModuleEnrollment Tag Group
The LearningModuleEnrollment tag group is a container for historical, instructor-led session enrollments.
```markup
- OR -
- OR -
```
The LearningModuleEnrollment tag contains the following.
### Enrollment
A container for the historical, instructor-led session enrollment. Refer to [Enrollment Tag Group](/v1/docs/api-enrollsessionhistory#enrollment-tag-group).
## Enrollment Tag Group
The Enrollment tag group is a container for a historical, instructor-led session enrollment.
```markup
- OR -
- OR -
```
Each enrollment is contained in an Enrollment tag and may contain the following.
### User
The user to enroll in a historical, instructor-led session. The User tag contains one of the following.
| Tag | Description |
| --- | --- |
| **Email** | The [user's email address](https://support.smarteru.com/v1/docs/user-login-information#primary-email-required-if-employee-id-not-specified). This tag is mutually exclusive with the EmployeeID tag. This is the Email returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) methods. |
| **EmployeeID** | The [user's employee ID](https://support.smarteru.com/v1/docs/user-login-information#employee-id-required-if-primary-email-not-specified). This tag is mutually exclusive with the Email tag. This is the EmployeeID returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) methods. |
### **Group**
The enrollment group.
The user you are enrolling must already be assigned to the group.
The Group tag contains one of the following.
| Tag | Description |
| --- | --- |
| **GroupName** | The [group's name](https://support.smarteru.com/v1/docs/group-group-information#name). This is mutually exclusive with the GroupID tag. This is the Name returned by the [getGroup](/v1/docs/api-getgroup) and [listGroups](/v1/docs/api-listgroups) methods. |
| **GroupID** | The [group's user-specified identifier](https://support.smarteru.com/v1/docs/group-group-information#group-id). This is mutually exclusive with the GroupName tag. This is the GroupID returned by the [getGroup](/v1/docs/api-getgroup) and [listGroups](/v1/docs/api-listgroups) methods. |
### LearningModuleID
The instructor-led course's system-generated identifier. This is the LearningModuleID returned by [listLearningModule](/v1/docs/api-listlearningmodules), and the ID returned by [getLearnerReport](/v1/docs/api-getlearnerreport).
### LearningModuleSessionID
The session's system-generated identifier. This is the CourseSessionID returned by the [listSessions](/v1/docs/api-listsessions) method.
### EnrollmentStatus
The progress status of the enrollment. Acceptable values are:
- *NotAttended* - The user did not attend the session.
- *Attended* - The user attended the session.
- *Completed* - The user attended and completed the session.
### Grade
This tag only applies if the session is graded and the EnrollmentStatus tag is set to *Completed*. The user's grade. Acceptable values will depend on the grade type:
- LetterGrade - Up to 5 characters.
- PassFail - *Pass* or *Fail*.
- Percentage - A number between 0-100.
### EnrolledDate
The date of the enrollment.
## API Response XML Package
The [API response XML package](/v1/docs/api-response-xml-package) will always include a Result, Info, and [Errors](/v1/docs/api-enrollsessionhistory#error-codes) tag.
```markup
```
The Enrollments tag is a container for the historical instructor-led session enrollments processed by the enrollSessionHistory method. Each enrollment is contained in an Enrollment tag and may contain the following.
### User
The user's identifier. This returns the [same value that was provided in the Enrollment tag group](/v1/docs/api-enrollsessionhistory#user)[](/v1/docs/api-enrollsessionhistory#enrollment-tag-group).
### LearningModuleID
The course's system-generated identifier. This returns the [same value that was provided in the Enrollment Tag group](/v1/docs/api-enrollsessionhistory#learningmoduleid)[](https://help.smarteru.com/api-enrollsessionhistory$enrollment_tag_group).
Because this method can be used to perform multiple enrollments, be sure to check the [Errors tag for error codes](/v1/docs/api-enrollsessionhistory#error-codes). It's possible for the Result tag to return *Success* even when errors are returned.
### Example API Response XML Package
Below is an example of an API response XML package.
```markup
Success
3860
```
## Error Codes
| Error Code | Message |
| --- | --- |
| ESH:01 | The Email provided is not valid. |
| ESH:02 | The EmployeeID provided is not valid. |
| ESH:03 | The GroupName provided is not valid. |
| ESH:04 | The GroupID provided is not valid. |
| ESH:05 | The LearningModuleID provided is not valid. |
| ESH:06 | The LearningModuleSessionID provided is not valid. |
| ESH:07 | The EnrollmentStatus provided is not valid. |
| ESH:09 | The Grade provided is not valid. |
| ESH:10 | The EnrolledDate provided is not valid. |
| ESH:11 | The required permissions are not met to call the enrollmentSessionHistory method. |
| ESH:12 | Enrollment [block #] - Enrolled date provided is not valid. |
| ESH:13 | Enrollment [block #] - Enrollment Status is not valid. Valid statuses are 'NotAttended', 'Attended' or 'Completed'. |
| ESH:14 | Enrollment [block #] - The Learning Module ID provided is not valid. |
| ESH:15 | Enrollment [block #] - The Learning Module Session ID provided is not valid. |
| ESH:16 | Enrollment [block #] - The Learning Module Session ID was not provided. |
| ESH:17 | Enrollment [block #] - Grade is not valid for session with grade type 'Letter Grade'. Letter Grade must be 5 characters or less. |
| ESH:18 | Enrollment [block #] - Grade is not valid for session with grade type 'Pass/Fail'. Valid values are 'Pass' and 'Fail'. |
| ESH:19 | Enrollment [block #] - Grade is not valid for session with grade type 'Percentage'. |
| ESH:20 | Enrollment [block #] - If enrollment status is Not Attended, user cannot have a grade. |
| ESH:21 | Enrollment [block #] - The email address '[user email]' is not a valid user. |
| ESH:22 | Enrollment [block #] - The employee id '[employee id]' is not a valid user. |
| ESH:23 | The group name '[group name]' is not valid. |
| ESH:24 | The group identifier '[group id]' is not valid. |
| ESH:25 | You do not have permissions to assign a user a course under the group selected. |
| ESH:26 | The user provided is already enrolled into the session. |
| ESH:27 | The course is not assigned to the learner's group. |
| ESH:28 | Historical Session enrollment failed. |
## Related
- [Adding Historical Training to a User](/adding-historical-training.md)
- [API: createHistoricalSession](/api-createhistoricalsession.md)
- [API: enrollmentHistoryImport](/api-enrollmenthistoryimport.md)
- [API: getGroup](/api-getgroup.md)
- [API: getLearnerReport](/api-getlearnerreport.md)
- [API: getUser](/api-getuser.md)
- [API: listGroups](/api-listgroups.md)
- [API: listLearningModules](/api-listlearningmodules.md)
- [API: listSessions](/api-listsessions.md)
- [API: listUsers](/api-listusers.md)