{
  "openapi": "3.1.0",
  "info": {
    "title": "UBOAT \u2014 Deep-Sourced OSINT & Decision Intelligence API",
    "version": "0.1.0",
    "description": "Intelligence beneath the surface. Living knowledge graph of technological progress and civilization infrastructure with cryptographic sources, evidence excerpts, epistemic uncertainty, and agent decision support."
  },
  "servers": [
    {
      "url": "http://edge.uboat.app"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Engine health check",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/stats": {
      "get": {
        "summary": "Global graph & epistemic health stats",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "Stats"
          }
        }
      }
    },
    "/api/v1/connectors": {
      "get": {
        "summary": "List registered OSINT connectors",
        "tags": [
          "Ingestion"
        ],
        "responses": {
          "200": {
            "description": "Connector list"
          }
        }
      }
    },
    "/api/v1/ingest": {
      "post": {
        "summary": "Run an OSINT connector and ingest documents into the living graph",
        "tags": [
          "Ingestion"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connector": {
                    "type": "string",
                    "example": "arxiv"
                  },
                  "query": {
                    "type": "string",
                    "example": "solid state battery"
                  },
                  "limit": {
                    "type": "integer",
                    "default": 10
                  }
                },
                "required": [
                  "connector",
                  "query"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ingestion run report"
          }
        }
      }
    },
    "/api/v1/documents": {
      "get": {
        "summary": "List raw sourced documents",
        "tags": [
          "Provenance"
        ],
        "responses": {
          "200": {
            "description": "Documents"
          }
        }
      },
      "post": {
        "summary": "Ingest a custom raw OSINT document",
        "tags": [
          "Ingestion"
        ],
        "responses": {
          "201": {
            "description": "Ingested"
          }
        }
      }
    },
    "/api/v1/documents/{id}": {
      "get": {
        "summary": "Get document by ID with content hash",
        "tags": [
          "Provenance"
        ],
        "responses": {
          "200": {
            "description": "Document"
          }
        }
      }
    },
    "/api/v1/entities": {
      "get": {
        "summary": "List canonical knowledge graph entities",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Entities"
          }
        }
      }
    },
    "/api/v1/entities/{id}": {
      "get": {
        "summary": "Get full entity dossier with uncertainty & relations",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Entity dossier"
          }
        }
      }
    },
    "/api/v1/entities/{id}/graph": {
      "get": {
        "summary": "Extract N-hop subgraph around an entity",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Subgraph"
          }
        }
      }
    },
    "/api/v1/relations": {
      "get": {
        "summary": "List typed evidenced relationships",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Relations"
          }
        }
      }
    },
    "/api/v1/claims": {
      "post": {
        "summary": "Submit a sourced claim and recompute Bayesian belief",
        "tags": [
          "Graph"
        ],
        "responses": {
          "201": {
            "description": "Claim recorded"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "summary": "Full-text search across entities & documents",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Search results"
          }
        }
      }
    },
    "/api/v1/path": {
      "get": {
        "summary": "Find shortest evidenced path between two entities (?from=&to=)",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Path"
          }
        }
      }
    },
    "/api/v1/signals": {
      "get": {
        "summary": "List synthesized intelligence signals",
        "tags": [
          "Intelligence"
        ],
        "responses": {
          "200": {
            "description": "Signals"
          }
        }
      }
    },
    "/api/v1/analytics/supply-chain/{entity}": {
      "get": {
        "summary": "Multi-hop supply chain trace with chokepoints & geo HHI",
        "tags": [
          "Analytics"
        ],
        "responses": {
          "200": {
            "description": "Supply chain trace"
          }
        }
      }
    },
    "/api/v1/analytics/bottlenecks": {
      "get": {
        "summary": "Detect & rank technological and supply-chain bottlenecks",
        "tags": [
          "Analytics"
        ],
        "responses": {
          "200": {
            "description": "Bottlenecks"
          }
        }
      }
    },
    "/api/v1/analytics/emerging": {
      "get": {
        "summary": "Track emerging technologies, TRL & hype-vs-reality gap",
        "tags": [
          "Analytics"
        ],
        "responses": {
          "200": {
            "description": "Emerging tech"
          }
        }
      }
    },
    "/api/v1/analytics/deployments": {
      "get": {
        "summary": "Verify commercial deployment evidence",
        "tags": [
          "Analytics"
        ],
        "responses": {
          "200": {
            "description": "Deployments"
          }
        }
      }
    },
    "/api/v1/analytics/opportunities": {
      "get": {
        "summary": "Discover underexplored high-leverage opportunities",
        "tags": [
          "Analytics"
        ],
        "responses": {
          "200": {
            "description": "Opportunities"
          }
        }
      }
    },
    "/api/v1/audit/{target_type}/{target_id}": {
      "get": {
        "summary": "Deep provenance lineage & leave-one-out sensitivity audit",
        "tags": [
          "Provenance"
        ],
        "responses": {
          "200": {
            "description": "Audit report"
          }
        }
      }
    },
    "/api/v1/decisions/evaluate": {
      "post": {
        "summary": "Evaluate a decision or compare candidate options for agents & automated systems",
        "tags": [
          "Agent Decisions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string"
                  },
                  "candidates": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "risk_tolerance": {
                    "type": "string",
                    "enum": [
                      "conservative",
                      "moderate",
                      "aggressive"
                    ]
                  },
                  "constraints": {
                    "type": "object"
                  }
                },
                "required": [
                  "question"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Structured Decision Brief"
          }
        }
      }
    },
    "/api/v1/agent/tools": {
      "get": {
        "summary": "Export machine-readable agent tool schemas (?format=mcp|openai|anthropic)",
        "tags": [
          "Agent Decisions"
        ],
        "responses": {
          "200": {
            "description": "Tool schemas"
          }
        }
      }
    },
    "/api/v1/agent/tools/{name}": {
      "post": {
        "summary": "Execute an agent tool directly over HTTP",
        "tags": [
          "Agent Decisions"
        ],
        "responses": {
          "200": {
            "description": "Tool output"
          }
        }
      }
    },
    "/api/v1/export": {
      "get": {
        "summary": "Export knowledge graph (?format=json|graphml)",
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "Export"
          }
        }
      }
    },
    "/api/v1/stream": {
      "get": {
        "summary": "Server-Sent Events (SSE) real-time intelligence stream",
        "tags": [
          "Streaming"
        ],
        "responses": {
          "200": {
            "description": "text/event-stream"
          }
        }
      }
    },
    "/api/v1/qamp/identity": {
      "get": {
        "summary": "Get UBOAT QAMP v0.2 cryptographic identity (did:key, SPKI, ALPNs)",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "200": {
            "description": "QAMP Identity"
          }
        }
      }
    },
    "/api/v1/qamp/manifest": {
      "get": {
        "summary": "Get QAMP v0.2 MANIFEST (tools, skills, limits, wire frame)",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "200": {
            "description": "QAMP Manifest"
          }
        }
      }
    },
    "/api/v1/qamp/delegations/mint": {
      "post": {
        "summary": "Mint an attenuated Q-AMP Delegation Token (qdt1.) for an autonomous agent",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "201": {
            "description": "Minted QDT"
          }
        }
      }
    },
    "/api/v1/qamp/delegations/verify": {
      "post": {
        "summary": "Verify a QDT delegation chain and argument policy",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "200": {
            "description": "Verification result"
          }
        }
      }
    },
    "/api/v1/qamp/delegations/revoke": {
      "post": {
        "summary": "Revoke a QDT delegation token by SHA-256 token_id",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "200": {
            "description": "Revoked"
          }
        }
      }
    },
    "/api/v1/qamp/invoke": {
      "post": {
        "summary": "Execute a wire-framed QAMP v0.2 tool invocation with QDT proofs & collab context",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "200": {
            "description": "Invocation result"
          }
        }
      }
    },
    "/api/v1/qamp/reachability": {
      "post": {
        "summary": "Mint a signed QAMP Reachability Record (qrr1.)",
        "tags": [
          "QAMP v0.2"
        ],
        "responses": {
          "200": {
            "description": "Reachability record"
          }
        }
      }
    },
    "/api/v1/analytics/simulate": {
      "post": {
        "summary": "Simulate counterfactual supply shock, export restriction, or breakthrough",
        "tags": [
          "Analytics"
        ],
        "responses": {
          "200": {
            "description": "Simulation report"
          }
        }
      }
    },
    "/api/v1/swarm/investigate": {
      "post": {
        "summary": "Run 4-agent QAMP Red-Team Swarm Investigation",
        "tags": [
          "Agent Decisions"
        ],
        "responses": {
          "200": {
            "description": "Swarm consensus report"
          }
        }
      }
    },
    "/api/v1/watchers": {
      "get": {
        "summary": "List continuous OSINT watchers",
        "tags": [
          "Watchers"
        ],
        "responses": {
          "200": {
            "description": "Watchers"
          }
        }
      },
      "post": {
        "summary": "Create a persistent OSINT watcher",
        "tags": [
          "Watchers"
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/api/v1/watchers/{id}/run": {
      "post": {
        "summary": "Run a watcher and detect epistemic belief deltas",
        "tags": [
          "Watchers"
        ],
        "responses": {
          "200": {
            "description": "Watcher run & alerts"
          }
        }
      }
    },
    "/api/v1/alerts": {
      "get": {
        "summary": "List epistemic delta & bottleneck alerts",
        "tags": [
          "Watchers"
        ],
        "responses": {
          "200": {
            "description": "Alerts"
          }
        }
      }
    },
    "/api/v1/graph/overview": {
      "get": {
        "summary": "Fetch graph nodes and edges for visual topology rendering",
        "tags": [
          "Graph"
        ],
        "responses": {
          "200": {
            "description": "Graph overview"
          }
        }
      }
    },
    "/api/v1/nodes/info": {
      "get": {
        "summary": "Get distributed node identity, role, region, and stats",
        "tags": [
          "Nodes"
        ],
        "responses": {
          "200": {
            "description": "Node info"
          }
        }
      }
    },
    "/api/v1/nodes/peers": {
      "get": {
        "summary": "List registered federated UBOAT peer nodes",
        "tags": [
          "Nodes"
        ],
        "responses": {
          "200": {
            "description": "Peers"
          }
        }
      },
      "post": {
        "summary": "Register a federated peer node by QAMP did:key",
        "tags": [
          "Nodes"
        ],
        "responses": {
          "201": {
            "description": "Peer added"
          }
        }
      }
    },
    "/api/v1/nodes/sync-bundle": {
      "get": {
        "summary": "Export QAMP-signed incremental knowledge graph sync bundle",
        "tags": [
          "Nodes"
        ],
        "responses": {
          "200": {
            "description": "Signed sync bundle"
          }
        }
      },
      "post": {
        "summary": "Verify and import a QAMP-signed peer sync bundle with belief-delta alerts",
        "tags": [
          "Nodes"
        ],
        "responses": {
          "200": {
            "description": "Import report"
          }
        }
      }
    }
  }
}