---
category: [Administration & Integrations, Administration & Integrations/Workday API, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend, Talent & Engagement, Talent & Engagement/Training, Talent Management, Talent Management/Learning, Talent & Engagement/Training/Digital Courses, Talent & Engagement/Training/Required Courses & Lessons, Talent & Engagement/Training/Blended Courses, Talent & Engagement/Training/Lessons, Human Capital Management, Talent & Engagement/Training/LMS Course Catalog]
nav: wcp_docs
parent_url: /wcp_docs/
title: Enrollments REST API
layout: subsection
---

## <a id="section_1"></a>Overview

The <i>Enrollments</i> REST API supports the update of learning enrollments on the course offering level for course offerings containing In-Person Classroom, Virtual Classroom and Training Activity lessons. To update the lesson-level enrollment details, use the <i>Lesson Trackings</i> REST API.

The API call needs this information:

Required:

-   Enrollment ID


Optional:

-   Overall Attendance (Attended, Partially Attended, Did Not Attend, Not Entered)
-   Time Unit
-   Attendance Duration
-   Overall Score
-   Overall Grade (Pass, Fail)


The API will return these information:

-   Enrollment ID along with all fields for the enrollment.
-   A valid HTTP status code and a body. For a successful response, the body will contain the request body along with the enrollment WID. In case of failure, the body will contain an error message.


For reference documentation about the <i>Enrollments</i> REST APIs, see `learning/enrollments` in the [REST API Explorer on the Developer Site](https://developer.workday.com/rest-api-explorer) or [Workday REST Services Directory](https://community.workday.com/sites/default/files/file-hosting/restapi/index.html).

## <a id="section_2"></a>URL Base Path

<b>Tenant Base Path</b>

```
https://{tenantHostname}/api/learning/{version}/{tenantName}/ enrollments/{enrollmentID}
 
```

Example:

```
https://yourTenantHostName.com/api/learning/v1/gms/enrollments/{enrollmentID}
```

<b>Workday Extend API Gateway Base Path</b>

For Workday Extend apps, use the regional API Gateway base URL for your company. See [Reference: Workday Extend API Gateways and Authorization Base URLs](https://developer.workday.com/documentation/dlh1653340161856) on the Developer Site. Note that the API Gateway base URL doesn’t include the tenant name.

## <a id="section_3"></a>Workday Tasks

<table><thead><tr><th>Workday Task</th><th>Endpoint</th></tr></thead><tbody><tr><td><b>Manage Grading and Attendance</b></td><td>PATCH /enrollments/{enrollentID}</td></tr></tbody></table><br/>

## <a id="section_4"></a>Security Considerations

-   The enrollment data updated using the <i>Learning</i> v1 REST service is secured to the <i>Public Reporting Items</i> domain in the Tenant Non-Configurable functional area.
-   The <i>Enrollments</i> REST API is secured to the new <i>Manage: Learning Records</i> domain in the Learning Core functional area.


## <a id="section_5"></a>Integration Touchpoints

You can use the <i>Enrollments</i> REST API to update a learning enrollment event after a response from the <i>Records</i> REST API call confirms that an enrollment record with the status of <i>Not Started</i>or <i>In-Progress</i> exists for a learner for a piece of learning content.

## <a id="section_6"></a>Updating Learning Enrollments

The `PATCH /enrollments/{enrollmentID}` endpoint facilitates the updating of learning enrollments.

To update an enrolment you must include the enrollment Id in the request URL that you want to update with a request body with a single instance JSON object.

## <a id="section_7"></a>Example

This sample request updates a single enrollment.

```
PATCH /enrollments/{enrollentID}
```

Request body:

```
{
  "attendanceStstus": {
       "id": "Attendance_Status_ID=Attendance"
  },
  "score": 100,
  "grade": {
       "id": "Grade=Pass"
  },
  "attendanceDuration": {
       "durationValue": 10,
       "durationUnit": {
            "id": "Learning_Time_Unit_ID=Minutes"
        }
   }
}
 
```

## <a id="section_8"></a>Checking Validations

<table><thead><tr><th><p>Error</p></th><th><p>Error Code</p></th><th><p>Solution</p></th></tr></thead><tbody><tr><td><p>If the enrollment has attendance status of Attended or Partially Attended and has a time unit associated with it the attendance duration must be greater than 0.</p></td><td><p>Attendance Duration must be greater than 0 if Time Unit is entered and Attendance Status is Attended or Partially Attended. - A3004</p></td><td><p>Ensure the attendance duration is greater than 0 if there is a time unit on the enrollment and the attendance status is Attended or Partially Attended.</p></td></tr><tr><td><p>An enrollment cannot have an attendance duration if it has the attendance status of Not Entered or Did Not Attend.</p></td><td><p>Attendance Duration must be 0 if Attendance Status is Not Entered or Did not Attend. - A3007</p></td><td><p>Ensure attendance duration is set to 0 or not set at all if attendance status is Not Entered or Did Not Attended.</p></td></tr><tr><td><p>An enrollment has to have attendance status of Attended or Partially Attended or Not Entered or Did not Attend to have attendance duration set.</p></td><td><p>To specify time unit and attendance duration for an enrollment, ensure that the attendance status is set to Attended or Partially Attended or Not Entered or Did not Attend. - A3008</p></td><td><p>Ensure attendance status of enrollment is Attended or Partially Attended or Not Entered or Did not Attend to set time unit and duration.</p></td></tr><tr><td><p>An enrollment must have a time unit if the attendance duration is greater than 0.</p></td><td><p>Specify a duration unit when the attendance duration is greater than 0. - A3043</p></td><td><p>Ensure the time unit is entered if attendance duration is greater than 0.</p></td></tr><tr><td><p>An enrollment can’t have a duration unit if the attendance status is Did Not Attend or Not Entered.</p></td><td><p>Attendance Duration Unit Must be Null if Attendance Status is Not Entered or Did not Attend. - A3042</p></td><td><p>Ensure enrollment time unit is set to null if attendance status is set to Did Not Attend or Not Entered.</p></td></tr><tr><td><p>An enrollment must have a duration value greater than 0 if the duration unit is set.</p></td><td><p>Specify an attendance duration value greater than 0 when you specify a duration unit. - A3044</p></td><td><p>Ensure attendance duration is greater than 0 if a time unit is present.</p></td></tr><tr><td><p>An enrollment must not be rescinded and grading or attendance tracking must be active to update an enrollment.</p></td><td><p>Enrollment must not be rescinded and grading or attendance tracking have to be enabled. - A3006</p></td><td><p>Ensure enrollment is not rescinded and grading or attendance tracking is enabled for the enrollment.</p></td></tr><tr><td><p>An enrollment can only have attendance duration set if there is at least 1 ILT lesson on the enrollment.</p></td><td><p>To specify time and attendance duration for an enrollment, ensure that the course offering contains at least 1 instructor led lesson. - A3005</p></td><td><p>Ensure the enrollment has at least 1 ILT lesson to set attendance duration.</p></td></tr><tr><td><p>Attendance Status can only be Attended or Did Not Attend or Not Entered or Partially Attended.</p></td><td><p>Invalid id for field</p></td><td><p>Ensure attendance status is equal to Attended or Did Not Attend or Not Entered or Partially Attended.</p></td></tr><tr><td><p>Grades can only be Pass or Fail.</p></td><td><p>Invalid id for field</p></td><td><p>Ensure grade is equal to Pass or Fail.</p></td></tr><tr><td><p>The Duration Unit can only be Days, Hours, Minutes or Weeks.</p></td><td><p>Invalid id for field</p></td><td><p>Ensure the duration unit is equal to Days, Hours, Minutes or Weeks.</p></td></tr></tbody></table><br/>

## <a id="section_9"></a>Limitations

The <i>Enrollments</i> REST API doesn’t support bulk updates. You can update only 1 enrollment per request.

## <a id="section_10"></a>Common Errors

<table><thead><tr><th>Error</th><th>Error Code</th><th>Cause and Solution</th></tr></thead><tbody><tr><td>Missing Required Field Malformed Syntax Invalid Data Value</td><td>400 Bad Request</td><td>Check the syntax of the request body, identify required fields.</td></tr><tr><td>Authentication Failed</td><td>401 Unauthorized</td><td>Ensure your request headers contain a valid and unexpired API key or bearer token</td></tr></tbody></table><br/>

### Related Information

[Learning REST Web Service](https://doc.workday.com/release-notes/en-us/lrn/9234679.html)

