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

  1. Go to app Settings -> API check the checkbox "Enable Data API"

  2. 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

  1. Go to Data -> Privacy

  2. Select needed database and click Define a new role

  3. Set a name for it (any name)

  4. 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