AnsweredAssumed Answered

How Can You Delete Sub-Accounts Programmatically via Canvas API?

Question asked by Rodney Foley on Sep 28, 2017
Latest reply on Sep 28, 2017 by James Jones

I can create a Sub-Account using the Canvas API using:

POST /api/v1/accounts/:account_id/sub_accounts

 

However, there doesn't seem to be a public API to use to delete that which was just created via the Canvas API. I would think it should just be:

DELETE /api/v1/accounts/:account_id/sub_accounts/:sub_account_id

 

I did see that there is a private POST endpoint that is used to delete a Sub-Account using the parameter "_method" with the value of "delete". However, you cannot call this with the API key, and I tried a lot of different ways to get this to work and I can't as its access token seems to change for each call.

 

Is there a public way to do this?

If not can Canvas developers please add it preferable in a RESTful way like the above suggested DELETE.  I do have an open issue on GitHub regarding this and the fact that DELETEs that you do have don't seem to really delete things just hide or deactivate them, which is really just an update (aka PUT or PATCH).

 

Cannot Delete Sub-accounts & Users via Canvas API using API Key · Issue #1128 · instructure/canvas-lms · GitHub 

Outcomes