API Reference
CrewHub exposes a REST API on http://localhost:8090. Interactive API docs (Swagger UI) are available at http://localhost:8090/docs.
Core Endpoints
| Method | Path | Description |
|---|---|---|
GET | /health | Health check — returns version and status |
GET | /api/sessions | List all active sessions |
GET | /api/sessions/{id} | Session detail including history |
POST | /api/sessions/{id}/message | Send a message to an agent |
GET | /api/rooms | List all rooms |
POST | /api/rooms | Create a room |
GET | /api/tasks | List all tasks |
POST | /api/tasks | Create a task |
POST | /api/tasks/{id}/run | Run a task with an agent |
GET | /api/settings | Get all settings |
PATCH | /api/settings | Update settings |
Server-Sent Events
Subscribe to real-time events at GET /events. Use the native EventSource API:
const es = new EventSource('http://localhost:8090/events');
es.addEventListener('session:update', handler);
es.addEventListener('task:update', handler);
// event.data contains JSON with the updated object Event Types
| Event | Description |
|---|---|
session:update | Session status or activity changed |
session:new | New session connected |
session:end | Session ended or disconnected |
task:update | Task status changed |
meeting:start | Meeting started |
meeting:end | Meeting completed with summary |
room:update | Room assignment changed |
Authentication
By default, the API has no authentication (designed for local use). To enable auth for remote access, see Security.