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!
When I do a DELETE request against the /api/v1/accounts/:account_id/admins?role_id=XXXX REST API and pass the correct account_id and role_id, the API returns an Admin JSON as its supposed to, and the workflow_status shows deleted in the JSON, but in the Canvas user interface if I go to that account and check the admin's, the account is still there and has not been removed from the role. Additionally, if I then do a list for all admin's in the account, the person is still listed with the role and a status of active.
Anyone else having issues with the admin remove REST API?
Apparently, its just bugged out records. I added a new admin with the same role and was able to remove them with the API, so for some reason I have a bunch of old records that the API can't remove, unless this is a sticky thing.
I'll manually remove these and then I should be good to go.
Hi Hayesb,
Assuming you're trying to remove a user based on your scenario, it looks your API call is incomplete, and uses /admins?role_id= instead of /admins/:user_id.
With the complete call being
DELETE /api/v1/accounts/:account_id/admins/:user_id
https://developerdocs.instructure.com/services/canvas/resources/admins#method.admins.destroy
If you are indeed trying to remove a role, the call is different, and the doc notes that anyone with that role who has not been removed using the call above, will retain the role until it is removed from the user.
DELETE|/api/v1/accounts/:account_id/roles/:id
Hope this helps.
Nope, I am using the :sis_user_id in my command, it was finding the correct records. As I said in my initial post, the call was returning a valid admin object paylod for the user with a workflow_status of deleted, but then when listing the admins again the record was still there and active.
As my follow up mentioned, I created a new admin with the same role, used the same code to remove them without issue, it was just the existing records from a process we ran last year it couldn't remove (even though the API returned that it was successful). I had to manually delete the records to resolve the issue. Not sure if they were manually created and there was a sticky effect on them, or the API was just failing to remove the records and reporting it succeeded, but if I was using the wrong API endpoint values like you suggested it would have returned a Not Found error, not the matching person's admin object.
I'm all good after removing the records manually, all new records created are correctly being deleted (no change to the code).
As to my original subject on the post, I manually typed that out, my actual API endpoint has the sis_user_id in it, just forgot to type it.
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