crudadmin/api exposes the admin models through a REST API at /admin/api/v1. It also serves an OpenAPI description, so API clients and AI agents learn the models without further documentation.
Rows are read and written through the same code as the administration. Permissions, scopeAdminRows(), validation, uploads, history, admin rules and model events apply the same way.
Requirements
- CrudAdmin 6 and
crudadmin/framework6.0.1 or newer crudadmin/helpersfor the login and every data endpoint. Without it, only the Swagger UI of signed in administrators is registered.
Installation
config/admin.php, see REST API configuration.
What is exposed
Every registered admin model is available at/admin/api/v1/models/{table}. There is no opt-in. Access is limited by:
- the permissions of the signed in administrator
- the abilities of the token,
readorwrite $insertable,$editableand$deletableof the model
inaccessible fields and $hidden attributes are never returned.