List entity schemas

Changed on

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Returns every entity schema the app defines, plus the built-in User entity when it has custom fields.

To read one schema on its own, use Get entity schema.

Set branch_id to read the schemas a branch uses: main's schemas plus the entities and fields the branch adds. A branch can only add, so required, rls and the fields main already has always come from main. The branch's changes reach main when you merge the branch. On an app imported from GitHub, a branch always reads main's schemas.

get/api/apps/{app_id}/entity-schemas

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/entity-schemas
  • Auth: HTTP bearer

Path parameters

app_idstring required

ID of the app whose entity schemas you want to work with.

Query parameters

branch_idstring

ID of the branch to work on, as returned by List branches. Omit it to work on the app's main branch.

Response

Successful Response

totalinteger required

Number of entity schemas returned.

Example response

{
  "schemas": [
    {
      "entity_name": "Invoice",
      "entity_schema": {
        "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"
      }
    },
    {
      "entity_name": "User",
      "entity_schema": {
        "properties": {
          "department": {
            "type": "string"
          },
          "employee_id": {
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  ],
  "total": 2
}

Changes

    • breaking

      query request parameter branch_id list-of-types was narrowed by removing types null

    • info

      for the query request parameter branch_id, the type was generalized from no type to string

    • info

      added the new optional query request parameter branch_id