{
    "name": "IAN Agents API",
    "version": "4.1.0",
    "docs": "https://api.ianagents.com/docs.html",
    "health": "/health",
    "dashboard": "https://api.ianagents.com/dashboard/",
    "mcp": "/mcp?key=YOUR_API_KEY",
    "endpoints": {
        "auth": {
            "POST /auth/register": "Create account",
            "POST /auth/login": "Login (JWT)",
            "GET  /auth/me": "Profile",
            "PATCH /auth/me": "Update profile / OpenAI key",
            "GET  /auth/api-keys": "List API keys",
            "POST /auth/api-keys": "Generate API key",
            "DELETE /auth/api-keys/{id}": "Revoke API key"
        },
        "thoughts": {
            "POST /v1/thoughts": "Append thought (dedup auto)",
            "POST /v1/thoughts/retrospective": "Append retrospective shortcut",
            "POST /v1/thoughts/search": "Search (fulltext)",
            "POST /v1/thoughts/semantic": "Search (embeddings)",
            "POST /v1/thoughts/supersede": "Replace thought",
            "POST /v1/thoughts/traverse": "Paginated walk",
            "GET  /v1/thoughts/{uuid}": "Get by UUID",
            "GET  /v1/thoughts/head": "Latest thought",
            "GET  /v1/thoughts/genesis": "First thought",
            "POST /v1/thoughts/{uuid}/ttl": "Set expiration",
            "POST /v1/thoughts/{uuid}/archive": "Archive",
            "POST /v1/thoughts/{uuid}/unarchive": "Unarchive",
            "DELETE /v1/thoughts/{uuid}": "Emergency delete (breaks chain, admin only)"
        },
        "chains": {
            "GET  /v1/chains": "List chains",
            "POST /v1/chains": "Create chain (auto-generates API key)",
            "GET  /v1/chains/{key}": "Get chain detail",
            "POST /v1/chains/bootstrap": "Chain + first thought",
            "POST /v1/chains/fork": "Fork chain",
            "PATCH /v1/chains/{key}/access": "Set access mode (read/readwrite/admin)",
            "GET  /v1/chains/{key}/key": "Get chain API key info",
            "POST /v1/chains/{key}/key/regenerate": "Regenerate chain API key"
        },
        "context": {
            "GET  /v1/recent-context": "Prompt snippet",
            "GET  /v1/context": "Context with templates",
            "GET  /v1/memory-markdown": "Export MEMORY.md",
            "POST /v1/context-templates": "Create template",
            "GET  /v1/context-templates": "List templates",
            "DELETE /v1/context-templates/{name}": "Delete template"
        },
        "ai_features": {
            "POST /v1/ingest": "Auto-extract thoughts (LLM)",
            "POST /v1/embeddings/backfill": "Backfill embeddings"
        },
        "agents": {
            "POST /v1/agents": "Upsert agent",
            "GET  /v1/agents": "List agents",
            "GET  /v1/agents/{id}": "Agent detail",
            "POST /v1/agents/{id}/keys": "Register Ed25519 key",
            "DELETE /v1/agents/{id}/keys/{kid}": "Revoke agent key",
            "POST /v1/agents/{id}/disable": "Disable agent"
        },
        "skills": {
            "POST /v1/skills/upload": "Upload skill (versioned)",
            "POST /v1/skills/search": "Search skills",
            "GET  /v1/skills/{id}": "Read skill",
            "GET  /v1/skills/{id}/versions": "Version history",
            "POST /v1/skills/{id}/deprecate": "Deprecate skill",
            "POST /v1/skills/{id}/revoke": "Revoke skill"
        },
        "workspaces": {
            "GET  /v1/workspaces": "List workspaces",
            "POST /v1/workspaces": "Create workspace",
            "GET  /v1/workspaces/{key}": "Get workspace",
            "PATCH /v1/workspaces/{key}": "Update workspace",
            "DELETE /v1/workspaces/{key}": "Delete workspace (moves chains to default)",
            "POST /v1/workspaces/{key}/assign-chain": "Move chain to workspace",
            "POST /v1/workspaces/{key}/generate-key": "Generate workspace-scoped key"
        },
        "connectors": {
            "GET  /v1/connectors/presets": "List connector presets (openclaw, picoclaw, claude_cowork, etc.)",
            "GET  /v1/connectors": "List connectors",
            "POST /v1/connectors": "Create connector (auto-generates scoped API key)",
            "GET  /v1/connectors/{key}": "Get connector",
            "PATCH /v1/connectors/{key}": "Update connector",
            "DELETE /v1/connectors/{key}": "Delete connector",
            "POST /v1/connectors/{key}/regenerate-key": "Regenerate connector API key"
        },
        "webhooks": {
            "POST /v1/webhooks": "Create webhook",
            "GET  /v1/webhooks": "List webhooks",
            "DELETE /v1/webhooks/{id}": "Delete webhook"
        },
        "integrity": {
            "GET  /v1/integrity/verify": "Verify hash-chain",
            "POST /v1/integrity/verify": "Verify hash-chain (POST form)"
        },
        "lifecycle": {
            "POST /v1/lifecycle/process-expired": "Archive expired thoughts",
            "POST /v1/thoughts/archive/bulk": "Archive bulk thoughts",
            "POST /v1/thoughts/unarchive/bulk": "Unarchive bulk thoughts",
            "POST /v1/thoughts/ttl/bulk": "Set TTL bulk",
            "POST /v1/thoughts/delete/bulk": "Hard delete bulk (Pro+)"
        },
        "memory_graph": {
            "POST /v1/memory/activate": "Spreading activation BFS (concept/ref/embedding/temporal edges)",
            "POST /v1/memory/strengthen": "Manually strengthen edge between 2 thoughts (from + to UUIDs)",
            "POST /v1/memory/consolidate": "Consolidate identitarios from candidates chain to YO",
            "POST /v1/memory/forget": "Decay edges below threshold",
            "POST /v1/thoughts/{uuid}/pin": "Pin thought as permanent anchor",
            "POST /v1/thoughts/{uuid}/unpin": "Remove anchor status"
        },
        "concepts": {
            "GET  /v1/concepts": "List concepts in a chain (?chain_key=...)",
            "POST /v1/concepts/graph": "Build concept knowledge graph",
            "GET  /v1/concepts/aggregates": "Concept aggregates for a persona"
        },
        "analysis": {
            "POST /v1/thoughts/timeline": "Temporal view grouped by type/date/agent",
            "POST /v1/thoughts/diff": "What changed between two dates",
            "POST /v1/thoughts/state-at": "Chain state before a UUID or date",
            "POST /v1/thoughts/reflect": "LLM synthesis over memory"
        },
        "audit": {
            "POST /v1/audit/session/start": "Start Cowork audit session \u2014 returns session_id",
            "POST /v1/audit/action": "Log action (click/type/navigate/...) with session_id",
            "POST /v1/audit/session/complete": "Close session with session_hash",
            "GET  /v1/audit/sessions": "List sessions for a chain",
            "POST /v1/audit/session/verify": "Verify tamper integrity",
            "POST /v1/skills/transcript": "Save full transcript as versioned skill"
        },
        "personas": {
            "GET  /v1/personas": "List personas",
            "GET  /v1/personas/{bot}": "Get persona metadata",
            "GET  /v1/personas/{bot}/assemble": "Build full system prompt (SOUL+BODY+skills+memory)"
        },
        "self_graph": {
            "GET  /v1/self-graph/list": "List all self-graphs",
            "GET  /v1/self-graph": "Get self-graph by bot/persona_id/chain_key",
            "POST /v1/self-graph": "Create/upsert self-graph (persona + chains)",
            "POST /v1/self-graph/chain": "Add chain to self-graph",
            "DELETE /v1/self-graph/chain": "Remove chain (cannot remove default)",
            "GET  /v1/self-graph/resolve": "Resolve chain to its persona + siblings"
        },
        "cerebro_v2": {
            "GET  /v1/drives/{agent_id}": "Get drive state",
            "POST /v1/drives/{agent_id}/event": "Emit drive event",
            "POST /v1/drives/{agent_id}/set": "Force-set drive value",
            "POST /v1/drives/{agent_id}/tick": "Apply hourly decay",
            "POST /v1/promote": "Promote thought to YO chain (enum reasons)",
            "POST /v1/consolidate": "Bulk-promote candidates to YO",
            "POST /v1/procedural/record": "Record tool sequence + outcome",
            "GET  /v1/procedural/top": "Top-K reinforced sequences",
            "GET  /v1/rupture/persona/{persona_id}": "List open rupture events",
            "POST /v1/rupture/{event_id}/integrate": "Mark event integrated",
            "POST /v1/rupture/check": "Check thought vs pinned",
            "POST /v1/predict/record": "Record prediction",
            "POST /v1/predict/verify": "Verify against observed",
            "POST /v1/routing/verdict": "Mark routing decision correct/wrong",
            "GET  /v1/routing/accuracy": "Routing accuracy last N days",
            "GET  /v1/routing/recent-errors": "Recent routing errors",
            "GET  /v1/routing/drift/{persona_id}": "Routing drift events"
        },
        "leads": {
            "POST /v1/leads/match-or-create": "Idempotent lead lookup/create by channels[]",
            "GET  /v1/leads/{lead_id}": "Get lead with channels + activities",
            "PATCH /v1/leads/{lead_id}": "Update fields (stage/status/notes/...)",
            "POST /v1/leads/{lead_id}/stage": "Set commercial stage",
            "POST /v1/leads/{lead_id}/activity": "Log timeline activity",
            "GET  /v1/leads/recent": "List recent leads (filters: status/stage/persona/channel/q)"
        },
        "simple_access": {
            "GET /memo": "Plaintext API (any AI)",
            "GET /v1/simple": "JSON API (no headers needed)",
            "POST /mcp": "MCP JSON-RPC (97 tools / 16 categories)"
        }
    }
}