HTTP API
All routes start with CrudHttpOptions.RoutePrefix (default api/crud). JSON uses camelCase field names (CrudPages.X.Fields.* holds them as constants).
Endpoints
| Method and route | Action | Permission |
|---|---|---|
GET pages | Pages the caller may see (id, title, group, parent) | View, per page |
GET {page} | List: filters, sort, paging | View |
GET {page}/{id} | One row | View |
POST {page} | Create → 201 with Location | Create |
PUT {page}/{id} | Update (all [Field] values) | Update |
DELETE {page}/{id} | Delete (hard or soft) → 204 | Delete |
GET {page}/schema | Columns, fields, search, row actions, permissions, culture, direction, calendar | View |
GET {page}/lookup?q=&ids=&take= | Options for dropdowns | View |
GET {page}/unique/{field}?value=&id= | Is this value free? | Create or Update |
GET {page}/deleted | Soft-deleted rows (same query syntax as the list) | Restore or Purge |
POST {page}/deleted/{id}/restore | Bring a soft-deleted row back | Restore |
DELETE {page}/deleted/{id} | Remove a soft-deleted row for good | Purge (explicit) |
Pro packages add audit ({page}/{id}/history, …) and import/export ({page}/export/{format}, …) routes.
List query syntax
| Parameter | Example | Meaning |
|---|---|---|
page, size | page=2&size=50 | Paging (size capped by MaxPageSize, default 100) |
sort | sort=name:asc,id:desc | Sortable columns only (plus the key and default sort fields) |
f.{field} | f.name=riy | A [Search] filter with its operator |
f.{field}.from / .to | f.population.from=1000 | Between ranges (either end optional) |
f.{field}=a,b | f.status=Active,Draft | In lists |
The answer: { "items": [...], "total": 42, "page": 2, "size": 20 }.
Unknown filter keys are ignored; a value that doesn’t parse (e.g. f.population=abc) is a 400.
Errors
RFC 9457 problem details, always:
| Status | When |
|---|---|
| 400 | Validation: errors has messages per field ({ "errors": { "name": ["Name is required."] } }). Also a body that doesn’t fit the page model: a value of the wrong type ("type": "" for an enum) names that field; no body at all is reported under body |
| 401 | Not signed in |
| 403 | Signed in, but not allowed (or no active tenant where one is needed) |
| 404 | The row doesn’t exist or the caller may not see it (another tenant’s rows are never revealed) |
| 409 | Conflicts: a veto from a page rule, a row still referenced by others, a duplicate on restore |
Map your own exceptions: AddHttpApi(o => o.MapException<MyException>(422)).
OpenAPI
Every page appears in the app’s OpenAPI document (/openapi/v1.json with AddOpenApi()).