Architecture & API8 min read

Complete REST & SSE API Reference

Interactive reference for all /api/v1 endpoints: Auth, Users, Charts, Batch Jobs SSE, Regression Datasets, Skills, Knowledge Space, Settings & System.

Authentication & Quick Integration

REST v1 + SSE
  • All endpoints are mounted under /api/v1.
  • Authenticate using Authorization: Bearer <jwt> or static X-API-Key: sk_amd_... header.
  • SSE streams and export downloads (/events, /download) also accept ?token=<jwt>.
  • readonly tokens receive HTTP 403 Forbidden on any mutating route.
Code a Clinical Chart via Static API Key
bash
curl -X POST https://atreyamd.hospital.internal/api/v1/charts/code \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_amd_your_static_key_here" \
  -d '{
    "chart_id": "ENC-2026-00419",
    "chart_text": "DISCHARGE SUMMARY: Acute on chronic systolic heart failure exacerbation with essential hypertension and stage 3b CKD.",
    "department": "inpatient_medicine",
    "client_id": "acme_health",
    "insurer_id": "medicare_cms",
    "encounter_type": "inpatient"
  }'

Interactive Endpoint Directory

  • Filter across all 9 endpoint groups or by required RBAC role (Public, readonly, admin).
Method & PathGroupMin RoleDescription
POST/api/v1/auth/loginAuthPublicAuthenticate username/password → signed HS256 Bearer token + profile (incl. own api_key).
GET/api/v1/auth/meAuthreadonlyReturn current authenticated user & own static API key.
POST/api/v1/auth/change-passwordAuthreadonlyRotate own password & clear must_change_password flag.
POST/api/v1/auth/api-keyAuthreadonlyGenerate single immutable static API key (sk_amd_...; 409 if already exists).
GET/api/v1/usersUsersadminList all users (masked API key prefixes only).
POST/api/v1/usersUsersadminCreate admin or readonly account.
PUT/api/v1/users/{user_id}UsersadminUpdate display name, role, active flag, or reset password.
DELETE/api/v1/users/{user_id}UsersadminDelete user (blocks self-delete or removing last active admin).
POST/api/v1/charts/codeChartsadminCode single clinical chart → billable codes, verbatim spans & 6-stage Explainability DAG.
GET/api/v1/charts/explain/{run_id}ChartsreadonlyFetch persisted Explainability DAG trace by run_id.
POST/api/v1/jobs/previewBatch JobsadminStream-preview CSV/TSV/Parquet/JSONL schema & auto column mapping.
POST/api/v1/jobsBatch JobsadminCreate & enqueue durable checkpointed batch job from staged upload.
GET/api/v1/jobsBatch JobsreadonlyList all batch jobs with progress counters & dataset F1 metrics.
GET/api/v1/jobs/{job_id}/eventsBatch JobsreadonlyLive Server-Sent Events (SSE) progress stream.
GET/api/v1/jobs/{job_id}/resultsBatch JobsreadonlyPaginated coded chart rows + Explainability DAGs + chart metrics.
GET/api/v1/jobs/{job_id}/downloadBatch JobsreadonlyExport coded job output as parquet, csv, or jsonl.
POST/api/v1/jobs/{job_id}/retry-failedBatch JobsadminResume only failed checkpoints without re-billing succeeded charts.
POST/api/v1/jobs/{job_id}/cancelBatch JobsadminCancel active batch job cleanly.
DELETE/api/v1/jobs/{job_id}Batch JobsadminDelete batch job and cascade checkpoints.
GET/api/v1/datasetsRegression DatasetsreadonlyList editable ground-truth regression datasets.
POST/api/v1/datasets/uploadRegression DatasetsadminUpload CSV/TSV/Parquet/JSONL containing expected_codes ground truth.
PUT/api/v1/datasets/{dataset_id}/rows/{row_id}Regression DatasetsadminInline-edit chart text or expected ICD-10-CM codes.
POST/api/v1/datasets/{dataset_id}/runRegression DatasetsadminRun dataset as scored evaluation batch computing Micro/Macro F1.
GET/api/v1/skillsSkills (.md)readonlyList .md skills grouped by scope (global, client, department, insurer).
POST/api/v1/skills/validateSkills (.md)readonlyValidate YAML frontmatter & hard_rules schema live.
POST/api/v1/skills/evalSkills (.md)adminRun 'CI for .md' draft vs production regression benchmark.
PUT/api/v1/skills/{scope}/{name}Skills (.md)adminPublish new SHA-256 versioned skill & invalidate exact chart cache.
GET/api/v1/skills/{scope}/{name}/diffSkills (.md)readonlyReturn unified diff between any two SHA-256 skill versions.
POST/api/v1/skills/{scope}/{name}/rollbackSkills (.md)admin1-click rollback to any prior skill version.
GET/api/v1/vector/statsKnowledge SpacereadonlyCatalog stats, embedding model/dim alignment, chapters & KG counts.
POST/api/v1/vector/searchKnowledge SpacereadonlyHybrid RRF, BM25 lexical, or Dense Vector top-K ICD-10-CM search.
POST/api/v1/vector/embeddings-3dKnowledge Spacereadonly3D SVD PCA cluster projection + multi-query directional vectors & cosine angles.
GET/api/v1/vector/kg/subgraphKnowledge Spacereadonly1-hop / 2-hop ICD Knowledge Graph subgraph around any code.
PUT/api/v1/vector/nodes/{code}Knowledge SpaceadminCreate/edit live Knowledge overlay & update index.
POST/api/v1/vector/ingest-bundleKnowledge SpaceadminStream SHA-256 verified pre-embedded .csv.gz bundle into PostgreSQL.
POST/api/v1/vector/reloadKnowledge SpaceadminHot-reload DB catalog + overlays + rebuild BM25 & KG indexes.
GET/api/v1/icd/code/{code}ICD & MemoryreadonlyTabular node details + recursive billable children lookup.
POST/api/v1/icd/validateICD & MemoryreadonlyExecute Zero-LLM CMS Compliance Validator directly on any code list.
GET/api/v1/memoryICD & MemoryreadonlyList tenant-isolated (client_id, insurer_id) episodic coder overrides.
POST/api/v1/memoryICD & MemoryadminAdd tenant-scoped episodic lesson.
GET/api/v1/settingsSettings & SystemreadonlyFetch LLM profiles, object storage, privacy/tools & MCP configs.
POST/api/v1/settings/mcp/{id}/discoverSettings & SystemadminRun JSON-RPC tools/list discovery on a connected company MCP server.
GET/api/v1/system/healthSettings & SystemPublicLiveness probe (status, version, environment, auth_enabled).
GET/api/v1/system/statusSettings & SystemreadonlyRuntime telemetry, DB/Redis/storage backends, ICD counts & license status.
POST/api/v1/system/licenseSettings & SystemadminHot-install a renewed signed Ed25519 .lic file with zero downtime.
GET/api/v1/system/audit-logsSettings & SystemreadonlyInspect tamper-evident SHA-256 hash-chained HIPAA audit trail.