Fix RLS recommendations
Changed on<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Applies the row-level security rules the app's latest security scan recommends, for the entities you name. Get the names from rls_recommendations in Get security scan.
For each entity, Base44 replaces the entity's rls with the recommendation's create, read, update, and delete rules, exactly as the scan stored them. An operation the recommendation has no rule for is left with no rule, which doesn't restrict it. It doesn't run the scan again or ask an AI model anything, and it uses no credits. The applied recommendations are removed from rls_recommendations.
An entity with nothing to apply doesn't fail the call. It's listed in failed with the reason, and the rest are still applied. They're saved together, so if saving fails, the entities it failed for are listed in failed as write_failed, and that can be all of them. Some of their rules can still have changed in that case, so read the entities' schemas before you retry. Read both lists rather than treating a successful response as every entity fixed.
By default the fix also shows up in the app's AI chat, with a checkpoint of the app's code saved just before it, so you can roll it back from there. Set record_security_fix_chat to false to skip both.
Request
- Base URL: https://app.base44.com
- URL: https://app.base44.com/api/apps/{app_id}/security/scan/rls/fix
- Auth: HTTP bearer
Path parameters
ID of the app.
Request body
Example request
{
"entity_names": [
"Order",
"Customer"
],
"record_security_fix_chat": true,
"security_fix_total_count": 150
}Response
Which entities got their recommended rules, and which didn't.
Example response
{
"fixed": [
"Order"
],
"failed": [
{
"entity_name": "Customer",
"reason": "no_recommendation"
}
]
}Changes
- info
the endpoint scheme security
PersonalAccessTokenAuthwas added to the API
- info
- info
endpoint added
- info