Enable Database API and set Privacy rules
See here how to use the database from your bubble app via API calls and how to add Privacy rules.
By default, you can't use your database via API calls.
Here's how to enable exposing database via API
Go to app Settings -> API check the checkbox "Enable Data API"
Check the checkbox for databases that you need to use via API
Next, we need a Privacy rule for checked databases to secure it.
Here's how to add Privacy rules for a database
Go to Data -> Privacy
Select needed database and click Define a new role
Set a name for it (any name)
Here you can add any condition that is good for you.
Here is an example. A rule to make changes in database from API only if the user is logged in.
You can add multiple conditions and roles.
Documentation by ezcode.co
Last updated