---
title: "Sync entity schemas"
method: PUT
path: "/api/apps/{app_id}/entity-schemas"
---

# Sync entity schemas

`PUT /api/apps/{app_id}/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 app's entire set of entities with the one you send, in a single call. This is what a deploy uses to make the app's live schema match its source.

<Warning>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.</Warning>

The response reports what changed, split into `created`, `updated`, and `deleted`. It also carries `warnings` for problems Base44 accepted instead of rejecting, so a 200 with a non-empty `warnings` means the sync applied but something in it is not doing what it looks like.

<Warning>This changes the app's live schema right away, but it does not change the entity definition in the app's source code. Base44 rebuilds the live schema from the source files whenever the app's code changes, which reverts anything you set here. Change the code itself when you need the edit to last.</Warning>

This endpoint is only available for apps whose source code you manage yourself. On an app whose code Base44 generates, it returns a 428. An entity that still has records cannot be deleted, so a sync that drops such an entity returns a 428 and changes nothing.

<Note>This endpoint accepts a personal API key, or a workspace API key with the `apps:deploy` scope.</Note>

## Path parameters

- `app_id` string, required — ID of the app whose entity schemas you want.

## Request body

- SyncEntitySchemasRequest
  - `entityNameToSchema` object, required — The app's complete set of entities, keyed by entity name. Each value is that entity's JSON Schema. Any entity the app currently has and this map does not is deleted.

## Response `200`

What the sync created, updated, and deleted, plus any warnings.

- SyncEntitySchemasResponse
  - `created` string[], required — Entities that did not exist before and were added.
  - `updated` string[], required — Entities that already existed and were replaced.
  - `deleted` string[], required — Entities the app had and the request left out, which were removed.
  - `warnings` string[] — Problems Base44 accepted rather than rejected. Currently these are row-level security rules it cannot enforce on an entity that has no previous version, which a deploy usually carried over rather than wrote. The sync still applied.

## Other responses

- `400` — An entity name is empty or has characters other than letters, numbers, and underscores; a schema is not a valid JSON Schema; the `User` schema redeclares `email` or `full_name`; or a schema sets row-level security rules Base44 cannot enforce.
- `401` — Missing or invalid credentials.
- `403` — You don't have editor access to this app, or your workspace API key lacks the `apps:deploy` scope.
- `404` — App not found.
- `409` — The request is scoped to a feature branch. Entity schemas can only be changed on the main branch.
- `422` — Validation Error
- `428` — Base44 generates this app's source code, so this endpoint is not available for it; or an entity the sync would delete still has records.

## Changes

- **2026-08-25** `8dfd9c46c0b9` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/idealspot/apis/base44-app-management-api/changes/api/apps/:app_id/entity-schemas/put.md)

---

[API](https://skmtc.dev/idealspot/apis/base44-app-management-api.md) · [All operations](https://skmtc.dev/idealspot/apis/base44-app-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/idealspot/base44-app-management-api/revisions/31ef75eb64ab/schema)
