I was trying to make an A record in my DNS records when it returned a 403 error (checked in Network Viewer) I tried manually posting it with cURL, but it said “You are not allowed to perform this operation”. It is a brand new API key and it is also the correct domain in the API URL listed in cURL. Here’s the command I ran directly from API docs just edited for my domain:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"type":"A","name":"cdn","data":"very.cool.ip.here","priority":null,"port":null,"ttl":1800,"weight":null,"flags":null,"tag":null}' \
"https://api.digitalocean.com/v2/domains/totallycool.domain/records"
Edit: removed my domain and IP from the command so I don’t doxx myself :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey @kxtzownsu,
I’ve experienced such errors in the distant past where generating a new key helped me resolve the issue.
Additionally, try using to see if that would help
`doctl auth init -t "API_TOKEN"
Update (7/3/23): Still not working… I unfortunately deleted one of the currently existing A records and now unable to add it back… most of my programs are broken now :/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.