How to retrieve a monitorid?

How to retrieve a monitorid?

We are automating our agent deploy to AWS instances.  Each deploy re-provisions the instances.  I'd like to update the monitors group etc when the new instance is provisioned, however this requires the monitorid.  At this time I cant find an API that will return the monitorid so I can update it.  Any help is greatly appreciated.

Thanks,
K