Skip to content

REST API & FastMCP Endpoints Reference

Overview

The backend service (src/web/) exposes RESTful endpoints and FastMCP Server-Sent Events (SSE) on port 8090 (internal container port 8000). Interactive OpenAPI Swagger documentation is available at http://localhost:8090/docs.

FastAPI Interactive OpenAPI Documentation

Core REST Endpoints Inventory

1. System Health & Observability

  • GET /api/health: Returns health status of PostgreSQL, Qdrant, Memgraph, RustFS S3, and Langfuse.
  • GET /api/observability/stats: Returns telemetry statistics and trace counts.

2. Specialized AI Agents & Multi-Agent Orchestration

  • POST /api/agents/run: Invokes a specialized Pydantic AI agent.
    • Request Body:
      {
      "agent_name": "RequirementsTraceabilityAgent",
      "query": "Assess traceability coverage for the Electronic Batch Record system",
      "system_code": "EBR"
      }
  • POST /api/agents/vsr: Compiles a formal Validation Summary Report.
    • Request Body:
      {
      "system_code": "LIMS"
      }
  • POST /api/demos/team-mission: Triggers an autonomous multi-agent squad mission (Missions 1 to 8).
    • Request Body:
      {
      "mission_id": 8
      }

3. Hybrid GraphRAG Querying

  • POST /api/query: Executes 3-tier parallel hybrid search.
    • Request Body:
      {
      "query": "What are the requirements for CDS audit trail review?",
      "system_code": "CDS",
      "limit": 5
      }
    • Response: Contains retrieved chunks, dense/sparse scores, Memgraph graph paths, and EvidenceGate verification badges.

4. Enterprise QMS & Regulatory Governance

  • GET /api/qms/documents: Returns list of controlled documents with filtering by status and type.
  • GET /api/qms/deviations: Returns list of open and closed quality deviations.
  • POST /api/qms/deviations: Logs a new IT deviation and triggers DeviationRcaAgent.
  • GET /api/qms/change-controls: Returns active engineering change controls.
  • POST /api/qms/sign: Executes an immutable 21 CFR Part 11 digital signature.
  • POST /api/qms/verify-manifest: Cryptographically verifies the SHA-256 integrity hash of a signed record.

5. Physical Asset Management

  • GET /api/assets: Returns list of enterprise assets with filtering by criticality and calibration status.
  • POST /api/assets: Registers a new physical instrument across PostgreSQL and Memgraph.

6. IT Service Desk

  • GET /api/helpdesk/tickets: Returns service desk tickets with GxP impact tags.
  • POST /api/helpdesk/tickets: Submits a new support ticket with AI impact classification.
  • PATCH /api/helpdesk/tickets/{ticket_id}: Updates status, triage, and resolution notes.

7. RustFS Object Storage & Queue Watcher

  • POST /api/storage/upload: Multipart upload of raw binary documents to S3.
  • GET /api/storage/presigned-url: Generates time-bounded presigned S3 download URL.
  • POST /api/storage/watcher/scan: Triggers an immediate scan of monitored S3 buckets.
  • GET /api/storage/queue: Returns pending items in the PostgreSQL workflow queue.

8. FastMCP Server Endpoint

  • GET /mcp/sse: FastMCP Server-Sent Events endpoint for discovering and executing MCP tools.