Core API¶
ChaCC API includes a small set of built-in endpoints for service discovery, health checks, and module lifecycle management. Additional endpoints are mounted by modules.
Root¶
Returns a welcome message and points users to the FastAPI documentation.
Health checks¶
Basic health¶
Readiness¶
Runs a lightweight database query and reports whether the API and database are ready.
Liveness¶
Module management¶
Module management endpoints are available under the Core tag. When an
authentication module is loaded and registers get_current_user, these routes
require a bearer token. Without an authentication module, the core routes are
open.
Install a module¶
Upload a .chacc archive as multipart form data.
Response:
{
"message": "Module 'billing' installed/updated successfully. Dependencies resolved. Please restart the API server to apply changes."
}
Validation:
- File name must end with
.chacc. - Archive must contain
module_meta.json. module_meta.jsonmust containname.- Dependencies are resolved before extraction.
- A server restart is required to activate the new module.
List modules¶
{
"modules": [
{
"name": "authentication",
"display_name": "Authentication Module",
"version": "0.1.0",
"author": "ChaCC",
"description": "Authentication support.",
"is_enabled": true,
"base_path_prefix": "/auth"
}
]
}
Enable a module¶
Marks a module enabled in the database, resolves dependencies, extracts the archive, and requires a restart to mount it.
Disable a module¶
Marks a module disabled in the database, removes its extracted code directory, and requires a restart to unmount it.
Uninstall a module¶
Removes:
- The module archive from
.modules_installed/. - The extracted module directory from
.modules_loaded/. - The
ModuleRecordfrom the database.
A restart is required to complete the uninstall.
Rate limiting¶
The backbone installs a SlowAPI limiter and a custom handler for
RateLimitExceeded. Module routes can use context.limiter for throttling.
Example: