# Entities

Entities are your app's data models — the things it tracks. Define one and Foundation gives you a
database table with full create/read/update/delete, queries, and an API. No schema work, no DevOps.

## Configure

### Define an entity

An entity has a name and fields. Set it up in the dashboard, the wizard, or by telling your agent:

> "Add an entity called Projects with fields: name (text), status (text), due date (date)."

Foundation creates the table, generates CRUD, and optionally exposes it over your API or MCP.

### What each entity gives you

- Create, read, update, delete
- Query, filter, and paginate
- Access control via [roles & scopes](/platform/roles)

### Choose how it's exposed

| Surface | Who uses it |
|---|---|
| **REST API** | Your own app |
| **API as a Service** | Your users, programmatically |
| **MCP** | AI agents |

Toggle these per entity.

## Use in your app

Your frontend reads and writes entities through the SDK — typed, with filtering and pagination.

**Tell your agent:** "List the current user's projects, newest first, and let them add a new one."

```ts
// list with filters + pagination
const { items, nextCursor } = await foundation.db.list('projects', {
  orderBy: 'createdAt',
  orderDir: 'desc',
  limit: 50,
})

// create / update / delete
const project = await foundation.db.create('projects', { name, status: 'active' })
await foundation.db.update('projects', project.id, { status: 'done' })
await foundation.db.delete('projects', project.id)
```

## Reference

- SDK data methods: `foundation.db.list / get / create / update / save / delete` — see the
  [SDK reference](/api/sdk)
- [Uploads & Files](/platform/uploads) · [Storage](/platform/storage) · [Roles & Scopes](/platform/roles)
- [REST API](/api/rest) · [MCP Tools](/api/mcp)
