Data API privacy rules
This section covers the Privacy Rules settings for the Data API
The Data API and privacy rules
Access to a specific data type through the Data API is controlled by the privacy rules applied to that type, except if the client is using a Bubble API token to authenticate (in which case the client will be granted full admin access and privacy rules are disregarded).

How privacy rules affect the Data API
The different checkboxes in a given privacy rule affect the Data API in the following way:
Regular privacy rules
View all fields
If this box is checked, the client will be able to retrieve all the fields on all the things of a given data type. If you uncheck this box you can check which fields are returned one-by-one.
Constrainable fields
This setting controls whether a field can be used as a search constraint. It's particularly important for the Data API, because its searches can't be detected as page-defined. Whether it affects Data API requests depends on the search privacy mode in your app.
In automatic mode, Bubble allows constraints that match a search defined on one of your app's pages. A Data API call never has that page context, so this detection always comes up empty and the request falls back to your privacy rules. In strict mode, every constraint is checked against your privacy rules regardless of where it comes from.
The practical result is the same in both modes: a field used as a constraint in a Data API search has to be allowed by your privacy rules. A field with its constraint permission enabled is allowed; a field you haven't set follows its View all fields permission. If the constraint isn't allowed, it won't be applied to the search.
Find this in searches
If this box is checked, the client will be able to retrieve a list of things of a given data type, optionally using search constraints. If it’s left unchecked, the client will be unable to search for the data type.
View attached files
If this box is checked, the client will be able to retrieve files saved to a given data type.
Allow auto-binding
This setting does not affect clients who access the database via the Data API.
Data API-specific privacy rules

Whenever the Data API is enabled for a database Thing, three new options are available in that Thing’s Privacy Rule:
Create via API
Modify via API
Delete via API
All three are unchecked by default to avoid accidentally giving editing access.
If these boxes are left unchecked, an API client matching this Privacy Rule will not be able to create, make changes to or delete any data on that data type through the Data API.
Last updated
Was this helpful?