Within the getLearningPath query, you’ll find a userEnrolled field that indicates whether the user is currently enrolled in the Learning Path. If this field is set to false, the user must be enrolled before they can begin the learning path.
The Learning Path enrollment process applies only to users who are not yet enrolled.
There are two supported enrollment types:
  • Self-enrollment – available only for public Learning Paths
  • Manager enrollment – available for both public and private Learning Paths

🧍 Self-Enrollment

For public Learning Paths, you can use the ENROLL_LP CTA data to render an Enroll button on the Learning Path Homepage. When the user clicks this button, the client should execute the createLpIndividualMembership mutation using the lpId from the ENROLL_LP CTA.
mutation createLpIndividualMembership {
  createLpIndividualMembership(lpId: 40) {
    response {
      cta {
        actionId
        arguments {
          key
          value
        }
      }
    }
  }
}
In the response, you’ll receive the list of CTAs currently available for the Learning Path.
In this case, you’ll see only the VIEW_LP CTA, which indicates that the user should now be redirected to the LP HP or the page should be refreshed to load updated data from the API.
Here’s how the self-enrollment process appears in our learner area:

👥 Enrollment by Manager

The enrollment process for managers follows the same flow as self-enrollment, with one key difference: The user making the API call must have the appropriate scope—such as ADMINISTRATOR—to enroll others into public or private Learning Paths. To enroll another user, the administrator must execute the createLpIndividualMembership mutation, passing the target user’s userContextId. If the client platform does not store userContextId, it can be retrieved by calling the getUserContext query using the user’s UUID.
mutation createLpIndividualMembership {
  createLpIndividualMembership(lpId: 40, userContextId: 242) {
    response {
      cta {
        actionId
        arguments {
          key
          value
        }
      }
    }
  }
}
Here’s how the enrollment by manager process appears in our learner area:

🔄 Unenroll Users from Learning Path

In general, the unenrollment process follows the same rules and behavior as enrollment, with the same types:
  • Self-unenrollment – available only for public Learning Paths
  • Manager unenrollment – available for both public and private Learning Paths
Below is an example of an unenrollment query for the Self-unenrollment type:
mutation removeLpIndividualMembership {
    removeLpIndividualMembership(lpId:40) {
        errors
        response
    }
}
An additional query example for the Manager unenrollment type:
The user making the API call must have the appropriate scope—such as ADMINISTRATOR—to unenroll others from public or private Learning Paths.
The user making the API call must have the appropriate scope—such as ADMINISTRATOR—to unenroll others from public or private Learning Paths.
mutation removeLpIndividualMembership {
    removeLpIndividualMembership(lpId:40, userContextId: 242) {
        errors
        response
    }
}