Network restrictions via Management API

Struggling to apply an IP whitelist using the management API. Thought it might be that I'm trying to apply too many IPs at once, but even applying a single address doesn't seem to work:
curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/network-restrictions/apply" -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{
"db_allowed_cidrs": [
"192.168.0.1/24"
]
}'
curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/network-restrictions/apply" -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{
"db_allowed_cidrs": [
"192.168.0.1/24"
]
}'
This applies no IP addresses (no address can access my database). Here's the response:
{"config":{"dbAllowedCidrs":[],"dbAllowedCidrsV6":[]},"entitlement":"allowed","status":"applied"}
{"config":{"dbAllowedCidrs":[],"dbAllowedCidrsV6":[]},"entitlement":"allowed","status":"applied"}
4 Replies
garyaustin
garyaustin2mo ago
Don't know much about it, but the docs show a different object name...
No description
michael milstead
michael milsteadOP2mo ago
Network Restrictions | Supabase Docs
Apply network restrictions for your project's database.
michael milstead
michael milsteadOP2mo ago
that was it, thanks!
garyaustin
garyaustin2mo ago
You might generate an issue for docs in github supabase/supabase or a PR if you are up for it. Save the next person some pain.

Did you find this page helpful?