> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spineworkspace.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 13 — API Reference

> API reference for the triage system's intake, classification, and staging endpoints.

# API Reference

All triage-related endpoints across the platform.

## Knowledge Service

### GET /v1/knowledge/inbox

List triage items awaiting human review.

**Headers:** `x-tenant-id` (required)
**Query:** `limit` (default 50, max 100), `offset`
**Response:** Items with `approval_status IN ('pending', 'deferred')`

### PATCH /v1/knowledge/triage/:id

Human decision boundary for triage items.

**Headers:** `x-tenant-id` (required), `x-user-id` (required)
**Body:**

```json theme={null}
{
  "action": "approve|discard|defer",
  "reason": "Optional reason string"
}
```

**Response:**

```json theme={null}
{
  "success": true,
  "data": {
    "id": "triage-item-id",
    "approval_status": "approved|discarded|deferred",
    "action": "approve",
    "approved_by": "user-id",
    "approved_at": "2026-08-24T..."
  }
}
```

### POST /v1/triage/session

Classify and stage a session for triage. Called by MCP Connector.

**Headers:** `x-tenant-id` (required)
**Body:**

```json theme={null}
{
  "session_id": "uuid",
  "summary": "Session summary text",
  "memories": [{"text": "optional memory excerpt"}]
}
```

**Response:**

```json theme={null}
{
  "success": true,
  "data": {
    "session_id": "uuid",
    "priority": "medium",
    "category": "general",
    "sentiment": "neutral",
    "reasoning": "...",
    "approval_status": "pending"
  }
}
```

### GET /v1/triage/approved

List approved triage items for Memory Consolidator.

**Headers:** `x-tenant-id` (required)
**Query:** `start_time`, `end_time`, `limit` (default 100, max 500)
**Response:** Items with `approval_status = 'approved'`

### POST /v1/triage/run

Manually trigger a triage consolidation cycle.

**Headers:** `x-tenant-id` (required)
**Body:**

```json theme={null}
{
  "type": "hourly|daily|weekly"
}
```

**Response:**

```json theme={null}
{
  "success": true,
  "data": {
    "status": "completed",
    "type": "hourly",
    "input_items": 15,
    "categories": ["sales", "engineering"],
    "consolidated_memories": 3
  }
}
```

### GET /v1/triage/status

Get triage pipeline status.

**Headers:** `x-tenant-id` (required)
**Response:**

```json theme={null}
{
  "success": true,
  "data": {
    "tenant_id": "...",
    "total_sessions": 150,
    "total_consolidated_memories": 25,
    "recent_promotions_24h": 5,
    "triage_pipeline": ["extract", "validate", "dedup", "score", "classify", "promote"]
  }
}
```

## IQ Hub (Knowledge Service)

### POST /conversations/:id/archive

Archive a conversation and trigger memory extraction.

**Headers:** `x-tenant-id`, `x-user-id` (both required)
**Query:** `extract_memories` (default true)
**Response:**

```json theme={null}
{
  "success": true,
  "memories_extracted": 3,
  "memory_ids": ["uuid1", "uuid2", "uuid3"]
}
```

### GET /sessions

List sessions for Memory Consolidator.

**Headers:** `x-tenant-id` (required)
**Query:** `start_time`, `end_time`, `limit`
**Response:**

```json theme={null}
{
  "items": [{"id": "...", "tenant_id": "...", "content": "..."}]
}
```

## Memory Consolidator

### POST /trigger/:type

Manually trigger consolidation.

**Path:** `type` = hourly | daily | weekly
**Response:**

```json theme={null}
{
  "status": "queued",
  "task": {"type": "hourly", "start_time": "...", "end_time": "..."}
}
```

### GET /status

Get consolidator status including last run times and locks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.