It seems that there is no way to enable/disable mail alerts using API or to even check whatever email alerts are enabled.
It seems to be the same with SMS alerts and changing other detail of alerts except leadtime and alertstart).
I searched for example https://forum.beeminder.com/search?q=mail%20api https://forum.beeminder.com/search?q=alert%20%23tech https://github.com/beeminder/apidocs/search?q=mail&unscoped_q=mail http://api.beeminder.com/#attributes-2
my usecase: in https://github.com/matkoniecz/beeminder_goal_normalization I want to automate checking whatever my goals are configured as I want them. It was supposed to checking (and possibly correcting) status of mail alerts. It appears to be impossible via API and requires Selenium or other browser automation.