How to restrict token use withint applications of specific IP address?

Posted November 17, 2019 722 views
DigitalOcean API and CLI (doctl)

I am using digital ocean’s python api. I generated a token and successfully created a couple of droplets using snapshots.
In order to make the use of the token safer, is there a way to restrict the use of the token from specific ip addresses?
In other words,is it possible to add the ip addresses of the machines allowed to use the token?
Thanks in advance

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


I don’t think that this is currently possible. You could share your idea here:

What I could suggest in the meantime, is keeping your API key in a separate file, for example, use and then add that file to your gitignore so that the file only gets uploaded to your server.