Sync entity schemas
<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Replaces the specified app's entire set of entities with the one you send, in a single call.
Send every entity the app should have. Any entity the app currently has that is missing from entityNameToSchema is deleted. Include User to keep its custom fields. Leaving it out drops them. An empty object deletes every entity the app has.
Base44 won't delete an entity that still holds records. If the set you send leaves out an entity that has records, the whole call fails and nothing changes.
This changes the app's live data model, so it takes effect immediately. It doesn't change the file that defines that model in the app's source code. Since Base44 rebuilds the live model whenever the file is written or the app's code is pulled from GitHub, a change made using this endpoint may be reverted.
This endpoint requires the app's source code to be under your control. That includes projects you create with the Base44 CLI and projects you eject from the Base44 online app editor. Some managed-source apps may also be granted access.
Path parameters
ID of the app whose entity schemas you want to work with.
ID of the app whose entity schemas you want to work with.
Request body
Example request
{
"entityNameToSchema": {
"Invoice": {
"name": "Invoice",
"properties": {
"amount": {
"description": "Total amount in cents",
"type": "number"
},
"status": {
"enum": [
"draft",
"sent",
"paid"
],
"type": "string"
}
},
"required": [
"amount"
],
"rls": {
"read": {
"created_by": "{{user.email}}"
}
},
"type": "object"
}
}
}Response
Successful Response
Example response
{
"created": [
"Invoice"
],
"updated": [
"Customer"
],
"deleted": [
"LegacyOrder"
],
"warnings": [
"Invalid RLS rule in Invoice: \"properties.total.rls.delete\" — field-level delete rules are not enforced — delete removes the whole record (there is no field-level delete gate); put the restriction in a top-level rls.delete instead."
]
}Changes
No recorded changes to this endpoint across all 1 revision of this API.