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!
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
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 :/
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