> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Read and change an app's data model with the Base44 Apps API

An entity is a table in your app's database. Its schema is a JSON Schema that names the entity's fields, marks which are required, and holds its row-level security rules under `rls`. The entity endpoints let you read and change those schemas, read and change the records they hold, and count the records and users an app holds.

Use these endpoints to:

* Read an app's entity schemas, one at a time or all together.
* Add, replace, or remove an entity.
* Make an app's live data model match its source in one call. This one is limited to apps whose source code you manage yourself.
* Read, add, change, or remove an entity's records.
* Count an entity's records, or the app's users.

## Schema writes don't change your code

Every write here changes the app's live data model, so it takes effect immediately. It doesn't change the entities configuration file that defines that model in the app's source code, at `base44/entities/<EntityName>.jsonc`. Base44 rebuilds the live model from those files whenever one of them is written or the app's code is pulled from GitHub, so a change made only through this API is reverted at that point.

To change the model for good, change the file. If the app is connected to a GitHub repository, commit the change there and call [Pull changes from GitHub](https://docs.base44.com/api-reference/pull-changes-from-github.md), which rebuilds the live model from your file. Otherwise ask the AI to add or edit the entity with [Send chat message](https://docs.base44.com/api-reference/send-chat-message.md), which writes the file the same way the Base44 online app editor does.

That makes the write endpoints a good fit for pushing a schema Base44 should serve right now, and a poor fit for a lasting schema edit.

## The User entity

`User` is built in, so it doesn't behave like an entity you defined:

* You can't create it. Use [Update entity schema](https://docs.base44.com/api-reference/update-entity-schema.md) with `User` to add custom fields to it, which also creates those fields the first time.
* Reading it returns only the custom fields you added, not the built-in ones, and returns a 404 when there are none.
* Custom fields can't redeclare `email` or `full_name`, which Base44 manages.
* Its stored schema carries no `name` key, unlike the schema of an entity you defined.
* Counting users has its own endpoint, [Count app users](https://docs.base44.com/api-reference/count-app-users.md). Don't pass `User` to [Count entity records](https://docs.base44.com/api-reference/count-entity-records.md).
* The record endpoints don't reject it either. [List](https://docs.base44.com/api-reference/list-entity-records.md), [Create](https://docs.base44.com/api-reference/create-entity-record.md), [Get](https://docs.base44.com/api-reference/get-entity-record.md), [Update](https://docs.base44.com/api-reference/update-entity-record.md), and [Delete entity record](https://docs.base44.com/api-reference/delete-entity-record.md) all accept `User` as an `entity_name`, but they read and write a separate, disconnected set of records stored under that name, not the app's real user accounts.

## Filtering, sorting, and paging

[List entity records](https://docs.base44.com/api-reference/list-entity-records.md) accepts these query parameters.

### Filter

Two ways to filter:

* Pass one of the entity's own field names directly as a query parameter, for an exact match. `?status=paid` matches records where `status` is `"paid"`.
* Pass `q` as a JSON object, for anything beyond an exact match, for example `{"amount": {"$gt": 100}}`. `q` accepts:
  * Compare: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`
  * Match a set: `$in`, `$nin`
  * Combine conditions: `$and`, `$or`, `$nor`, `$not`
  * Check presence or type: `$exists`, `$type`
  * Arrays: `$all`, `$elemMatch`, `$size`
  * Substring or pattern: `$regex`
  * Geospatial and full-text, if the field actually holds that kind of data: `$near`, `$nearSphere`, `$geoIntersects`, `$geoWithin`, `$text`, `$search`

A query parameter that isn't `q`, `limit`, `skip`, `sort`, or `fields`, and isn't one of the entity's own field names, is still read as a filter on that name. A misspelled field name matches nothing rather than returning an error.

Base44 wraps every filter in the entity's own row-level-security conditions before checking nesting depth, so how deep you can nest `q` depends on the entity's `rls` rules.

### Sort

Sort with a single field name in `sort`, prefixed with `-` for descending, for example `-created_date`. Sorting by more than one field isn't supported.

### Page

Page with `limit` (1 to 5000, defaults to 5000) and `skip` (defaults to 0). Base44 caps every call at 5000 records, whether you leave `limit` out or ask for more, and the response doesn't indicate when it was cut short.

### Select fields

Reduce the response size with `fields`, a comma-separated list of field names. Reach into an object with dots, as in `customer.email`. Every record still carries its `id`.

## Rate limits

Each entity endpoint states its base rate limit in its `429` response. [List entity records](https://docs.base44.com/api-reference/list-entity-records.md) and [Count entity records](https://docs.base44.com/api-reference/count-entity-records.md) share one allowance, scoped to one app rather than shared across the workspace's other apps, and also drawn down by version-history activity in the Base44 online app editor. A paid plan gets a multiple of the base number. See [Rate limits](https://docs.base44.com/developers/references/apps-api/get-started/rate-limits.md) for the multiplier table.

## Endpoints

### Schemas

* [List entity schemas](https://docs.base44.com/api-reference/list-entity-schemas.md): List every entity the app defines.
* [Get entity schema](https://docs.base44.com/api-reference/get-entity-schema.md): Read one entity's JSON Schema.
* [Create entity schema](https://docs.base44.com/api-reference/create-entity-schema.md): Add a new entity to the app.
* [Update entity schema](https://docs.base44.com/api-reference/update-entity-schema.md): Replace an entity's JSON Schema.
* [Sync entity schemas](https://docs.base44.com/api-reference/sync-entity-schemas.md): Replace the app's entire set of entities in one call.
* [Delete entity schema](https://docs.base44.com/api-reference/delete-entity-schema.md): Remove an entity that has no records.

### Records

* [List entity records](https://docs.base44.com/api-reference/list-entity-records.md): Read one page of an entity's records, with a cursor for the next page.
* [Count entity records](https://docs.base44.com/api-reference/count-entity-records.md): Count an entity's records, optionally narrowed by a filter.
* [Get entity record](https://docs.base44.com/api-reference/get-entity-record.md): Read one record.
* [Create entity record](https://docs.base44.com/api-reference/create-entity-record.md): Add a record to an entity.
* [Update entity record](https://docs.base44.com/api-reference/update-entity-record.md): Change the fields you send on one record.
* [Delete entity record](https://docs.base44.com/api-reference/delete-entity-record.md): Delete one record.

### Bulk operations

* [Create entity records](https://docs.base44.com/api-reference/create-entity-records.md): Add several records in one call.
* [Update entity records](https://docs.base44.com/api-reference/update-entity-records.md): Change up to 500 records, each with its own fields.
* [Update entity records by filter](https://docs.base44.com/api-reference/update-entity-records-by-filter.md): Apply the same change to up to 500 records that match a filter.
* [Import entity records from CSV](https://docs.base44.com/api-reference/import-entity-records-from-csv.md): Create records from a CSV file.
* [Delete entity records](https://docs.base44.com/api-reference/delete-entity-records.md): Delete every record that matches a filter.

### Trash

* [List deleted entity records](https://docs.base44.com/api-reference/list-deleted-entity-records.md): List the deleted records still in an entity's trash.
* [Restore entity record](https://docs.base44.com/api-reference/restore-entity-record.md): Bring one deleted record back.
* [Restore entity records](https://docs.base44.com/api-reference/restore-entity-records.md): Bring back every deleted record that matches a filter.
* [Permanently delete entity record](https://docs.base44.com/api-reference/permanently-delete-entity-record.md): Erase one record from the trash for good.

### Data checkpoints

* [Get data version history status](https://docs.base44.com/api-reference/get-data-version-history-status.md): Check whether the app has version history for its data, and how far back it goes.
* [List data checkpoints](https://docs.base44.com/api-reference/list-data-checkpoints.md): List the points in the data history you can download or restore to.
* [Download data checkpoint](https://docs.base44.com/api-reference/download-data-checkpoint.md): Read every record one entity held at a checkpoint.
* [Restore data to checkpoint](https://docs.base44.com/api-reference/restore-data-to-checkpoint.md): Start putting the entities you name back the way they were.
* [Get data restore status](https://docs.base44.com/api-reference/get-data-restore-status.md): Check where each entity in a restore has got to.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.