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

MethodPathDescription
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

EventDescription
session:updateSession status or activity changed
session:newNew session connected
session:endSession ended or disconnected
task:updateTask status changed
meeting:startMeeting started
meeting:endMeeting completed with summary
room:updateRoom assignment changed

Authentication

By default, the API has no authentication (designed for local use). To enable auth for remote access, see Security.