Count entity records

Changed on

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

Returns how many production records an entity holds, optionally narrowed by a filter.

Pass the same q filter List entity records accepts to count a subset, for example {"status": "open"}. The count covers the records the calling credential can read, so an entity whose row-level security rules narrow reads returns a smaller number than the entity actually holds. An entity with no rls rules returns its full count.

Don't pass User as the entity_name. To count the app's users, use Count app users instead.

get/api/apps/{app_id}/entities/{entity_name}/count

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/count
  • Auth: HTTP bearer

Path parameters

entity_namestring required

Name of the entity, exactly as List entity schemas reports it. Don't pass User here. It doesn't fail, but it reads and writes a separate, disconnected set of records stored under that name, not the app's real user accounts, which are managed through their own endpoints.

app_idstring required

ID of the app that owns the entity.

Query parameters

qstring

Optional filter, a JSON object in the same form as q on List entity records.

Response

Successful Response

countinteger required

Number of records you can read in this entity.

Example response

{
  "count": 128
}

Changes

    • breaking

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

    • info

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

    • info

      the endpoint scheme security PersonalAccessTokenAuth was added to the API