The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Can anyone share an API call to get a list of users enrolled with a particular course role? I need to get a list of all users enrolled in courses with a custom created course role called Demo Viewer. The role is based off of the observer role.
Thanks!
Lisa
Solved! Go to Solution.
@baxl use the Enrollments API, specifically the call to "List enrollments":
The "role[]" parameter should get you what you are looking for:
| role[] | string | A list of enrollment roles to return. Accepted values include course-level roles created by the Add Role API as well as the base enrollment types accepted by the `type` argument above. |
Let me know if this helps.
Due to the technical nature of this question I'm going to share it with the Canvas Developers group in the Community. Hopefully they'll be able to help!
Thank you!
@baxl use the Enrollments API, specifically the call to "List enrollments":
The "role[]" parameter should get you what you are looking for:
| role[] | string | A list of enrollment roles to return. Accepted values include course-level roles created by the Add Role API as well as the base enrollment types accepted by the `type` argument above. |
Let me know if this helps.
Is there a way to find a list of users enrolled in an account? For instance, we have a custom course role called Demo Viewer and I'd like to find all users that are enrolled with that type of role in a sub-account.
@baxl have you looked at the "Provisioning" report for the sub-account?
Can you use the results for "Enrollments" to filter out what you are looking for?
That's perfect! That's exactly what I need! Thanks so much!
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.