Find a domain for a droplet via the API

Posted June 23, 2016 2.4k views

I have a droplet. How can I find a domain(s) associated with it via the REST API?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hey there,

Our current API does not have an easy way to do that. If it is an important feature for you, I would suggest writing to us about it on Uservoice -

One of the reasons there is no easy way to do this is that domains are not linked to droplets. They are separate entities. To do this, you would need to do two api calls. The first, would be to get a list of all of your droplets:

After you have that list, you could then get all the records for your domain:

Once you have all of your domain records, you can get the IPs from your records and search through your list of droplets to associate them.