To find the Controller account ID using the REST API, use one of the following URLs to create a GET request.
SaaS: https://<<accountName>>.saas.appdynamics.com/controller/api/accounts/myaccount
On-Premise: http[s]://<<hostname>>/controller/api/accounts/myaccount
Find more information about using the Controller API and authentication in the documentation.