{ "openapi": "3.1.0", "info": { "title": "aiquila-administration", "version": "0.0.1", "description": "Private AI in your Nextcloud — chat, agents and MCP tools, with the AI provider you choose", "license": { "name": "AGPL-3.0-or-later", "identifier": "AGPL-3.0-or-later" } }, "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "bearer_auth": { "type": "http", "scheme": "bearer" } }, "schemas": {} }, "paths": { "/index.php/apps/aiquila/api/admin/project-templates": { "get": { "operationId": "project_template-admin-index", "summary": "List the instance templates", "description": "This endpoint requires admin access", "tags": [ "project_template" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Instance templates sorted by title", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "scope", "title", "description", "systemPrompt", "paths", "createdAt", "updatedAt" ], "properties": { "id": { "type": "integer", "format": "int64" }, "scope": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "systemPrompt": { "type": [ "string", "null" ] }, "paths": { "type": "array", "items": { "type": "object", "required": [ "path", "pathType" ], "properties": { "path": { "type": "string" }, "pathType": { "type": "string", "enum": [ "file", "directory" ] } } } }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "post": { "operationId": "project_template-admin-create", "summary": "Publish a project template to every user", "description": "With `projectId`, the template starts as a copy of one of the admin's own projects.\nThis endpoint requires admin access", "tags": [ "project_template" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": [ "string", "null" ], "default": null, "description": "Template title (required without projectId)" }, "description": { "type": [ "string", "null" ], "default": null, "description": "Description" }, "systemPrompt": { "type": [ "string", "null" ], "default": null, "description": "System prompt copied into new projects" }, "paths": { "type": [ "array", "null" ], "default": null, "description": "Path suggestions copied into new projects", "items": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string" }, "pathType": { "type": "string" } } } }, "projectId": { "type": [ "integer", "null" ], "format": "int64", "default": null, "description": "Publish this project as a template" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The created template", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "scope", "title", "description", "systemPrompt", "paths", "createdAt", "updatedAt" ], "properties": { "id": { "type": "integer", "format": "int64" }, "scope": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "systemPrompt": { "type": [ "string", "null" ] }, "paths": { "type": "array", "items": { "type": "object", "required": [ "path", "pathType" ], "properties": { "path": { "type": "string" }, "pathType": { "type": "string", "enum": [ "file", "directory" ] } } } }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Missing title, or a field is too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "404": { "description": "Project not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/project-templates/{id}": { "put": { "operationId": "project_template-admin-update", "summary": "Update an instance template", "description": "This endpoint requires admin access", "tags": [ "project_template" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": [ "string", "null" ], "default": null, "description": "New title (null keeps it)" }, "description": { "type": [ "string", "null" ], "default": null, "description": "New description ('' clears, null keeps it)" }, "systemPrompt": { "type": [ "string", "null" ], "default": null, "description": "New system prompt ('' clears, null keeps it)" }, "paths": { "type": [ "array", "null" ], "default": null, "description": "New path suggestions (null keeps them)", "items": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string" }, "pathType": { "type": "string" } } } } } } } } }, "parameters": [ { "name": "id", "in": "path", "description": "Template ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The updated template", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "scope", "title", "description", "systemPrompt", "paths", "createdAt", "updatedAt" ], "properties": { "id": { "type": "integer", "format": "int64" }, "scope": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "systemPrompt": { "type": [ "string", "null" ] }, "paths": { "type": "array", "items": { "type": "object", "required": [ "path", "pathType" ], "properties": { "path": { "type": "string" }, "pathType": { "type": "string", "enum": [ "file", "directory" ] } } } }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Empty title, or a field is too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "404": { "description": "Template not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "delete": { "operationId": "project_template-admin-destroy", "summary": "Delete an instance template", "description": "This endpoint requires admin access", "tags": [ "project_template" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "Template ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "deleted" ], "properties": { "deleted": { "type": "boolean", "enum": [ true ] } } } } } }, "404": { "description": "Template not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/prompts": { "get": { "operationId": "prompt-admin-index", "summary": "List the instance prompts", "description": "This endpoint requires admin access", "tags": [ "prompt" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Instance prompts sorted by title", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "scope", "title", "description", "content", "createdAt", "updatedAt" ], "properties": { "id": { "type": "integer", "format": "int64" }, "scope": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "content": { "type": "string" }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "post": { "operationId": "prompt-admin-create", "summary": "Publish a prompt to every user", "description": "This endpoint requires admin access", "tags": [ "prompt" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "title", "content" ], "properties": { "title": { "type": "string", "description": "Title shown in the picker" }, "content": { "type": "string", "description": "Prompt text" }, "description": { "type": [ "string", "null" ], "default": null, "description": "Optional description" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The created prompt", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "scope", "title", "description", "content", "createdAt", "updatedAt" ], "properties": { "id": { "type": "integer", "format": "int64" }, "scope": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "content": { "type": "string" }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Missing title or content, or a field is too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/prompts/{id}": { "put": { "operationId": "prompt-admin-update", "summary": "Update an instance prompt", "description": "This endpoint requires admin access", "tags": [ "prompt" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": [ "string", "null" ], "default": null, "description": "New title (null keeps it)" }, "content": { "type": [ "string", "null" ], "default": null, "description": "New text (null keeps it)" }, "description": { "type": [ "string", "null" ], "default": null, "description": "New description ('' clears, null keeps it)" } } } } } }, "parameters": [ { "name": "id", "in": "path", "description": "Prompt ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The updated prompt", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "scope", "title", "description", "content", "createdAt", "updatedAt" ], "properties": { "id": { "type": "integer", "format": "int64" }, "scope": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "content": { "type": "string" }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "A field is empty or too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "404": { "description": "Prompt not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "delete": { "operationId": "prompt-admin-destroy", "summary": "Delete an instance prompt", "description": "This endpoint requires admin access", "tags": [ "prompt" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "Prompt ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "deleted" ], "properties": { "deleted": { "type": "boolean", "enum": [ true ] } } } } } }, "404": { "description": "Prompt not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/instructions": { "get": { "operationId": "instructions-get", "summary": "Get the instance instructions and where they apply", "description": "This endpoint requires admin access", "tags": [ "instructions" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Instructions, scope toggles and the length limit", "content": { "application/json": { "schema": { "type": "object", "required": [ "instructions", "scopes", "maxLength" ], "properties": { "instructions": { "type": "string" }, "scopes": { "type": "object", "required": [ "chat", "talk", "coworkers", "tasks" ], "properties": { "chat": { "type": "boolean" }, "talk": { "type": "boolean" }, "coworkers": { "type": "boolean" }, "tasks": { "type": "boolean" } } }, "maxLength": { "type": "integer", "format": "int64" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "put": { "operationId": "instructions-update", "summary": "Save the instance instructions and where they apply", "description": "This endpoint requires admin access", "tags": [ "instructions" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "instructions": { "type": [ "string", "null" ], "default": null, "description": "Text for every user ('' clears, null keeps it)" }, "scopes": { "type": [ "object", "null" ], "default": null, "description": "Where it applies: chat, talk, coworkers, tasks (omitted keys keep their value)", "additionalProperties": { "type": "boolean" } } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The saved state", "content": { "application/json": { "schema": { "type": "object", "required": [ "instructions", "scopes", "maxLength" ], "properties": { "instructions": { "type": "string" }, "scopes": { "type": "object", "required": [ "chat", "talk", "coworkers", "tasks" ], "properties": { "chat": { "type": "boolean" }, "talk": { "type": "boolean" }, "coworkers": { "type": "boolean" }, "tasks": { "type": "boolean" } } }, "maxLength": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Instructions are too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/settings": { "post": { "operationId": "settings-save-admin", "summary": "Save admin-level API key", "description": "Provider-specific settings (model, tokens, timeout, keys) go through ProviderSettingsController instead — they mean different things per provider, so they live on the provider's own schema.\nThis endpoint requires admin access", "tags": [ "settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "api_key": { "type": "string", "default": "", "description": "API key for the instance, scoped to $provider (default 'anthropic')" }, "provider": { "type": [ "string", "null" ], "default": null, "description": "Instance default provider ('anthropic'/'mistral', null keeps unchanged). Also scopes api_key in this call." }, "native_mcp_enabled": { "type": [ "string", "null" ], "default": null, "description": "Instance default for native-MCP ('1' enabled, '0' disabled, null keeps unchanged)" }, "native_mcp_extra_url": { "type": [ "string", "null" ], "default": null, "description": "Optional extra MCP server URL (trimmed; null keeps unchanged)" }, "native_mcp_extra_token": { "type": [ "string", "null" ], "default": null, "description": "Bearer token for the extra MCP server ('' clears, null keeps unchanged)" }, "mistral_connector_ids": { "type": [ "string", "null" ], "default": null, "description": "Comma/space-separated Mistral connector IDs for the native-MCP path (trimmed; null keeps unchanged)" }, "search_enabled": { "type": [ "string", "null" ], "default": null, "description": "Expose AIquila conversations to unified search ('1' enabled, '0' disabled, null keeps unchanged)" }, "auto_cache": { "type": [ "string", "null" ], "default": null, "description": "Top-level automatic prompt caching ('1' enabled, '0' disabled, null keeps unchanged)" }, "files_api": { "type": [ "string", "null" ], "default": null, "description": "Upload attachments to the Anthropic Files API ('1' enabled, '0' disabled, null keeps unchanged)" }, "server_fallback": { "type": [ "string", "null" ], "default": null, "description": "Retry a request Claude's safety classifiers decline on Anthropic's recommended fallback model ('1' enabled, '0' disabled, null keeps unchanged)" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Admin settings saved successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/native-mcp/status": { "get": { "operationId": "settings-native-mcp-status", "summary": "Get admin native-MCP config + per-server reachability snapshot", "description": "This endpoint requires admin access", "tags": [ "settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Admin native MCP settings", "content": { "application/json": { "schema": { "type": "object", "required": [ "enabled", "extraUrl", "hasExtraToken", "mistralConnectorIds", "servers" ], "properties": { "enabled": { "type": "boolean" }, "extraUrl": { "type": "string" }, "hasExtraToken": { "type": "boolean" }, "mistralConnectorIds": { "type": "string" }, "servers": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "url", "scheme_ok", "http_status", "reachable", "message" ], "properties": { "id": { "type": [ "integer", "null" ], "format": "int64" }, "name": { "type": "string" }, "url": { "type": "string" }, "scheme_ok": { "type": "boolean" }, "http_status": { "type": [ "integer", "null" ], "format": "int64" }, "reachable": { "type": "boolean" }, "message": { "type": "string" } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/providers": { "get": { "operationId": "provider_settings-admin-index", "summary": "List providers with their full settings schema and instance values", "description": "This endpoint requires admin access", "tags": [ "provider_settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "refresh", "in": "query", "description": "'1' to bypass the cached model lists", "schema": { "type": [ "string", "null" ], "default": null } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Provider settings for the instance", "content": { "application/json": { "schema": { "type": "object", "required": [ "defaultProvider", "providers" ], "properties": { "defaultProvider": { "type": "string" }, "providers": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "object" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/providers/{providerId}": { "post": { "operationId": "provider_settings-admin-update", "summary": "Save instance-scope settings for one provider", "description": "This endpoint requires admin access", "tags": [ "provider_settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "values": { "type": "object", "default": {}, "description": "Field id => value pairs", "additionalProperties": { "type": "object" } }, "makeDefault": { "type": [ "string", "null" ], "default": null, "description": "'1' to also make this the instance default provider" } } } } } }, "parameters": [ { "name": "providerId", "in": "path", "description": "Provider to configure", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Settings saved", "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rejected" ], "properties": { "status": { "type": "string" }, "rejected": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Unknown provider or invalid value", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/providers/{providerId}/test": { "post": { "operationId": "provider_settings-test", "summary": "Send a live request to a provider to confirm it is reachable and authorised", "description": "Optionally accepts a key that has not been saved yet, so an admin can verify one before committing it. The stored key is restored afterwards either way.\nThis endpoint requires admin access", "tags": [ "provider_settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "api_key": { "type": "string", "default": "", "description": "Key to test with; the saved key is used when empty" } } } } } }, "parameters": [ { "name": "providerId", "in": "path", "description": "Provider to test", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The provider answered", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "message" ], "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } } } } } }, "400": { "description": "No key available, or the provider rejected the request", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/providers/{providerId}/action/{actionId}": { "post": { "operationId": "provider_settings-admin-action", "summary": "Run an action declared by a provider's settings schema", "description": "Actions are buttons rather than stored values (ProviderSettingsSchema::action()). `value` carries whatever the action produced — for the Anthropic metadata salt that is the salt itself, which is why this endpoint is admin-only.\nThis endpoint requires admin access", "tags": [ "provider_settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "providerId", "in": "path", "description": "Provider owning the action", "required": true, "schema": { "type": "string" } }, { "name": "actionId", "in": "path", "description": "Id of the TYPE_ACTION field to run", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The action ran", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "message", "value" ], "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "value": { "type": "string" } } } } } }, "400": { "description": "Unknown provider, or the provider has no such action", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/providers/{providerId}/status": { "get": { "operationId": "provider_settings-admin-status", "summary": "Report whether a provider is reachable and serving the instance model", "description": "This endpoint requires admin access", "tags": [ "provider_settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "providerId", "in": "path", "description": "Provider to check", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Current provider health", "content": { "application/json": { "schema": { "type": "object", "required": [ "providerId", "state", "reason", "message", "model" ], "properties": { "providerId": { "type": "string" }, "state": { "type": "string" }, "reason": { "type": "string" }, "message": { "type": "string" }, "model": { "type": "string" } } } } } }, "400": { "description": "Unknown provider", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/principals": { "get": { "operationId": "provider_settings-principals", "summary": "Search users and groups for the provider access lists", "description": "Backs the principal pickers on the admin settings page. Admin-only: the personal page has no access fields, and an unprivileged user has no reason to enumerate the user directory through this app.\nThis endpoint requires admin access", "tags": [ "provider_settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "search", "in": "query", "description": "Substring to match against user and group names", "schema": { "type": "string", "default": "" } }, { "name": "limit", "in": "query", "description": "Maximum results per kind (clamped to 100)", "schema": { "type": "integer", "format": "int64", "default": 25 } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Matching users and groups", "content": { "application/json": { "schema": { "type": "object", "required": [ "users", "groups" ], "properties": { "users": { "type": "array", "items": { "type": "object", "required": [ "id", "label" ], "properties": { "id": { "type": "string" }, "label": { "type": "string" } } } }, "groups": { "type": "array", "items": { "type": "object", "required": [ "id", "label" ], "properties": { "id": { "type": "string" }, "label": { "type": "string" } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/occ": { "post": { "operationId": "occ-execute", "summary": "Execute an OCC command and return the output", "description": "This endpoint requires admin access", "tags": [ "occ" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "command": { "type": "string", "default": "", "description": "OCC command name (e.g. \"maintenance:mode\")" }, "args": { "type": "array", "default": [], "description": "Additional command arguments", "items": { "type": "string" } }, "timeout": { "type": "integer", "format": "int64", "default": 120, "description": "Execution timeout in seconds (1-600, default: 120)" } } } } } }, "responses": { "200": { "description": "Command completed; see exitCode for success/failure", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "stdout", "stderr", "exitCode" ], "properties": { "success": { "type": "boolean" }, "stdout": { "type": "string" }, "stderr": { "type": "string" }, "exitCode": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "No command was provided", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "error", "errorId" ], "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "403": { "description": "Not an admin, or the command and arguments are not in the OCC allowlist", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "success", "error", "errorId" ], "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorId": { "type": "string" } } }, { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } ] } } } }, "500": { "description": "The PHP CLI binary could not be located or the process failed to start", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "error", "errorId" ], "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "408": { "description": "The command exceeded the requested timeout", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "error", "errorId", "stdout", "stderr", "exitCode" ], "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorId": { "type": "string" }, "stdout": { "type": "string" }, "stderr": { "type": "string" }, "exitCode": { "type": "integer", "format": "int64" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/mcp-servers": { "get": { "operationId": "mcp_server-index", "summary": "List all configured MCP servers", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "List of MCP servers with masked auth tokens", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "display_name", "url", "auth_type", "is_enabled", "last_status", "last_error", "tool_count", "last_connected_at" ], "properties": { "id": { "type": "integer", "format": "int64" }, "display_name": { "type": "string" }, "url": { "type": "string" }, "auth_type": { "type": "string" }, "is_enabled": { "type": "boolean" }, "last_status": { "type": [ "string", "null" ] }, "last_error": { "type": [ "string", "null" ] }, "tool_count": { "type": [ "integer", "null" ], "format": "int64" }, "last_connected_at": { "type": [ "integer", "null" ], "format": "int64" } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "post": { "operationId": "mcp_server-create", "summary": "Add a new MCP server", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "default": "", "description": "Human-readable server name" }, "url": { "type": "string", "default": "", "description": "MCP server endpoint URL" }, "authType": { "type": "string", "default": "none", "description": "Authentication type (none or bearer)" }, "authToken": { "type": "string", "default": "", "description": "Bearer token for authentication" }, "registrationToken": { "type": "string", "default": "", "description": "RFC 7591 initial access token for gated OAuth client registration" }, "staticClientId": { "type": "string", "default": "", "description": "Client ID registered with the authorization server beforehand; used instead of dynamic registration" }, "staticClientSecret": { "type": "string", "default": "", "description": "Secret of that client, for a confidential client" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Created MCP server", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "display_name", "url", "auth_type", "is_enabled" ], "properties": { "id": { "type": "integer", "format": "int64" }, "display_name": { "type": "string" }, "url": { "type": "string" }, "auth_type": { "type": "string" }, "is_enabled": { "type": "boolean" } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/mcp-servers/{id}": { "put": { "operationId": "mcp_server-update", "summary": "Update an existing MCP server", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "default": "", "description": "Updated server name" }, "url": { "type": "string", "default": "", "description": "Updated endpoint URL" }, "authType": { "type": "string", "default": "", "description": "Updated auth type" }, "authToken": { "type": "string", "default": "", "description": "Updated bearer token" }, "registrationToken": { "type": [ "string", "null" ], "default": null, "description": "Updated registration token; null leaves it unchanged, an empty string clears it" }, "staticClientId": { "type": [ "string", "null" ], "default": null, "description": "Updated pre-registered client ID; null leaves it unchanged, an empty string clears it" }, "staticClientSecret": { "type": [ "string", "null" ], "default": null, "description": "Updated secret of the pre-registered client; null leaves it unchanged, an empty string clears it" }, "isEnabled": { "type": "boolean", "default": null, "description": "Whether the server is enabled" } } } } } }, "parameters": [ { "name": "id", "in": "path", "description": "Server ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Updated MCP server", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "display_name", "url", "auth_type", "is_enabled" ], "properties": { "id": { "type": "integer", "format": "int64" }, "display_name": { "type": "string" }, "url": { "type": "string" }, "auth_type": { "type": "string" }, "is_enabled": { "type": "boolean" } } } } } }, "404": { "description": "Server not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "delete": { "operationId": "mcp_server-destroy", "summary": "Delete an MCP server", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "Server ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Server deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string" } } } } } }, "404": { "description": "Server not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/mcp-servers/{id}/test": { "post": { "operationId": "mcp_server-test", "summary": "Test connection to an MCP server", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "Server ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Test result with success status and tool count", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "message", "tool_count" ], "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "tool_count": { "type": "integer", "format": "int64" } } } } } }, "404": { "description": "Server not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/mcp-servers/{id}/tools": { "get": { "operationId": "mcp_server-tools", "summary": "List tools from a specific MCP server", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "Server ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "List of tools from the server", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "name", "description" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } } } } }, "404": { "description": "Server not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "500": { "description": "Listing the tools failed", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/mcp-servers/{id}/oauth/authorize": { "post": { "operationId": "mcp_server-authorize", "summary": "Initiate the OAuth 2.1 PKCE flow for an MCP server", "description": "This endpoint requires admin access", "tags": [ "mcp_server" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "Server ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Authorize URL to open in popup", "content": { "application/json": { "schema": { "type": "object", "required": [ "authorize_url" ], "properties": { "authorize_url": { "type": "string" } } } } } }, "404": { "description": "Server not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "500": { "description": "Starting the authorization flow failed", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/coworker-triggers": { "get": { "operationId": "coworker-admin-trigger-policy", "summary": "Get the coworker trigger policy", "description": "This endpoint requires admin access", "tags": [ "coworker" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Whether triggers are on, and for whom", "content": { "application/json": { "schema": { "type": "object", "required": [ "enabled", "users", "groups" ], "properties": { "enabled": { "type": "boolean" }, "users": { "type": "array", "items": { "type": "string" } }, "groups": { "type": "array", "items": { "type": "string" } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "put": { "operationId": "coworker-set-admin-trigger-policy", "summary": "Set the coworker trigger policy", "description": "Triggers are off until turned on. Once on, they are open to everyone when both lists are empty, and otherwise to the users named and the members of the groups named. Settings left out are kept.\nThis endpoint requires admin access", "tags": [ "coworker" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled": { "type": [ "boolean", "null" ], "default": null, "description": "Whether coworker triggers are on" }, "users": { "type": [ "array", "null" ], "default": null, "description": "User IDs allowed to use them", "items": { "type": "string" } }, "groups": { "type": [ "array", "null" ], "default": null, "description": "Group IDs whose members may use them", "items": { "type": "string" } } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The saved policy", "content": { "application/json": { "schema": { "type": "object", "required": [ "enabled", "users", "groups" ], "properties": { "enabled": { "type": "boolean" }, "users": { "type": "array", "items": { "type": "string" } }, "groups": { "type": "array", "items": { "type": "string" } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/coworker-templates": { "get": { "operationId": "coworker-admin-templates", "summary": "List the coworker templates published for the instance", "description": "This endpoint requires admin access", "tags": [ "coworker" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Instance templates", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "object" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "post": { "operationId": "coworker-publish-template", "summary": "Publish one of the admin's own coworkers as an instance template", "description": "The template copies the coworker's task, schedule, input, output, provider, model and options. Coworkers later made from it are copies too.\nThis endpoint requires admin access", "tags": [ "coworker" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "coworkerId" ], "properties": { "coworkerId": { "type": "integer", "format": "int64", "description": "Coworker to publish (one of the caller's own)" }, "title": { "type": [ "string", "null" ], "default": null, "description": "Template title (default: the coworker's)" }, "description": { "type": [ "string", "null" ], "default": null, "description": "Template description (default: the coworker's)" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The published template", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "object" } } } } }, "400": { "description": "A field is too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "404": { "description": "Coworker not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/aiquila/api/admin/coworker-templates/{templateId}": { "delete": { "operationId": "coworker-delete-template", "summary": "Delete an instance coworker template", "description": "Coworkers already made from it are not touched.\nThis endpoint requires admin access", "tags": [ "coworker" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "templateId", "in": "path", "description": "Template ID", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "deleted" ], "properties": { "deleted": { "type": "boolean", "enum": [ true ] } } } } } }, "404": { "description": "Template not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error", "errorId" ], "properties": { "error": { "type": "string" }, "errorId": { "type": "string" } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "403": { "description": "Logged in account must be an admin", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } } }, "tags": [ { "name": "page", "description": "Page Controller for AIquila main interface" }, { "name": "stream_probe", "description": "A miniature Server-Sent Events endpoint whose only job is to be measured. The chat stream cannot double as a diagnostic: it needs a configured provider, a conversation and an LLM round trip, and it bills the account. This one emits a few empty ticks a fixed interval apart, so the StreamingNotBuffered setup check can tell whether something between PHP and the client is holding the response back — the failure that turns streaming chat into a long wait followed by the whole reply at once. It is a public page because the setup check requests it over the loopback without a session. It reveals nothing: the payload is a tick index and a server timestamp." }, { "name": "project_template", "description": "Project templates: the title, description, system prompt and path suggestions a new project is copied from. A project made from a template is a copy. Editing or deleting the template later leaves it alone. `/api/project-templates` holds the caller's own templates and lists the instance ones; `/api/admin/project-templates` is where admins publish instance templates." }, { "name": "prompt", "description": "The prompt library: reusable snippets a user inserts into a message or a project's system prompt. `/api/prompts` manages the caller's own prompts and lists the instance ones read-only. `/api/admin/prompts` is the admin side, for instance prompts only; the framework refuses those routes to non-admins." }, { "name": "instructions", "description": "Instance instructions: admin text placed in front of the system prompt for every user, on the surfaces the admin enables. Admin-only; the framework refuses both routes to other users." }, { "name": "provider_settings", "description": "Schema-driven read/write of provider configuration for the settings pages. Both the admin and the personal page render whatever LLMProviderInterface::getSettingsSchema() describes, so this controller never names a provider or a config key — adding a provider requires no change here. The admin/user split is enforced twice over: the admin routes carry no #[NoAdminRequired] (so Nextcloud requires an admin), and ProviderSettingsService::writeUser() additionally drops any field whose scope is not user-writable. That second check is what keeps endpoint URLs — which decide where the server sends outbound requests — out of reach of the personal page even if a route were ever mis-annotated. Provider *access* is enforced on top of that: index() only describes providers the current user is permitted to use, and update() refuses one they are not, so the personal page can neither see nor select a provider an admin blocked." }, { "name": "coworker", "description": "REST API for cowork tasks — persistent scheduled AI jobs. Consumed by the Cowork UI and by the MCP server (Basic Auth), hence NoCSRFRequired alongside NoAdminRequired." }, { "name": "coworker_trigger", "description": "The trigger URL of a coworker, for other systems: an orchestrator, a Webhook listeners webhook, a CI job. The caller has no Nextcloud session. It proves itself with the coworker's trigger secret as a bearer token (RFC 6750 §2.1, the header form only: a secret in the query string would end up in access logs). An unknown coworker and a wrong secret get the same 401, so the endpoint does not tell which coworker IDs exist, and both count as a brute-force attempt. The request body is not read. A trigger only says \"run now\"; what the run works on is the coworker's own input folder, so a caller cannot put text in front of the model or point the coworker at other files." } ] }