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.
Found this content helpful? Log in or sign up to leave a like!
I am sure this is something easy, but I can not see it. I want to deactivate an enrollment in a class. I am looking at this documentation.
url:DELETE|/api/v1/courses/:course_id/enrollments/:idConclude, deactivate, or delete an enrollment. If the task argument isn't given, the enrollment will be concluded.
| Parameter | Type | Description | |
|---|---|---|---|
| task | string |
The action to take on the enrollment. |
I am using this url and sending as a HTTP DELETE
https://XXX/api/v1/courses/44727/enrollments/29569?task=deactivate
the documentation said the task parameter was optional and would default to concluded. So I tried that as well, and still received the 404.
Thanks bob
Solved! Go to Solution.
The 404 means it can't find something. Where did you get the enrolment ID from? the enrolment ID is different from the user ID so if you are trying to conclude an enrolment for a user, you first have to find out the enrolment ID for the user ID.
Depending on what you are wanting to do there are various ways to find enrolment IDs: https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index
If you are doing bulk updates I would recommend using a provisioning report and a SIS Import, rather than making lots of API calls. It will be faster, but also is easier to test and revert/recover if something does wrong. SIS Imports also have a log of all the changes that have been run which can make debugging problems much easier.
The 404 means it can't find something. Where did you get the enrolment ID from? the enrolment ID is different from the user ID so if you are trying to conclude an enrolment for a user, you first have to find out the enrolment ID for the user ID.
Depending on what you are wanting to do there are various ways to find enrolment IDs: https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index
If you are doing bulk updates I would recommend using a provisioning report and a SIS Import, rather than making lots of API calls. It will be faster, but also is easier to test and revert/recover if something does wrong. SIS Imports also have a log of all the changes that have been run which can make debugging problems much easier.
Thanks again for the help. Yeah I knew the 404 was not found. But I was thinking it was a page not found, not a student not found. And yes I was sending up the canvas student id. I assumed again it would have been based on the student id and course number. Thanks for the link on getting enrollment ids.
Again you have been a life saver for me. I wish I could send over a six pack of some great craft beer for all your help.
cheers
bob
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