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!
Hi all,
I understand that you cannot delete a section if there are enrollments. But if a course has a section that was added in Canvas directly (no SIS ID) and we wanted that section removed, yet that section has multiple enrollments, is there not a way to delete enrollments in bulk vs. one at a time?
Matt
Solved! Go to Solution.
Hi Brian,
Thanks for your response. I guess I should have provided a little more context: this is meant to be done over the API as it is actually a maintenance tool we've created that is meant to serve as a one-click "Fix It" for our administrators so they probably aren't going to want to go into each individual section to assign missing SIS IDs. Basically the policy is: instructors shouldn't be adding their own sections since they will be imported directly from source and those are the ones they should be using.
However, this does bring up one viable workaround to mind (I emphasize on workaround because this really ought to be part of the API):
To [Programmatically] Delete Section Enrollments in Bulk:
Total cost: 2-3 API calls to delete some or all enrollments (using SIS) in a section.
Alternatively, if you have no need to filter which enrollments you are deleting in bulk and are essentially deleting ALL enrollments, you might also argue this could be easier done in two easier steps, but still costing 2 API calls:
So I guess there you have it, deleting enrollments in bulk ![]()
Matt,
From what I know there is no way to delete bulk enrollments via the Canvas interface.
On thing you can try is to go into the section and give it a SIS ID manually and by doing so would allow you to remove the enrollments in bulk.
To add a section SIS ID manually click on Setting--> Sections --> Click on the section and on the right hand side of the page you should see "Edit Section" once in the screen you should see SIS ID with a blank text box beside it. You can type in the SIS ID you would like to use.
Brian
Hi Brian,
Thanks for your response. I guess I should have provided a little more context: this is meant to be done over the API as it is actually a maintenance tool we've created that is meant to serve as a one-click "Fix It" for our administrators so they probably aren't going to want to go into each individual section to assign missing SIS IDs. Basically the policy is: instructors shouldn't be adding their own sections since they will be imported directly from source and those are the ones they should be using.
However, this does bring up one viable workaround to mind (I emphasize on workaround because this really ought to be part of the API):
To [Programmatically] Delete Section Enrollments in Bulk:
Total cost: 2-3 API calls to delete some or all enrollments (using SIS) in a section.
Alternatively, if you have no need to filter which enrollments you are deleting in bulk and are essentially deleting ALL enrollments, you might also argue this could be easier done in two easier steps, but still costing 2 API calls:
So I guess there you have it, deleting enrollments in bulk ![]()
Matt --
I realize that you already posted an answer, but i wanted to ask why you're needing to add a SIS ID in the first place? You shouldn't need to set a SIS ID in order to retrieve any enrollments from a section.
When dealing with Canvas via the API, you can use either the canvas internal ID to specify which object you're working with... or you can use the SIS ID that you've set yourself.
For example, this is the endpoint when getting a section:
Using the internal Canvas-assigned ID:
$endpoint = $canvasUrl . '/api/v1/sections/' . $id;
Using the SIS SECTION ID assigned by us:
$endpoint = $canvasUrl. '/api/v1/sections/sis_section_id:' . $id;
So, you should be able to eliminate the first step where you're assigning a SIS ID. Just grab the enrollments from the section directly, and then do your operations like before.
(Unless im missing a reason for why you need a SIS ID in the first place, then ignore this whole reply 🙂 )
Hi Nicholas,
Going the SIS Import route (requiring a SIS ID) allows us to leverage the enrollments.csv which enables us to bulk-delete enrollments whereas if you look at the Enrollments API, or at least per the documentation, you can only delete 1 enrollment ID at a time (SIS ID not required).
Matt
Gotcha. Makes sense.
I just wanted to check to make sure you weren't saying that you can't delete/alter something unless it has a SIS ID.
I've written some things before that iterated through using the Canvas ID via API.... Of course it always depends on the amount of data you're churning through. Just make sure you're not causing issues for yourself in future by treating things as SIS events, when they might not be. IE: If you upload something or take some action with a SIS CSV, then it won't always allow you to override that in the UI.
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