# Inventario de acciones API (stub greenfield)

Convención: `POST services/php/public/index.php` con JSON `{ "action": "...", ... }` o `multipart` donde aplique. Cabecera `X-Request-Id` opcional; respuesta `{ ok, data?, error? }`. Mutaciones autenticadas requieren `csrf` en cuerpo (sesión).

| Acción | Auth | CSRF | Params / cuerpo | Respuesta `data` | Efectos |
|--------|------|------|-----------------|------------------|---------|
| `ping` | GET `?ping=1` | no | — | `pong`, `request_id` | — |
| `authConfigGet` | no* | no | — | `config` | — |
| `authConfigSave` | admin | sí | `config` | `config` | persiste store |
| `authMe` | no | no | — | `user`, `csrf` | sesión |
| `authLogin` | no | no | `username`, `password` | `user`, `csrf` | sesión, rate limit |
| `authLogout` | no | no | — | `loggedOut` | limpia sesión |
| `authRegister` | no | no | `username`, `password` | `userId` | alta si abierto |
| `webauthn*×4` | — | — | — | error `deprecated` | compat cliente antiguo |
| `usersList` | admin | no | — | `users` | — |
| `usersCreate` | admin | sí | `username`, `password`, `role?` | `id` | crea usuario |
| `usersUpdate` | admin | sí | `id`, `role?` | `updated` | — |
| `usersToggleActive` | admin | sí | `id` | `user` | — |
| `usersBlock` | admin | sí | `id` | `user` | — |
| `usersDelete` | super_admin | sí | `id` | `deleted` | — |
| `usersResetPasskey` | admin | sí | — | error `not_implemented` | — |
| `usersChangePassword` | usuario | sí | `password` | `changed` | — |
| `securityLogTail` | admin | no | — | `lines` | — |
| `gridAuthGetAppSettings` | sí | no | — | igual `getSettings` | compat |
| `gridAuthSaveAppSettings` | sí | sí | `settings` | igual `saveSettings` | compat |
| `gridAuthGetUsers` | sí | no | — | `usersList` | compat |
| `gridAuthSaveUsers` | sí | — | — | error `deprecated` | guiar a API nueva |
| `gridAuthGetFolderPermissions` | sí | no | — | `permissions` [] | stub |
| `gridAuthSaveFolderPermissions` | sí | no | — | `saved` | stub |
| `getSettings` | sí | no | — | `settings` | lectura + recovery |
| `saveSettings` | sí | sí | `settings` | `settings` | merge seguro, backup |
| `uploadMedia` | sí | multipart | `file` | `path` | bajo `media/` |
| `deleteMedia` | sí | no | `path` | `deleted` | — |
| `logEvent` | sí | sí | `event`, `meta?` | `logged` | append activity |
| `getActivityLog` | sí | no | — | `log` | — |
| `clearActivityLog` | sí | sí | — | `cleared` | — |
| `rotateActivityLog` | sí | sí | — | `rotated` | tamaño |
| `exportAllZip` | sí | sí | — | `zip`, `path` | whitelist paths |
| `importAllZip` | sí | multipart | `archive` | `imported` | whitelist |
| `shareCreate` | sí | sí | `type`, `path`, `ttlSeconds?` | `token`, `expires` | audit log |
| `shareList` | sí | sí | — | `links` | — |
| `explorerList` … `explorerEmptyRemoteCache` | sí | sí* | ver código | — | ver `ExplorerService` |
| `explorerConn*` (remoto) | sí | sí | ver `RemoteExplorerService` | stubs / driver | timeouts futuros |
| `explorerConnPreview` | GET `?explorerConnPreview=1&format=json|png` | no | query | PNG o JSON | content-type mixto |
| `arquitectListProjects` … `arquitectLoadSnapshot` | sí | sí | ids `p_*` | ver `ArquitectService` | disco `reserved_projects` |
| `adminPing` | sí | no | — | `admin` | — |

\* `authConfigGet` en esta implementación no exige sesión (solo lectura de config pública); endurecer en producción si aplica.

Completar filas con método HTTP alterno `/api/v1` cuando se estabilicen rutas REST.
