Change monitor action through API

Change monitor action through API

The support level of our EC2 instances is defined by a tag on AWS level. We have 4 different actions defined, one for each support level.

What we want is change the defined action based on what support tag is added. So I was thinking a Python script that checks all instances, gets the support tags, and then set the actions attached to those monitors through the API.

So the question is: can one change the attached action of a monitor through the API, and how?