Skip to main content

List workspaces

GET /api/workspaces
{
  "workspaces": [{
    "id": "ws-support-bot",
    "name": "Support Bot",
    "team": "Customer Support",
    "status": "active",
    "model": "balanced",
    "connection_count": 1,
    "tool_count": 4,
    "knowledge_count": 0,
    "queries_today": 12,
    "cost_mtd": 0.45
  }]
}

Create workspace

POST /api/workspaces
FieldTypeRequiredDescription
namestringYesWorkspace name
team_idstringNoExisting team ID
team_namestringNoTeam name (creates new team if no match)
system_promptstringNoSystem prompt
{"id": "ws-hr-assistant", "name": "HR Assistant", "status": "active"}

Get workspace summary

GET /api/workspaces/:id/summary
Lightweight response: id, name, status, model, system prompt, timeouts, team.
{"workspace": {"id": "...", "name": "...", "status": "active", "model": "balanced", "team": "Engineering"}}

Get workspace detail

GET /api/workspaces/:id
Full response with all child resources and stats.
{
  "workspace": {"id": "...", "name": "...", "status": "active", "model": "balanced"},
  "connections": [{"id": "...", "name": "order-service", "type": "mcp", "status": "connected"}],
  "tools": [{"id": "...", "name": "get_order", "is_write": false}],
  "knowledge": [],
  "guardrails": [],
  "consumers": [{"id": "...", "type": "slack", "status": "active"}],
  "permissions": [{"role": "member", "tool_patterns": "[\"*\"]"}],
  "stats": {
    "today": 42,
    "week": 300,
    "month": 1200,
    "avg_ms": 850,
    "cost_mtd": 12.45,
    "error_rate": 0.02
  }
}

Update workspace

PUT /api/workspaces/:id
FieldTypeDescription
namestringDisplay name
modelstringModel tier
system_promptstringSystem instructions
cold_timeout_minutesnumberMinutes before conversation goes cold
close_timeout_minutesnumberMinutes after cold before conversation closes

Get dashboard

GET /api/workspaces/:id/dashboard
Comprehensive metrics: tickets, sentiment, compliance, knowledge gaps, resolution, cost, usage, recent conversations, categories, channels.

Get activity

GET /api/workspaces/:id/activity?limit=20&offset=0
Paginated audit log.
{
  "activity": [{
    "id": "...",
    "user_name": "Jane",
    "query": "What's the status of order ORD-2026-001?",
    "tools_called": ["get_order_status"],
    "connections_hit": ["order-service"],
    "tokens_input": 860,
    "tokens_output": 310,
    "cost_usd": 0.008,
    "duration_ms": 2340,
    "created_at": "2026-04-18T12:00:00Z"
  }],
  "total": 45
}

Get connections

GET /api/workspaces/:id/connections
{"connections": [...], "tools": [...]}

Get consumers

GET /api/workspaces/:id/consumers
{"consumers": [...]}

Get knowledge

GET /api/workspaces/:id/knowledge
{"knowledge": [...], "gaps": [...]}

Get compliance

GET /api/workspaces/:id/compliance
{"guardrails": [...], "violations": [...]}