We have been testing adding email addresses using the Canvas API in our test environment. I found that I'm unable to delete certain email addresses using the UI and acting as a user, even when the email address is not set as the default.
I don't have a need to delete email addresses at this time, but I am just wondering why this would happen. If I'm unable to delete an email address using the UI, even when it is not set as the default, can I delete the communications channel using the API?
Have you tried using the "Delete a communication channel" API call? Communication Channels - Canvas LMS REST API Documentation (instructure.com)
You may need to use the "List user communication channels" API call so that you can determine the id of the communication channel that you want to delete.
Hi James, this API call worked for me, but I had to temporarily enable the admin setting allowing "Users can delete their institution-assigned email address"
I do believe checking that setting is intended to be required for this to function. Depending on what integrations exist in your Canvas instance now (or in the future), removing the institution email may have a lot of undesirable outcomes. Because many integrations use the "default" email as a user identifier (even though it may not be recommended), we don't let our users change their default email at all. They can add additional emails for notifications and things, but the default email remains as the institution email. Is there a particular reason you'd want to remove the institution email for regular users, or is this being used to clean up some test user accounts or something?
Yes, I agree completely that no one should allow users to change their sis emails. If the api doesn't run that could be the issue as it was in my specific case. I had to quickly check that option, run the api, and then uncheck it so the restriction was enabled.