openapi: "3.1.0" info: title: aimee-kb API version: "1" description: | Public HTTP API for the aimee knowledge-base sidecar (aimee-kb). Enabled by setting kb.api.http_port in aimee config. Optional bearer-token auth uses a Vault-backed credential. A Kubernetes or first-boot environment value is synchronously sealed and scrubbed before the long-lived service starts; configuration reads expose only configured state. servers: - url: "http://127.0.0.1:{port}/v1" variables: port: default: "8090" description: Configured kb_api_http_port security: - bearerAuth: [] components: securitySchemes: bearerAuth: type: http scheme: bearer schemas: HealthResponse: # Operational liveness + dependency status. The payload is diagnostic and # may grow new fields; additionalProperties is true so generated SDK # clients accept forward-compatible additions. type: object additionalProperties: true required: [status] properties: status: type: string enum: [ok, degraded] description: >- Whether the KB can do its job, derived from `blockers`, not whether this handler ran. `degraded` means it answered and cannot work; the reasons are in `blockers`. A degraded KB is still up: treat it as reachable and read the blockers, do not retry it as a transport failure. Advisory findings live in `warnings` and leave status `ok`. postgres_ok: type: boolean description: KB_STORE (Postgres) reachable knowledge_tables_ok: type: boolean description: required kb tables present pgvec_ok: type: boolean description: pgvector extension available pgvec_collection_ok: type: boolean embed_ok: type: boolean embed_command: type: string chunk_count: type: integer embedding_count: type: integer warnings: type: array description: Advisory findings. Noteworthy, but the KB still works. items: type: string blockers: type: array description: >- Reasons the KB cannot do its job, each naming its remedy. Empty exactly when status is ok. This is the field to show an operator. items: type: string VersionResponse: type: object required: [version, service] properties: version: type: string example: "0.2.0" service: type: string example: "aimee-kb" CapabilitiesResponse: type: object required: [capabilities, version] properties: capabilities: type: array items: type: string example: ["memory", "search", "index"] version: type: string ErrorResponse: type: object required: [error] properties: error: type: string ServerLiveHealthResponse: type: object additionalProperties: false required: [server_id, status] properties: server_id: type: string status: type: string const: ok ServerAgentsResponse: type: object additionalProperties: false required: [server_id, team, agents] properties: server_id: type: string minLength: 1 maxLength: 127 pattern: "^[A-Za-z0-9._-]+$" team: type: integer format: int64 minimum: 1 agents: type: array maxItems: 16 items: type: object additionalProperties: false required: [name, provider, model, enabled, delegate_available, primary_only, max_parallel] properties: name: { type: string, minLength: 1, maxLength: 63, pattern: "^[A-Za-z0-9._-]+$" } provider: { type: string, minLength: 1, maxLength: 15, pattern: "^[A-Za-z0-9._-]+$" } model: { type: string, minLength: 1, maxLength: 127, pattern: "^[A-Za-z0-9._:/+-]+$" } enabled: { type: boolean } delegate_available: { type: boolean } primary_only: { type: boolean } max_parallel: { type: integer, minimum: 0, maximum: 1024 } ServerSafeConfigResponse: type: object additionalProperties: false required: [server_id, team, config] properties: server_id: { type: string, minLength: 1, maxLength: 127, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]{0,126}$" } team: { type: integer, format: int64, minimum: 1 } config: type: object additionalProperties: false required: [mtls, remote_writes, client_transport, cli_session_forwarding, require_aimee_git] properties: mtls: { type: string, enum: [off, optional, required] } remote_writes: { type: string, enum: [off, data, full] } client_transport: { type: string, enum: [socket, http, auto] } cli_session_forwarding: { type: boolean } require_aimee_git: { type: boolean } # ── Phase 3–4: Ingest API and corpus staging schemas ─────────────────── DocIngestResponse: type: object properties: doc_id: type: integer format: int64 state: type: string enum: [staged] DocsManifestRequest: type: object required: [docs] properties: scope: type: string default: global docs: type: array items: type: object required: [content_hash] properties: doc_key: type: string path: type: string content_hash: type: string scope: type: string DocsManifestResponse: type: object required: [missing, total, present, missing_count] properties: missing: type: array items: type: object properties: doc_key: type: string content_hash: type: string scope: type: string total: type: integer present: type: integer missing_count: type: integer DocMetadataResponse: type: object properties: id: type: integer format: int64 filename: type: string content_hash: type: string converter: type: string converter_version: type: string scope: type: string state: type: string review_needed: type: boolean created_at: type: string format: date-time ReviewQueueResponse: type: object properties: docs: type: array items: $ref: "#/components/schemas/DocMetadataResponse" next_cursor: type: integer format: int64 nullable: true ReviewAcceptRequest: type: object properties: release_id: type: integer format: int64 ReviewRejectRequest: type: object required: [reason] properties: reason: type: string CreateReleaseRequest: type: object required: [name] properties: name: type: string CreateReleaseResponse: type: object properties: release_id: type: integer format: int64 state: type: string enum: [pending] RollbackRequest: type: object properties: target_release_id: type: integer format: int64 ActiveReleaseResponse: type: object properties: release_id: type: integer format: int64 nullable: true name: type: string state: type: string promoted_at: type: string # ── Phase 5: Retrieval schemas ────────────────────────────────────────── SearchHit: type: object properties: project: type: string description: Stable owning project identity; empty only for non-project shared artifacts. artifact_id: type: string score: type: number format: double kind: type: string excerpt: type: string citations: type: array items: type: object properties: source_kind: type: string source_id: type: string SearchRequest: type: object required: [query] properties: query: type: string project: type: string description: >- Stable project identity. Defaults to the authenticated active project. With `scope: all`, this identifies the protected active-project head bucket. scope: type: string enum: [current, all] default: current description: >- Search the current project by default. Cross-project search requires the explicit value `all` and an unscoped owner credential. When an active `project` is also sent, local candidates are selected before the limit and other projects extend the tail. max_results: type: integer default: 10 fusion_mode: type: string cursor: type: string SearchResponse: type: object properties: hits: type: array items: $ref: "#/components/schemas/SearchHit" next_cursor: type: string nullable: true total_hits: type: integer fusion_mode_used: type: string ProjectLifecycleRequest: type: object required: [project] properties: project: type: string description: Stable project identity, never a checkout basename. confirm_hash: type: string description: >- SHA-256 manifest hash returned by a dry run. Omit for a read-only dry run; include it to confirm purge or garbage collection against the exact same physical rows. reason: type: string maxLength: 512 description: Required for confirmed purge and garbage collection. retention_days: type: integer minimum: 0 maximum: 3650 default: 30 description: Detached-generation retention for garbage collection only. ProjectLifecycleManifest: type: object properties: status: type: string operation: type: string enum: [purge, gc] project: type: string generation: type: integer format: int64 mode: type: string enum: [dry_run, confirmed] criteria: type: string manifest_hash: type: string description: SHA-256 of the operation, criteria, counts, and per-target fingerprints. total_rows: type: integer format: int64 counts: type: object additionalProperties: type: integer format: int64 target_fingerprints: type: object additionalProperties: type: string ProjectDetachResponse: type: object properties: status: type: string operation: type: string enum: [detach] project: type: string generation: type: integer format: int64 state: type: string enum: [detached] ArtifactResponse: type: object properties: id: type: string kind: type: string state: type: string scope_kind: type: string scope_id: type: string confidence: type: number format: double payload: type: object citations: type: array items: type: object properties: source_kind: type: string source_id: type: string updated_at: type: string format: date-time ArtifactLinksResponse: type: object properties: artifact_id: type: string links: type: array items: type: object properties: to_id: type: string link_kind: type: string CodeFindHit: type: object properties: project: type: string file_path: type: string line: type: integer kind: type: string CodeFindResponse: type: object properties: hits: type: array items: $ref: "#/components/schemas/CodeFindHit" next_cursor: type: string nullable: true CodeSearchHit: type: object properties: project: type: string file_path: type: string snippet: type: string rank: type: number format: double CodeSearchResponse: type: object properties: status: type: string hits: type: array items: $ref: "#/components/schemas/CodeSearchHit" next_cursor: type: string nullable: true CodeContextSpan: type: object required: [kind, line_start, line_end] properties: kind: type: string enum: [line, file] line_start: type: integer minimum: 0 line_end: type: integer minimum: 0 symbol: type: string CodeContextAnchor: type: object required: [project, file_path, generation, freshness] properties: project: { type: string } file_path: { type: string } generation: { type: integer, format: int64, minimum: 1 } freshness: { type: string, enum: [current] } CodeContextResult: type: object required: [project, file_path, generation, freshness, confidence, accepted, provenance, span] properties: project: { type: string } file_path: { type: string } generation: { type: integer, format: int64, minimum: 1 } freshness: { type: string, enum: [current] } confidence: { type: number, format: double, minimum: 0, maximum: 1 } accepted: { type: boolean, enum: [true] } provenance: type: array minItems: 1 items: { type: string, enum: [code, graph, vector, memory] } span: $ref: "#/components/schemas/CodeContextSpan" snippet: { type: string } content_hash: { type: string } vector_score: { type: number, format: double } CodeContextMemory: type: object required: [memory_id, kind, content, scope, provenance, confidence, anchor] properties: memory_id: { type: integer, format: int64 } kind: { type: string } headline: { type: string } content: { type: string } scope: { type: string, enum: [project] } scope_rank: { type: integer, minimum: 1 } provenance: { type: string, enum: [memory] } confidence: { type: number, format: double } anchor: $ref: "#/components/schemas/CodeContextAnchor" CodeContextAnswerability: type: object required: [decision, reason, candidate_count, accepted_code_count, top_confidence, vector_floor] properties: decision: { type: string, enum: [answerable, no_answer] } reason: { type: string } candidate_count: { type: integer, minimum: 0 } accepted_code_count: { type: integer, minimum: 0, maximum: 4 } top_confidence: { type: number, format: double, minimum: 0, maximum: 1 } vector_floor: { type: number, format: double, minimum: 0, maximum: 1 } CodeContextResponse: type: object required: [status, project, generation, freshness, resolved, max_results, max_tokens, item_count, answerability, results, why] properties: status: { type: string, enum: [ok, no_answer] } query: { type: string } symbol: { type: string } project: { type: string } generation: { type: integer, format: int64, minimum: 1 } freshness: { type: string, enum: [current] } resolved: { type: boolean, enum: [true] } max_results: { type: integer, enum: [4] } max_tokens: { type: integer, enum: [1200] } item_count: { type: integer, minimum: 0, maximum: 4 } answerability: $ref: "#/components/schemas/CodeContextAnswerability" results: type: array maxItems: 4 items: $ref: "#/components/schemas/CodeContextResult" why: type: array maxItems: 4 items: $ref: "#/components/schemas/CodeContextMemory" CodeCallerHit: type: object properties: project: type: string file_path: type: string caller: type: string line: type: integer CodeCallersResponse: type: object properties: status: type: string hits: type: array items: $ref: "#/components/schemas/CodeCallerHit" next_cursor: type: string nullable: true CodeDefinition: type: object properties: name: type: string kind: type: string line: type: integer CodeStructureResponse: type: object properties: status: type: string definitions: type: array items: $ref: "#/components/schemas/CodeDefinition" CodeProjectLanguage: type: object properties: lang: type: string count: type: integer CodeProjectStatsResponse: type: object properties: status: type: string project: type: string files: type: integer definitions: type: integer langs: type: array items: $ref: "#/components/schemas/CodeProjectLanguage" CodeProject: type: object properties: name: type: string root: type: string scanned_at: type: string CodeProjectsResponse: type: object properties: status: type: string projects: type: array items: $ref: "#/components/schemas/CodeProject" next_cursor: type: string nullable: true BlastRadiusDependentEdge: type: object required: [path, provenance, confidence, project, generation, freshness] properties: path: type: string description: Dependent file path. provenance: type: string description: Comma-separated structural evidence (`import`, `call`, `projection`, or `cross_repo`). confidence: type: string enum: [high, medium, low] project: type: string generation: type: integer format: int64 minimum: 1 freshness: type: string enum: [current] BlastRadiusDependencyEdge: type: object required: [identity, provenance, confidence, project, generation, freshness] properties: identity: type: string description: Normalized import identity. provenance: type: string description: Comma-separated structural evidence (`import`, `call`, `projection`, or `cross_repo`). confidence: type: string enum: [high, medium, low] project: type: string generation: type: integer format: int64 minimum: 1 freshness: type: string enum: [current] BlastRadiusResponse: type: object required: [file, project, generation, freshness, resolved, dependents, dependent_count, dependent_edges, dependencies, dependency_count, dependency_edges] properties: file: type: string project: type: string generation: type: integer format: int64 minimum: 1 freshness: type: string enum: [current] resolved: type: boolean dependents: type: array items: type: string dependent_count: type: integer dependent_edges: type: array items: $ref: "#/components/schemas/BlastRadiusDependentEdge" dependencies: type: array items: type: string dependency_count: type: integer dependency_edges: type: array items: $ref: "#/components/schemas/BlastRadiusDependencyEdge" CodeScanRequest: type: object required: [project] properties: project: type: string root_path: type: string phase: type: string enum: [begin, stage, seal, abort, verify] description: Omit for the legacy local or incremental scan shape. scan_id: type: string expected_files: type: integer minimum: 0 deep: type: boolean description: For verify, compare content hashes in addition to manifest paths. files: type: array items: type: object required: [rel_path, content] properties: rel_path: { type: string } content: { type: string } force: type: boolean default: false CodeScanResponse: type: object required: [status, skipped, project, files, inspected] properties: status: type: string example: ok skipped: type: boolean project: type: string files: type: integer inspected: type: integer retracted: type: integer index_state: type: string enum: [current] index_revision: type: integer workspace_state: type: string enum: [matched, modified, missing, unavailable] verification: type: string enum: [manifest, content_hash, none] CodeBuildRequest: type: object required: [path, project] properties: path: type: string project: type: string embedding_command: type: string force: type: boolean default: false CodeUpdateRequest: type: object required: [path, project] properties: path: type: string project: type: string embedding_command: type: string CodeBuildResponse: type: object properties: status: type: string example: ok project: type: string files_scanned: type: integer files_indexed: type: integer files_skipped: type: integer files_removed: type: integer chunks_added: type: integer chunks_removed: type: integer embeddings_added: type: integer CodeUpdateResponse: type: object properties: status: type: string example: ok project: type: string files_scanned: type: integer files_indexed: type: integer files_skipped: type: integer files_removed: type: integer chunks_added: type: integer chunks_removed: type: integer embeddings_added: type: integer MaintenanceRepairRequest: type: object required: [path, project] properties: path: type: string project: type: string embedding_command: type: string MaintenanceRepairResponse: type: object properties: status: type: string example: ok project: type: string files_scanned: type: integer files_indexed: type: integer files_skipped: type: integer files_removed: type: integer chunks_added: type: integer chunks_removed: type: integer embeddings_added: type: integer MaintenanceReconcileRequest: type: object properties: dry_run: type: boolean default: false MaintenanceReconcileResponse: type: object properties: status: type: string example: ok rc: type: integer dry_run: type: boolean memory: type: object properties: kept: type: integer format: int64 pruned: type: integer format: int64 kb: type: object properties: kept: type: integer format: int64 pruned: type: integer format: int64 MaintenanceClearRequest: type: object required: [project] properties: project: type: string MaintenanceClearResponse: type: object properties: status: type: string example: ok project: type: string chunks_deleted: type: integer MaintenancePurgeProjectRequest: type: object required: [project, generation, purge_id] properties: project: type: string generation: type: string description: Fence generation token (no spaces). purge_id: type: string description: Purge operation id (no spaces). takeover: type: boolean description: > Displace a LIVE fence held by another owner. Without it a live foreign fence is refused with 409. MaintenancePurgeProjectResponse: type: object properties: status: type: string example: ok ok: type: boolean description: True only when every store delete succeeded. project: type: string generation: type: string purge_id: type: string fence_replaced: type: boolean displaced: type: object description: Present when fence_replaced. Contains the displaced owner's IDs. properties: generation: type: string purge_id: type: string stores: type: object description: > Per-store outcome in fan-out order. Each value is a deleted-row count on success (0 for primitives that report no count) or {"error": "..."} on failure. additionalProperties: true MaintenancePurgeFenceRequest: type: object required: [project, generation, purge_id] properties: project: type: string generation: type: string purge_id: type: string MaintenancePurgeHeartbeatResponse: type: object properties: status: type: string example: ok refreshed: type: boolean fence: type: string description: > Present when refreshed is false. Contains the current fence as "generation purge_id" (empty when no fence exists). MaintenancePurgeClearResponse: type: object properties: status: type: string example: ok cleared: type: boolean fence: type: string description: > Present when cleared is false. Contains the current fence as "generation purge_id" (empty when no fence exists). PipelineStatusResponse: type: object properties: state: type: string enum: [idle, running, failed] queue_depth: type: integer active_jobs: type: array items: type: object queue: type: object properties: pending: type: integer running: type: integer done: type: integer failed: type: integer total: type: integer JobStatusResponse: type: object required: [id, kind, document_id, project, status, attempts] properties: id: type: integer format: int64 kind: type: string document_id: type: integer format: int64 project: type: string status: type: string enum: [pending, running, done, failed] attempts: type: integer last_error: type: string claimed_by: type: string claimed_at: type: string created_at: type: string updated_at: type: string IngestStatusResponse: type: object properties: status: type: string example: ok queue: type: object properties: pending: type: integer running: type: integer done_last_24h: type: integer failed_last_24h: type: integer workers: type: object properties: configured: type: integer active: type: integer recent: type: array items: type: object properties: project: type: string status: type: string completed_at: type: string files_indexed: type: integer chunks_added: type: integer error: type: string WorkersResponse: type: object properties: status: type: string example: ok configured: type: integer slots: type: array items: type: object threads: type: array items: type: object background: type: array items: type: object IngestRequest: type: object properties: workspace: type: string description: Workspace root, workspace name, or "all". embedding_command: type: string force: type: boolean default: false IngestResponse: type: object properties: status: type: string example: ok projects_queued: type: integer message: type: string DrainRequest: type: object properties: embedding_command: type: string timeout: type: integer default: 0 DrainResponse: type: object properties: state: type: string enum: [idle, running, failed] processed: type: integer pending: type: integer running: type: integer done: type: integer failed: type: integer total: type: integer EntityProfileResponse: type: object properties: entity: type: string kind: type: string summary: type: string facts: type: array items: type: string tags: type: array items: type: string updated_at: type: string EntitySearchRequest: type: object required: [query] properties: query: type: string limit: type: integer default: 10 cursor: type: string EntitySearchResponse: type: object properties: entities: type: array items: type: object properties: entity: type: string kind: type: string summary: type: string score: type: number format: double next_cursor: type: string nullable: true paths: /health: get: operationId: getHealth summary: Service health check description: Returns {"status":"ok"} when the service is running. security: [] responses: "200": description: Service is healthy content: application/json: schema: $ref: "#/components/schemas/HealthResponse" head: operationId: headHealth summary: Service health check (HEAD) security: [] responses: "200": description: Service is healthy /version: get: operationId: getVersion summary: Service version responses: "200": description: Version information content: application/json: schema: $ref: "#/components/schemas/VersionResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /capabilities: get: operationId: getCapabilities summary: Advertised capabilities description: | Returns the set of capability strings this aimee-kb instance supports. Phase 1 always returns ["memory", "search", "index"]. responses: "200": description: Capability list content: application/json: schema: $ref: "#/components/schemas/CapabilitiesResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /servers: get: operationId: listFleetServers summary: List registered servers for one team description: Returns the primary-backed, tenant-scoped server registry view. parameters: - name: team in: query required: true description: Positive signed-64-bit team id serialized as canonical decimal without a sign or leading zero. schema: type: integer format: int64 minimum: 1 responses: "200": description: Bounded server registry list content: application/json: schema: type: object required: [servers] properties: servers: type: array maxItems: 64 items: type: object required: [server_id, cert_cn, mgmt_cert_cn, endpoint, status, health, version] properties: server_id: { type: string } cert_cn: { type: string } mgmt_cert_cn: { type: string } endpoint: { type: string } status: { type: string } health: { type: string } version: { type: string } "400": { description: Invalid or missing team } "401": { description: Authentication required } "403": { description: Actor is not authorized for the requested team } "503": { description: Registry unavailable } /servers/{server_id}/health: get: operationId: getServerLiveHealth summary: Verify a registered server through the management health exchange description: >- Performs the live, nonce-bound management challenge and signed-status exchange. It does not return the registry's cached heartbeat row. parameters: - name: server_id in: path required: true schema: type: string minLength: 1 maxLength: 127 pattern: "^[A-Za-z0-9._-]+$" - name: team in: query required: true schema: type: integer format: int64 minimum: 1 responses: "200": description: Live management health verification succeeded content: application/json: schema: $ref: "#/components/schemas/ServerLiveHealthResponse" "400": description: Invalid team or management health request content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "401": description: Authentication required content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "403": description: Server health request denied content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: Server not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "409": description: Registry state changed during the exchange content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "502": description: Management health integrity verification failed content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "503": description: Management health runtime or dependency unavailable content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /servers/{server_id}/agents: get: operationId: getServerAgents summary: Read the bounded public agent projection from one registered server description: >- Performs the nonce-bound management-read exchange over the server's pinned mTLS session. The response contains only the seven frozen public agent fields and is authorized independently from remote_writes. parameters: - name: server_id in: path required: true schema: type: string minLength: 1 maxLength: 127 pattern: "^[A-Za-z0-9._-]+$" - name: team in: query required: true description: Positive signed-64-bit team id serialized as canonical decimal without a sign or leading zero. schema: type: integer format: int64 minimum: 1 responses: "200": description: Complete bounded agent projection content: application/json: schema: $ref: "#/components/schemas/ServerAgentsResponse" "400": { description: Invalid path or team query } "401": { description: Authentication required } "403": { description: Management read denied } "404": { description: Server not found } "409": { description: Read intent or target state conflict } "502": { description: Authenticated management response failed integrity validation } "503": { description: Management read runtime or dependency unavailable } /servers/{server_id}/config: get: operationId: getServerSafeConfig summary: Read the bounded safe configuration projection from one registered server parameters: - name: server_id in: path required: true schema: { type: string, minLength: 1, maxLength: 127, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]{0,126}$" } - name: team in: query required: true schema: { type: integer, format: int64, minimum: 1 } responses: "200": description: Complete five-field safe configuration projection content: application/json: schema: { $ref: "#/components/schemas/ServerSafeConfigResponse" } "400": { description: Invalid path or team query } "401": { description: Authentication required } "403": { description: Management read denied } "404": { description: Server not found } "409": { description: Read intent or target state conflict } "502": { description: Authenticated management response failed integrity validation } "503": { description: Management read runtime or dependency unavailable } /servers/{server_id}/actions: post: operationId: executeServerManagementAction summary: Enable or disable one agent on one registered server description: >- Executes one identity-propagating, journaled management action. The server's remote_writes policy remains authoritative and the request is never safely retryable after an ambiguous dispatch. parameters: - name: server_id in: path required: true schema: type: string minLength: 1 maxLength: 127 pattern: "^[A-Za-z0-9._-]+$" - name: team in: query required: true description: Positive signed-64-bit team id serialized as canonical decimal without a sign or leading zero. schema: type: integer format: int64 minimum: 1 requestBody: required: true content: application/json: schema: type: object additionalProperties: false required: [action, agent] properties: action: { type: string, enum: [agent.enable, agent.disable] } agent: { type: string, minLength: 1, maxLength: 63, pattern: "^[A-Za-z0-9._-]+$" } responses: "200": { description: Action succeeded } "400": { description: Invalid team or action envelope } "401": { description: Authentication required } "403": { description: "Actor, team, capability, or server policy denied the action" } "404": { description: Server not found } "409": { description: "Replay, registry conflict, or unresolved prior intent" } "502": { description: Action result is indeterminate } "503": { description: Management runtime or dependency unavailable } /console/overview: get: operationId: getConsoleOverview summary: Web-console dashboard overview description: | Aggregated kb health/throughput for the aimee-kb web console dashboard. Requires a console-admin credential (see the kb-web-console proposal). S0 returns the envelope with an empty components list; S1 fills it with an in-process telemetry fan-in. responses: "200": description: Overview envelope content: application/json: schema: type: object "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "403": description: Forbidden (credential not permitted for this route) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /console/pipeline: get: operationId: getConsolePipeline summary: Curator pipeline registry, presets, and current config (console) description: | The curator pipeline as data for the web console's Pipeline page: the live stage registry (name, label, lane, budget, order, config_key, requires), the built-in presets, and the current value of every config key the page toggles. The kb owns the curator, so this is served in-process. Requires a console-admin credential. responses: "200": description: Pipeline envelope content: application/json: schema: type: object properties: stages: type: array items: { type: object } presets: type: array items: { type: object } config: type: object description: Current value per pipeline config key. "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "403": description: Forbidden (credential not permitted for this route) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /console/pipeline/config: post: operationId: setConsolePipelineConfig summary: Set one curator-pipeline config key (console) description: | Sets a single pipeline config key and persists it to aimee.yaml; the curator picks it up on its next config load. The key must be a stage enable flag advertised by the live registry, or one of the pipeline's own keys (stage order, user presets, custom stages). Anything else is 403, so this route cannot reach arbitrary config. Requires a console-admin credential. requestBody: required: true content: application/json: schema: type: object required: [key, value] properties: key: { type: string } value: description: Boolean for a stage toggle, string for the order/presets/custom-stage keys. oneOf: - type: boolean - type: string - type: integer responses: "200": description: Saved; echoes the stored value content: application/json: schema: type: object properties: ok: { type: boolean } key: { type: string } value: {} "400": description: Missing/invalid key or value content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "403": description: Not a pipeline config key, or credential not permitted content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /console/typed_facts: get: operationId: getConsoleTypedFacts summary: List ontology, assertion, and canonical-entity review state description: | Returns quarantined assertion candidates with their lifecycle, authority, evidence count, and originating graph commit. Candidates are excluded from default recall. Also returns canonical entities and reversible merge history for operator review. Requires a console-admin credential. responses: "200": description: Typed-fact configuration and review queues content: application/json: schema: type: object additionalProperties: true "401": { description: Unauthorized } "403": { description: Console operator required } /console/evidence: post: operationId: operateConsoleEvidenceLifecycle summary: Inspect and govern the evidence and lifecycle layer description: | Authenticated operator surface for P1-P9. The `action` selects a fixed, parameter-bound operation; actor and authority always come from the verified credential. Supported actions are `changeset.show`, `changeset.diff`, `changeset.preview_revert`, `changeset.revert`, `document.preview_lifecycle`, `document.apply_lifecycle`, `derived.status`, `outcome.record`, `review.list`, `review.decide`, `ontology.export`, `ontology.import`, `ontology.dry_run`, `ontology.migrate`, `ontology.report`, `ontology.rollback`, `recall.trace_record`, and `recall.trace_get`. Destructive document and ontology operations require a fresh preview token bound to the current changeset head. requestBody: required: true content: application/json: schema: type: object required: [action] properties: action: type: string enum: - changeset.show - changeset.diff - changeset.preview_revert - changeset.revert - document.preview_lifecycle - document.apply_lifecycle - derived.status - outcome.record - review.list - review.decide - ontology.export - ontology.import - ontology.dry_run - ontology.migrate - ontology.report - ontology.rollback - recall.trace_record - recall.trace_get changeset_id: { type: string } force_partial: { type: boolean } doc_id: { type: integer, minimum: 1 } operation: { type: string, enum: [invalidate, purge] } preview_token: { type: string } reason: { type: string } derived_kind: { type: string } derived_memory_id: { type: string } input_kind: { type: string } input_id: { type: string } limit: { type: integer, minimum: 1, maximum: 1000 } item_id: { type: string } item_head: { type: string } decision: type: string enum: [accept, correct, retire, restore, promote, invalidate_source, purge, request_evidence, annotate, revoke, resolve] requested_value: { type: string } package: { type: object, additionalProperties: true } package_id: { type: string } review_record: { type: string } signature: { type: string } acknowledge_widening: { type: boolean } outcome_id: { type: string } retrieval_event_id: { type: string } subject_kind: { type: string } subject_id: { type: string } outcome: type: string enum: [useful, dead_end, corrected, misleading, outdated] task_label: { type: string } workflow: { type: string } resulting_action: { type: string } correction_ref: { type: string } source_hash: { type: string } code_generation: { type: integer, minimum: 0 } fault_kind: { type: string } fault_value: { type: string } turn_id: { type: string } query_fingerprint: { type: string } sensitivity: { type: string } results: { type: array, items: { type: object, additionalProperties: true } } persist: { type: boolean } trace_id: { type: string } responses: "200": description: Operation result; shape is selected by action content: application/json: schema: { type: object, additionalProperties: true } "400": { description: Invalid action or request } "403": { description: Authenticated operator required } "409": { description: "Conflict, stale preview, authority refusal, or atomic failure" } /console/typed_facts/assertion: post: operationId: reviewConsoleFactAssertion summary: Approve, reject, or undo an assertion review description: | Applies an operator-authorized lifecycle transition. Authority is derived from the verified request identity; no authority field is accepted. requestBody: required: true content: application/json: schema: type: object required: [action, assertion_id] properties: action: type: string enum: [approve, reject, undo] assertion_id: type: integer minimum: 1 responses: "200": description: Review transition applied content: application/json: schema: type: object properties: ok: { type: boolean } assertion_id: { type: integer } lifecycle: { type: string } commit_id: { type: string, format: uuid } "400": { description: Invalid review request } "403": { description: Authenticated operator required } "409": { description: Review transition conflict } /console/typed_facts/entity: post: operationId: manageConsoleCanonicalEntity summary: Merge or unmerge canonical entities description: | Atomically changes canonical name resolution and records a reversible graph commit, structured diff, and WORM audit event. Actor identity and operator authority come only from the verified console credential. requestBody: required: true content: application/json: schema: type: object required: [action] properties: action: type: string enum: [merge, unmerge] from_id: { type: integer, minimum: 1 } into_id: { type: integer, minimum: 1 } merge_id: { type: integer, minimum: 1 } responses: "200": description: Entity transition applied content: application/json: schema: type: object properties: ok: { type: boolean } merge_id: { type: integer } commit_id: { type: string, format: uuid } "400": { description: Invalid merge request } "403": { description: Authenticated operator required } "409": { description: Entity state conflicts with requested transition } /console/typed_facts/commit: post: operationId: manageConsoleFactCommit summary: Preview or roll back a graph commit description: | Previews the structured batch diff, or rolls back a reversible assertion, ontology, or entity-merge commit. A commit with later dependent changes must have those descendants rolled back first. Supplying ingest_run_id previews or atomically rolls back every commit in that ingestion batch. requestBody: required: true content: application/json: schema: type: object required: [action] oneOf: - required: [commit_id] - required: [ingest_run_id] properties: action: type: string enum: [preview, rollback] commit_id: type: string format: uuid ingest_run_id: type: string minLength: 1 responses: "200": description: Commit diff or rollback result content: application/json: schema: type: object additionalProperties: true "400": { description: Invalid commit request } "403": { description: Authenticated operator required } "404": { description: Commit not found } "409": { description: Commit is not currently reversible } /console/typed_facts/erasure: post: operationId: manageConsoleFactErasure summary: Preview or execute permanent fact erasure description: | Reports the assertion/evidence cascade before removal. `erase` permanently removes matching assertion and evidence rows while returning an explicit residual-data report. Ordinary correction should use reversible invalidation. requestBody: required: true content: application/json: schema: type: object required: [action, subject] properties: action: type: string enum: [preview, erase] subject: { type: string, minLength: 1 } relation: { type: string } object: { type: string } responses: "200": description: Impact preview or completed erasure report content: application/json: schema: type: object properties: ok: { type: boolean } action: { type: string } assertions: { type: integer } evidence_mentions: { type: integer } residual_data: { type: string } commit_id: { type: string, format: uuid } "400": { description: Invalid erasure request } "403": { description: Authenticated operator required } "409": { description: Erasure could not be completed atomically } /console/settings: get: operationId: getConsoleSettings summary: KB-owned configuration (console) description: | Every config option aimee-kb owns, including the embedder, synthesis tier, and knowledge base itself, with its current value, section, and whether it needs a kb restart. The split from aimee-server's own settings is by which binary reads the option (KB_SETTINGS in src/kb/http/kb_http_console.c). Requires a console-admin credential. responses: "200": description: KB-owned settings content: application/json: schema: type: object properties: fields: type: array items: type: object properties: key: { type: string } section: { type: string } restart: { type: boolean } value: {} "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "403": description: Forbidden (credential not permitted for this route) content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /console/settings/config: post: operationId: setConsoleSetting summary: Set one KB-owned config option (console) description: | Sets a single KB-owned option and persists it to aimee.yaml. The key must be one the KB owns. Anything else (aimee-server's keys, provider settings, the agent roster) is 403, so this route cannot reach arbitrary config. Options flagged `restart` take effect when aimee-kb next starts. Requires a console-admin credential. requestBody: required: true content: application/json: schema: type: object required: [key, value] properties: key: { type: string } value: oneOf: - type: boolean - type: string - type: integer responses: "200": description: Saved; echoes the stored value content: application/json: schema: type: object properties: ok: { type: boolean } key: { type: string } value: {} restart: { type: boolean } "400": description: Missing/invalid key or value content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "401": description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "403": description: Not a KB-owned setting, or credential not permitted content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /team: post: operationId: createTeam summary: Create a team (org-admin or bootstrap owner) description: > Creates an org team. The org-admin capability is enforced at the DB layer (RLS write policies); a non-admin caller receives 403. requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } responses: "201": description: Team created content: application/json: schema: type: object properties: id: { type: integer } name: { type: string } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } get: operationId: listTeams summary: List the caller's visible teams responses: "200": description: Teams content: application/json: schema: type: object properties: teams: type: array items: { type: object } "401": { description: Authentication required } /team/member: post: operationId: addTeamMember summary: Add a member to a team (org-admin) requestBody: required: true content: application/json: schema: type: object required: [team, identity_key] properties: team: { type: integer } identity_key: { type: string } default: { type: boolean } responses: "200": { description: Member added } "401": { description: Authentication required } "403": { description: Not authorized } delete: operationId: removeTeamMember summary: Remove a member from a team (org-admin) requestBody: required: true content: application/json: schema: type: object required: [team, identity_key] properties: team: { type: integer } identity_key: { type: string } responses: "200": { description: Member removed } "401": { description: Authentication required } "403": { description: Not authorized } /project: post: operationId: createProject summary: Create a project under a team (org-admin) requestBody: required: true content: application/json: schema: type: object required: [parent, name] properties: parent: { type: integer } name: { type: string } access_mode: { type: string, enum: [team-open, restricted] } responses: "201": description: Project created content: application/json: schema: type: object properties: id: { type: integer } parent: { type: integer } name: { type: string } access_mode: { type: string } "401": { description: Authentication required } "403": { description: Not authorized } get: operationId: listProjects summary: List projects (optionally filtered by ?team=) parameters: - name: team in: query required: false schema: { type: integer } responses: "200": description: Projects content: application/json: schema: type: object properties: projects: type: array items: { type: object } "401": { description: Authentication required } /models/entitled: get: operationId: listEntitledModels summary: List the caller's entitled org models (P2a) description: > Returns the org models the authenticated caller is entitled to use. This is the join of the org model catalog with the caller's team entitlements, actor-bound to the verified principal (a caller can never see another principal's entitled models). Catalog-only: the surface carries provider/wire/endpoint/model_id/display_name and NO credential or slot reference. Disabled catalog entries are excluded. responses: "200": description: Entitled models content: application/json: schema: type: object properties: models: type: array items: type: object properties: model_id: { type: string } display_name: { type: string } provider: { type: string } wire: { type: string, enum: [anthropic, openai, responses, gemini] } endpoint: { type: string } "401": { description: Authentication required } /models/org/add: post: operationId: addOrgModel summary: Create or update an org model catalog entry (org-admin, P2a) description: > Upserts a catalog entry (keyed by model_id). Org-admin gated at the DB layer and WORM-audited atomically with the mutation; a non-admin caller receives 403. requestBody: required: true content: application/json: schema: type: object required: [model_id, provider, wire] properties: model_id: { type: string } provider: { type: string } wire: { type: string, enum: [anthropic, openai, responses, gemini] } display_name: { type: string } endpoint: { type: string } enabled: { type: boolean } responses: "200": description: Catalog entry upserted content: application/json: schema: type: object properties: id: { type: integer } model_id: { type: string } "400": { description: "Invalid model_id, provider, or wire" } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } /models/org/set: post: operationId: setOrgModel summary: Upsert an org model catalog entry; alias of /models/org/add (org-admin, P2a) requestBody: required: true content: application/json: schema: type: object required: [model_id, provider, wire] properties: model_id: { type: string } provider: { type: string } wire: { type: string, enum: [anthropic, openai, responses, gemini] } display_name: { type: string } endpoint: { type: string } enabled: { type: boolean } responses: "200": { description: Catalog entry upserted } "400": { description: "Invalid model_id, provider, or wire" } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } /models/org/remove: post: operationId: removeOrgModel summary: Remove an org model catalog entry and its entitlements (org-admin, P2a) requestBody: required: true content: application/json: schema: type: object required: [model_id] properties: model_id: { type: string } responses: "200": description: Catalog entry removed content: application/json: schema: type: object properties: ok: { type: boolean } removed: { type: integer } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } /models/org/entitle: post: operationId: entitleOrgModel summary: Grant a team access to an org model (org-admin, P2a) requestBody: required: true content: application/json: schema: type: object required: [model_id, team] properties: model_id: { type: string } team: { type: integer } responses: "200": { description: Entitlement granted } "401": { description: Authentication required } "403": { description: "Not authorized (not an org-admin), or unknown model/team" } /models/org/unentitle: post: operationId: unentitleOrgModel summary: Revoke a team's access to an org model (org-admin, P2a) requestBody: required: true content: application/json: schema: type: object required: [model_id, team] properties: model_id: { type: string } team: { type: integer } responses: "200": { description: Entitlement revoked } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } /insights/spend: get: operationId: getOrgSpend summary: Authorized org spend report, grouped per model + per project (P3b) description: > Returns org spend aggregated over the settled rollup for day in [since, until], broken down per billable model and per project with a reconciling total (the sum of the per-model costs equals total.cost_usd exactly). Authorization is enforced at the DB layer inside a SECURITY DEFINER aggregation function: the caller must be an org-admin OR a lead of the requested team; a team-absent request is the org-wide report and is admin-only. cost_usd is emitted as a NUMERIC string (never a float) so finance export loses no precision. Read-only. parameters: - name: team in: query required: false description: Team id. Absent = the org-wide (admin-only) report. schema: { type: integer } - name: project in: query required: false description: Optional project filter. schema: { type: integer } - name: since in: query required: true description: Inclusive start day, ISO YYYY-MM-DD. schema: { type: string } - name: until in: query required: true description: Inclusive end day, ISO YYYY-MM-DD. schema: { type: string } responses: "200": description: Spend report content: application/json: schema: type: object properties: team: { type: integer, nullable: true } project: { type: integer } since: { type: string } until: { type: string } total: type: object properties: prompt_tokens: { type: integer } completion_tokens: { type: integer } cache_read_tokens: { type: integer } cache_write_tokens: { type: integer } cost_usd: { type: string } calls: { type: integer } by_team: type: array items: type: object properties: team_id: { type: integer } prompt_tokens: { type: integer } completion_tokens: { type: integer } cache_read_tokens: { type: integer } cache_write_tokens: { type: integer } cost_usd: { type: string } calls: { type: integer } by_model: type: array items: type: object properties: billable_model: { type: string } prompt_tokens: { type: integer } completion_tokens: { type: integer } cache_read_tokens: { type: integer } cache_write_tokens: { type: integer } cost_usd: { type: string } calls: { type: integer } by_project: type: array items: type: object properties: project_id: { type: integer, nullable: true } prompt_tokens: { type: integer } completion_tokens: { type: integer } cache_read_tokens: { type: integer } cache_write_tokens: { type: integer } cost_usd: { type: string } calls: { type: integer } "400": { description: Missing or malformed team/project/since/until } "401": { description: Authentication required } "403": { description: Not authorized (org-admin or team-lead required) } /budget/set: post: operationId: setBudget summary: Set a team/project period budget cap (org-admin, P4a) description: > Upserts the hard-cap config for (team, optional project, period). Org-admin gated at the DB layer and WORM-audited atomically with the mutation; a non-admin caller receives 403. A hard reduction of the limit below the current period's already committed (spend + reserved) is rejected as retroactive (409). limit_usd and soft_limit_usd are NUMERIC decimal strings (never floats). soft_limit_usd is a config-only operator-signal threshold. P4a does not enforce it; a soft limit never refuses). BUDGET ONLY: the rate limiter is deferred to P4b; the reserve-before-dispatch enforcement rides with P2b. requestBody: required: true content: application/json: schema: type: object required: [team, period, limit_usd] properties: team: { type: integer } project: { type: integer } period: { type: string, enum: [day, month] } limit_usd: { type: string } soft_limit_usd: { type: string } responses: "200": description: Budget cap upserted content: application/json: schema: type: object properties: id: { type: integer } team: { type: integer } project: { type: integer } period: { type: string } "400": { description: Missing or malformed team/period/limit_usd/project/soft_limit_usd } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } "409": { description: Retroactive reduction below current committed spend+reserved } /budget/show: get: operationId: showBudget summary: Show a team's budget caps + current-period counters (org-admin or team-lead, P4a) description: > Returns every configured cap for the team (optionally filtered to one project), each joined to its current UTC period counter: limit, spend, reserved, and remaining (= limit - spend - reserved). Authorization is enforced at the DB layer inside a SECURITY DEFINER function. The caller must be an org-admin OR a lead of the requested team. All money fields are NUMERIC strings (never floats). parameters: - name: team in: query required: true description: Team id (required). schema: { type: integer } - name: project in: query required: false description: Optional project filter; absent shows every cap for the team. schema: { type: integer } responses: "200": description: Budget caps + current-period counters content: application/json: schema: type: object properties: team: { type: integer } project: { type: integer } count: { type: integer } budgets: type: array items: type: object properties: team_id: { type: integer } project_id: { type: integer, nullable: true } period: { type: string } period_id: { type: string } limit_usd: { type: string } soft_limit_usd: { type: string, nullable: true } spend_usd: { type: string } reserved_usd: { type: string } remaining_usd: { type: string } "400": { description: Missing or malformed team/project } "401": { description: Authentication required } "403": { description: Not authorized (org-admin or team-lead required) } /rate/policy: post: operationId: setRatePolicy summary: Set a keyed fixed-window rate-limit policy (org-admin, P4b) description: > Upserts the admin-set rate policy for (dim, scope). dim is the limiter dimension (team | project | cert | model | cred_slot); scope is the concrete id/name, or "*" for the dim default applied when no specific row exists. window_seconds is the fixed-window width and max_count the requests admitted per window (max_count = 0 is an always-deny). Org-admin gated at the DB layer and WORM-audited atomically with the mutation; a non-admin caller receives 403. The policy is authoritative and never caller-supplied at enforcement time. The P2b egress path passes only the resolved identity to org_rate_check, which looks the policy up. RATE ONLY: the enforcement wiring at egress rides with P2b; the budget core is P4a. requestBody: required: true content: application/json: schema: type: object required: [dim, scope, window_seconds, max_count] properties: dim: { type: string, enum: [team, project, cert, model, cred_slot] } scope: { type: string } window_seconds: { type: integer } max_count: { type: integer } responses: "200": description: Rate policy upserted content: application/json: schema: type: object properties: id: { type: integer } dim: { type: string } scope: { type: string } window_seconds: { type: integer } max_count: { type: integer } "400": { description: Missing or malformed dim/scope/window_seconds/max_count } "401": { description: Authentication required } "403": { description: Not authorized (not an org-admin) } /rate/show: get: operationId: showRatePolicy summary: Show a keyed rate-limit policy (org-admin or team-lead, P4b) description: > Returns the rate policy for the exact (dim, scope) pair (0 or 1 row). Authorization is enforced at the DB layer inside a SECURITY DEFINER function. The caller must be an org-admin, OR (for dim=team) a lead of that team, OR (for dim=project) a lead of the team that owns the project. The global dims (model, cred_slot) and the "*" default are admin-only. Read-only. parameters: - name: dim in: query required: true description: Limiter dimension (team | project | cert | model | cred_slot). schema: { type: string, enum: [team, project, cert, model, cred_slot] } - name: scope in: query required: true description: The concrete id/name, or "*" for the dim default. schema: { type: string } responses: "200": description: Rate policy (0 or 1 row) content: application/json: schema: type: object properties: dim: { type: string } scope: { type: string } count: { type: integer } policies: type: array items: type: object properties: id: { type: integer } dim: { type: string } scope: { type: string } window_seconds: { type: integer } max_count: { type: integer } "400": { description: Missing or malformed dim/scope } "401": { description: Authentication required } "403": { description: Not authorized (org-admin or team-lead required) } /enrollments: get: operationId: listEnrollments summary: List issued client-certificate enrollments (console) description: | Paginated list of redeemed client certificates for the accounts surface. Requires a console-admin credential. responses: "200": description: Enrollment list content: application/json: schema: type: object "401": description: Unauthorized "503": description: Store unavailable /enrollments/{id}/revoke: post: operationId: revokeEnrollment summary: Revoke a client-certificate enrollment (console) description: | Marks the enrollment revoked; the revocation is enforced at the mTLS seam. Requires a console-admin credential. parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Revoked enrollment content: application/json: schema: type: object "400": description: Bad enrollment id "404": description: Enrollment not found "503": description: Revoke failed (store unavailable) /config/oidc: get: operationId: getConsoleOidcConfig summary: Console OIDC login config (console-admin) responses: "200": description: OIDC config (empty if unset) content: application/json: schema: type: object "401": description: Unauthorized put: operationId: putConsoleOidcConfig summary: Set the console OIDC login config (console-admin) description: | Structural validation (https jwks_url + required fields). The console fetches this at startup; restart the console to re-apply. responses: "200": description: Stored config content: application/json: schema: type: object "400": description: Bad request "503": description: Config store unavailable /scopes: get: operationId: listScopes summary: List distinct scopes and certificate counts in the scope lattice (console) responses: "200": description: Scope list content: application/json: schema: type: object "401": description: Unauthorized /decisions: get: operationId: listDecisions summary: List governance decision records (console) description: Filter by subject/status; most-recent-first. Console-admin only. responses: "200": description: Decision list content: application/json: schema: type: object "401": description: Unauthorized post: operationId: createDecision summary: Author a decision record (console) description: | Creates a decision; one active decision per (subject, linked_policy_id). A conflicting create returns 409 (supersede the active one instead). responses: "201": description: Created decision content: application/json: schema: type: object "400": description: Bad request "409": description: Conflict because an active decision already exists for this scope /decisions/{id}: get: operationId: getDecision summary: Decision record + supersede chain (console) parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Decision with supersede_chain content: application/json: schema: type: object "404": description: Not found /audit/actions: get: operationId: listAuditActions summary: Policy-verdict action audit feed (console) description: Requires a `since` time-window bound; optional `until`, `scope_kind`, `limit`. parameters: - name: since in: query required: true schema: type: string responses: "200": description: Audit action list content: application/json: schema: type: object "400": description: Missing required time-window "401": description: Unauthorized /intelligence/calibration/readiness: get: operationId: getIntelligenceCalibrationReadiness summary: Calibration readiness responses: "200": description: Calibration readiness summary content: application/json: schema: type: object "401": description: Unauthorized /intelligence/demotion/check: get: operationId: getIntelligenceDemotionCheck summary: Dry-run demotion readiness check responses: "200": description: Demotion readiness summary content: application/json: schema: type: object "401": description: Unauthorized /intelligence/bandit/export: get: operationId: getIntelligenceBanditExport summary: Export fusion bandit decision data responses: "200": description: Bandit decisions and arm stats content: application/json: schema: type: object "401": description: Unauthorized /intelligence/bandit/sample: post: operationId: postIntelligenceBanditSample summary: Sample an arm for a decision point (server-side decision points) responses: "200": description: Selected arm + decision id (or status disabled) content: application/json: schema: type: object "401": description: Unauthorized /intelligence/bandit/close: post: operationId: postIntelligenceBanditClose summary: Close a sampled decision with its observed reward responses: "200": description: Close result content: application/json: schema: type: object "401": description: Unauthorized /intelligence/bandit/promote: post: operationId: postIntelligenceBanditPromote summary: Persist the production-default arm for a decision point responses: "200": description: Promotion result (rollback_arm) content: application/json: schema: type: object "401": description: Unauthorized /actions/{action}: post: operationId: postAction summary: Execute a versioned knowledge-service action parameters: - name: action in: path required: true schema: type: string requestBody: required: false content: application/json: schema: type: object responses: "200": description: Action response content: application/json: schema: type: object "401": description: Unauthorized "404": description: Unknown action # ── Phase 3: Ingest API ──────────────────────────────────────────────────── /docs: post: operationId: postDocs summary: Upload a document for ingest description: | Accepts multipart/form-data with a required `file` part and an optional `scope` field (default: global). Normalizes to markdown, stores in KB_STORE, and queues an extract_doc job. Returns existing doc_id on idempotent re-upload. requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: type: string format: binary scope: type: string default: global responses: "201": description: Document ingested content: application/json: schema: $ref: "#/components/schemas/DocIngestResponse" "200": description: Idempotent re-upload (existing doc_id returned) content: application/json: schema: $ref: "#/components/schemas/DocIngestResponse" "400": description: Missing file part "401": description: Unauthorized "422": description: Normalization failed (converter error) "503": description: DB unavailable /docs/manifest: post: operationId: postDocsManifest summary: Check which uploaded document hashes are absent requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DocsManifestRequest" responses: "200": description: Manifest diff content: application/json: schema: $ref: "#/components/schemas/DocsManifestResponse" "400": description: Invalid manifest request "401": description: Unauthorized "405": description: Method not allowed "500": description: Serialization failed "503": description: DB unavailable /docs/{id}: get: operationId: getDoc summary: Retrieve doc metadata by id parameters: - name: id in: path required: true schema: type: integer format: int64 responses: "200": description: Document metadata content: application/json: schema: $ref: "#/components/schemas/DocMetadataResponse" "401": description: Unauthorized "404": description: Document not found delete: operationId: deleteDoc deprecated: true summary: Refuse lifecycle-bypassing document deletion description: >- Direct deletion is disabled. Use `POST /console/evidence` with `document.preview_lifecycle`, inspect the blast radius, then submit `document.apply_lifecycle` with the actor-bound preview token. parameters: - name: id in: path required: true schema: type: integer format: int64 responses: "409": description: Lifecycle preview and explicit invalidate or purge required content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "401": description: Unauthorized "404": description: Document not found /review: get: operationId: getReview summary: List staged documents pending review parameters: - name: cursor in: query schema: type: integer format: int64 - name: limit in: query schema: type: integer default: 10 responses: "200": description: Review queue content: application/json: schema: $ref: "#/components/schemas/ReviewQueueResponse" "401": description: Unauthorized /review/{id}/accept: post: operationId: postReviewAccept summary: Accept a staged document parameters: - name: id in: path required: true schema: type: integer format: int64 requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/ReviewAcceptRequest" responses: "200": description: Document accepted "400": description: Invalid id "401": description: Unauthorized "404": description: Document not found /review/{id}/reject: post: operationId: postReviewReject summary: Reject a staged document parameters: - name: id in: path required: true schema: type: integer format: int64 requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReviewRejectRequest" responses: "200": description: Document rejected "400": description: Invalid id "401": description: Unauthorized "404": description: Document not found # ── Phase 4: Corpus staging and release lifecycle ────────────────────────── /releases: post: operationId: postReleases summary: Create a new corpus release requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateReleaseRequest" responses: "201": description: Release created content: application/json: schema: $ref: "#/components/schemas/CreateReleaseResponse" "400": description: Missing name "401": description: Unauthorized "409": description: Name already exists /releases/active: get: operationId: getActiveRelease summary: Get the currently active corpus release responses: "200": description: Active release (or null if none) content: application/json: schema: $ref: "#/components/schemas/ActiveReleaseResponse" "401": description: Unauthorized /releases/{id}/promote: post: operationId: postPromote summary: Promote a release to active parameters: - name: id in: path required: true schema: type: integer format: int64 responses: "200": description: Release promoted "400": description: Invalid id "401": description: Unauthorized "409": description: Promote failed /releases/{id}/rollback: post: operationId: postRollback summary: Roll back to a prior release parameters: - name: id in: path required: true schema: type: integer format: int64 requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/RollbackRequest" responses: "200": description: Rolled back "400": description: Invalid id "401": description: Unauthorized "409": description: No prior release to roll back to # ── Phase 5: Retrieval endpoints ─────────────────────────────────────────── /search: post: operationId: postSearch summary: Hybrid knowledge search description: >- Searches the authenticated active project by default. A request without an active project fails with `scope_required`; deliberate cross-project retrieval requires `scope: all`. Send the active `project` together with `scope: all` to reserve the result head for local evidence while allowing labeled cross-project results in the tail. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SearchRequest" responses: "200": description: Search results content: application/json: schema: $ref: "#/components/schemas/SearchResponse" "400": description: Bad request (missing query or invalid scope) "401": description: Unauthorized "403": description: Scoped credentials cannot request all projects "409": description: No active project is available (`scope_required`) /artifacts/{id}: get: operationId: getArtifact summary: Retrieve an artifact by UUID parameters: - name: id in: path required: true schema: type: string responses: "200": description: Artifact payload and citations content: application/json: schema: $ref: "#/components/schemas/ArtifactResponse" "401": description: Unauthorized "404": description: Artifact not found /artifacts/{id}/links: get: operationId: getArtifactLinks summary: Retrieve outgoing links from an artifact parameters: - name: id in: path required: true schema: type: string responses: "200": description: Artifact links content: application/json: schema: $ref: "#/components/schemas/ArtifactLinksResponse" "401": description: Unauthorized "404": description: Artifact not found /code/find: get: operationId: getCodeFind summary: Symbol/identifier lookup across the canonical index parameters: - name: identifier in: query required: true schema: type: string - name: project in: query description: Stable project identity. Defaults to the authenticated active project. schema: type: string - name: scope in: query description: >- Cross-project lookup requires `all`; send `project` too to protect that active project's candidates before the result limit. schema: type: string enum: [current, all] default: current - name: generation in: query description: Optional observed current generation; stale observations fail closed. schema: type: integer format: int64 minimum: 1 - name: max_results in: query schema: type: integer default: 20 responses: "200": description: Code find results content: application/json: schema: $ref: "#/components/schemas/CodeFindResponse" "400": description: Missing identifier parameter "401": description: Unauthorized "403": description: Scoped credentials cannot request all projects "404": description: Project is unknown or detached "409": description: Active project is required or the observed generation is stale "503": description: Canonical index unavailable /code/search: get: operationId: getCodeSearch summary: Full-text code search across indexed file contents parameters: - name: query in: query required: true schema: type: string - name: project in: query description: Stable project identity. Defaults to the authenticated active project. schema: type: string - name: scope in: query description: >- Cross-project search requires `all`; send `project` too to protect that active project's candidates before the result limit. schema: type: string enum: [current, all] default: current - name: generation in: query description: Optional observed current generation; stale observations fail closed. schema: type: integer format: int64 minimum: 1 - name: max_results in: query schema: type: integer default: 20 responses: "200": description: Code search results content: application/json: schema: $ref: "#/components/schemas/CodeSearchResponse" "400": description: Missing query parameter "401": description: Unauthorized "403": description: Scoped credentials cannot request all projects "404": description: Project is unknown or detached "409": description: Active project is required or the observed generation is stale "503": description: Canonical index unavailable /code/context: get: operationId: getCodeContext summary: Bounded task-conditioned context for the active project description: >- Reuses hybrid RRF retrieval but returns only current-generation evidence for one active project. Exact lexical and structural evidence leads; vector-only evidence must clear the quality floor. Memory is additive, locally ordered, and anchored to accepted code. A weak query returns HTTP 200 with status `no_answer`, empty results, and empty why rather than broadening to global memory. parameters: - name: query in: query required: true schema: { type: string } - name: symbol in: query schema: { type: string } - name: project in: query required: true description: Stable identity of the authenticated active project; cross-project scope is forbidden. schema: { type: string } - name: generation in: query description: Optional observed current generation; stale observations fail closed. schema: { type: integer, format: int64, minimum: 1 } - name: max_results in: query description: Accepted for client compatibility and clamped to the fixed packet maximum of four. schema: { type: integer, default: 4, maximum: 4 } responses: "200": description: Answerable bounded packet or explicit no_answer content: application/json: schema: $ref: "#/components/schemas/CodeContextResponse" "400": description: Missing or invalid query "401": description: Unauthorized "404": description: Project is unknown, detached, or has no current generation "409": description: Active project is required or the observed generation is stale "503": description: Canonical index unavailable /code/callers: get: operationId: getCodeCallers summary: Call sites for a symbol in the canonical code index parameters: - name: symbol in: query required: true schema: type: string - name: project in: query description: Stable project identity. Defaults to the authenticated active project. schema: type: string - name: scope in: query description: >- Cross-project lookup requires `all`; send `project` too to protect that active project's candidates before the result limit. schema: type: string enum: [current, all] default: current - name: generation in: query description: Optional observed current generation; stale observations fail closed. schema: type: integer format: int64 minimum: 1 - name: max_results in: query schema: type: integer default: 20 responses: "200": description: Caller results content: application/json: schema: $ref: "#/components/schemas/CodeCallersResponse" "400": description: Missing symbol parameter "401": description: Unauthorized "403": description: Scoped credentials cannot request all projects "404": description: Project is unknown or detached "409": description: Active project is required or the observed generation is stale "503": description: Canonical index unavailable /code/projects: get: operationId: getCodeProjects summary: List projects in the canonical code index parameters: - name: max_results in: query schema: type: integer default: 100 responses: "200": description: Indexed projects content: application/json: schema: $ref: "#/components/schemas/CodeProjectsResponse" "401": description: Unauthorized "405": description: Method not allowed "503": description: Canonical index unavailable /code/blast-radius: get: operationId: getCodeBlastRadius summary: Blast-radius computation for a file parameters: - name: project in: query required: false description: Stable project identity. Defaults to the authenticated active project. schema: type: string - name: generation in: query description: Optional observed current generation; stale observations fail closed. schema: type: integer format: int64 minimum: 1 - name: file_path in: query schema: type: string responses: "200": description: Current-generation blast radius with provenance-bearing edges content: application/json: schema: $ref: "#/components/schemas/BlastRadiusResponse" "400": description: Missing required parameters "401": description: Unauthorized "404": description: Project is detached/unknown or the file is not indexed "409": description: Active project is required or the observed generation is stale "503": description: Canonical index unavailable /code/structure: get: operationId: getCodeStructure summary: Definitions for a file in the canonical code index parameters: - name: project in: query required: false description: Stable project identity. Defaults to the authenticated active project. schema: type: string - name: generation in: query description: Optional observed current generation; stale observations fail closed. schema: type: integer format: int64 minimum: 1 - name: file_path in: query required: true schema: type: string - name: max_results in: query schema: type: integer default: 256 responses: "200": description: File definitions content: application/json: schema: $ref: "#/components/schemas/CodeStructureResponse" "400": description: Missing required parameters "401": description: Unauthorized "404": description: Project is unknown or detached "409": description: Active project is required or the observed generation is stale "503": description: Canonical index unavailable /code/project-stats: get: operationId: getCodeProjectStats summary: Project-level canonical code index counts and language breakdown parameters: - name: project in: query required: true schema: type: string responses: "200": description: Project index statistics content: application/json: schema: $ref: "#/components/schemas/CodeProjectStatsResponse" "400": description: Missing required parameters "401": description: Unauthorized "503": description: Canonical index unavailable /code/cross-repo-deps: get: operationId: getCodeCrossRepoDeps summary: >- Cross-repo dependency edges for a project (confidence-tiered, with evidence + version stamp), or the AMBIGUOUS review queue when status=ambiguous parameters: - name: project in: query required: true schema: type: string - name: direction in: query required: false description: >- Dependency direction: "out" = deps OF the project (default), "in" = repos that depend ON the project (reverse), "both" = union. Ignored when status=ambiguous. schema: type: string enum: [out, in, both] default: out - name: min_tier in: query required: false description: Minimum confidence tier to emit. Ignored when status=ambiguous. schema: type: string enum: [high, medium, tentative] default: medium - name: status in: query required: false description: >- When "ambiguous", returns the AMBIGUOUS review queue for the project instead of edges (direction/min_tier are not applied in that mode). schema: type: string enum: [ambiguous] - name: dry_run in: query required: false description: >- Offline candidate inspection: emit every confidence band (down to LOW, overriding min_tier) plus the AMBIGUOUS candidates inline, and write nothing (no review-queue rows). The response carries dry_run:true and an additional `ambiguous` array alongside `deps`. schema: type: string enum: ["1", "true"] responses: "200": description: Cross-repo dependency edges (or ambiguous review queue) content: application/json: schema: type: object "400": description: Missing required parameters "401": description: Unauthorized "413": description: Response too large; narrow the query "503": description: Canonical index unavailable /code/project/detach: post: operationId: postCodeProjectDetach summary: Detach the current generation of a stable project description: >- Marks the project and its current generation detached so default/current queries no longer return it. Data is retained for audit and later re-add or explicit purge. Requires an authenticated unscoped owner credential. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectLifecycleRequest" responses: "200": description: Project generation detached content: application/json: schema: $ref: "#/components/schemas/ProjectDetachResponse" "400": description: Invalid request "403": description: Verified unscoped owner principal required "404": description: Project not found "405": description: Method not allowed "503": description: Canonical index unavailable /code/project/purge: post: operationId: postCodeProjectPurge summary: Dry-run or confirm exact deletion of one stable project description: >- Omit `confirm_hash` for a read-only manifest. To delete, repeat the request with that exact SHA-256 hash and a reason. Confirmation fails if any target row changed, and audit failure blocks mutation. Requires an authenticated unscoped owner credential. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectLifecycleRequest" responses: "200": description: Dry-run or confirmed purge manifest content: application/json: schema: $ref: "#/components/schemas/ProjectLifecycleManifest" "400": description: Invalid request or confirmed operation without a reason "403": description: Verified unscoped owner principal required "404": description: Project not found "405": description: Method not allowed "409": description: Target manifest changed; run the dry run again "503": description: Audit or canonical-index operation failed /code/project/gc: post: operationId: postCodeProjectGc summary: Dry-run or confirm detached-generation garbage collection description: >- Omit `confirm_hash` for a read-only manifest. To delete expired detached generations and aliases, repeat the request with the exact SHA-256 hash and a reason. The manifest binds the retention policy and UTC cutoff as well as exact physical target fingerprints. Requires an authenticated unscoped owner credential. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectLifecycleRequest" responses: "200": description: Dry-run or confirmed garbage-collection manifest content: application/json: schema: $ref: "#/components/schemas/ProjectLifecycleManifest" "400": description: Invalid request or confirmed operation without a reason "403": description: Verified unscoped owner principal required "404": description: Project not found "405": description: Method not allowed "409": description: Target manifest changed; run the dry run again "503": description: Audit or canonical-index operation failed /code/scan: post: operationId: postCodeScan summary: Request a canonical code index scan requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CodeScanRequest" responses: "202": description: Scan accepted content: application/json: schema: $ref: "#/components/schemas/CodeScanResponse" "401": description: Unauthorized "405": description: Method not allowed /code/repo-trust: post: operationId: postCodeRepoTrust summary: Set a registered repo's cross-repo trust (owner credential only) description: >- Transactionally sets projects.trust, bumps cross_repo_meta.trust_epoch on a real transition, audits the change to cross_repo_trust_audit, and (on a change) recomputes the blocked_symbols frequency model. A scoped token is rejected with 403; the project must already exist. requestBody: required: true content: application/json: schema: type: object required: [project, trust] properties: project: { type: string } trust: { type: string, enum: [trusted, untrusted] } actor: { type: string } request_id: { type: string } responses: "200": description: Trust applied (status, project, prior_trust, new_trust, changed) content: application/json: schema: { type: object } "400": description: Missing project or invalid trust value "403": description: Forbidden (requires the owner credential) "404": description: No such project "405": description: Method not allowed "503": description: Knowledge service store unavailable /code/build: post: operationId: postCodeBuild summary: Build a project knowledge index requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CodeBuildRequest" responses: "200": description: Build complete content: application/json: schema: $ref: "#/components/schemas/CodeBuildResponse" "400": description: Missing required parameters "401": description: Unauthorized "503": description: Knowledge or vector store unavailable /code/update: post: operationId: postCodeUpdate summary: Incrementally update a project knowledge index requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CodeUpdateRequest" responses: "200": description: Update complete content: application/json: schema: $ref: "#/components/schemas/CodeUpdateResponse" "400": description: Missing required parameters "401": description: Unauthorized "503": description: Knowledge store unavailable /maintenance/repair: post: operationId: postMaintenanceRepair summary: Repair a project knowledge index requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenanceRepairRequest" responses: "200": description: Repair complete content: application/json: schema: $ref: "#/components/schemas/MaintenanceRepairResponse" "400": description: Missing required parameters "401": description: Unauthorized "503": description: Knowledge or vector store unavailable /maintenance/reconcile: post: operationId: postMaintenanceReconcile summary: Reconcile orphaned vector records requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/MaintenanceReconcileRequest" responses: "200": description: Reconcile complete content: application/json: schema: $ref: "#/components/schemas/MaintenanceReconcileResponse" "401": description: Unauthorized "500": description: Reconcile failed /maintenance/clear: post: operationId: postMaintenanceClear summary: Clear indexed knowledge for a project requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenanceClearRequest" responses: "200": description: Project cleared content: application/json: schema: $ref: "#/components/schemas/MaintenanceClearResponse" "400": description: Missing project "401": description: Unauthorized "500": description: Clear failed /maintenance/purge-project: post: operationId: postMaintenancePurgeProject summary: Purge every kb store for a project under a generation fence description: > Writes the project-purge generation fence, then deletes the project from every kb store the ingest path writes (chunks, file index, vectors, code embeddings, curator code-unit vectors, canonical index, code-unit jobs, pdf vectors, minhash), continuing past per-store failures. The fence is not cleared here. Call purge-finalize (or purge-cancel) once the caller's own deletion completed. Idempotent. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeProjectRequest" responses: "200": description: Purge fan-out completed (see per-store outcomes) content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeProjectResponse" "400": description: Missing or invalid parameters "401": description: Unauthorized "409": description: A live fence is held by another owner (takeover absent) "500": description: Fence write failed /maintenance/purge-heartbeat: post: operationId: postMaintenancePurgeHeartbeat summary: Refresh the project-purge fence heartbeat requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeFenceRequest" responses: "200": description: Heartbeat outcome (refreshed false on fence mismatch) content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeHeartbeatResponse" "400": description: Missing or invalid parameters "401": description: Unauthorized "500": description: Heartbeat failed /maintenance/purge-finalize: post: operationId: postMaintenancePurgeFinalize summary: Clear the project-purge fence after deletion completed requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeFenceRequest" responses: "200": description: Clear outcome (cleared false on fence mismatch) content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeClearResponse" "400": description: Missing or invalid parameters "401": description: Unauthorized "500": description: Clear failed /maintenance/purge-cancel: post: operationId: postMaintenancePurgeCancel summary: Clear the project-purge fence on abort requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeFenceRequest" responses: "200": description: Clear outcome (cleared false on fence mismatch) content: application/json: schema: $ref: "#/components/schemas/MaintenancePurgeClearResponse" "400": description: Missing or invalid parameters "401": description: Unauthorized "500": description: Clear failed /pipeline/status: get: operationId: getPipelineStatus summary: Report asynchronous knowledge ingest queue status responses: "200": description: Pipeline status content: application/json: schema: $ref: "#/components/schemas/PipelineStatusResponse" "401": description: Unauthorized "405": description: Method not allowed "503": description: Queue unavailable /jobs/{job_id}: get: operationId: getJobStatus summary: Report asynchronous knowledge ingest job status parameters: - name: job_id in: path required: true schema: type: integer format: int64 minimum: 1 responses: "200": description: Job status content: application/json: schema: $ref: "#/components/schemas/JobStatusResponse" "401": description: Unauthorized "404": description: Job not found "405": description: Method not allowed "503": description: Job status unavailable /ingest/status: get: operationId: getIngestStatus summary: Report background project ingest status responses: "200": description: Background ingest status content: application/json: schema: $ref: "#/components/schemas/IngestStatusResponse" "401": description: Unauthorized "405": description: Method not allowed "503": description: Ingest status unavailable /workers: get: operationId: getWorkers summary: Report aimee-kb worker and background task status responses: "200": description: Worker status content: application/json: schema: $ref: "#/components/schemas/WorkersResponse" "401": description: Unauthorized "405": description: Method not allowed "503": description: Workers unavailable /ingest: post: operationId: postIngest summary: Enqueue background project ingest requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/IngestRequest" responses: "202": description: Ingest queued content: application/json: schema: $ref: "#/components/schemas/IngestResponse" "401": description: Unauthorized "405": description: Method not allowed "503": description: Knowledge store unavailable /drain: post: operationId: postDrain summary: Drain the asynchronous knowledge ingest queue requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/DrainRequest" responses: "200": description: Queue drained content: application/json: schema: $ref: "#/components/schemas/DrainResponse" "401": description: Unauthorized "405": description: Method not allowed "500": description: Queue drain failed /entities/{id}: get: operationId: getEntityProfile summary: Canonical entity profile parameters: - name: id in: path required: true description: Entity name (slug) schema: type: string responses: "200": description: Entity profile content: application/json: schema: $ref: "#/components/schemas/EntityProfileResponse" "401": description: Unauthorized "404": description: Entity not found /entities/search: post: operationId: postEntitySearch summary: Find entities by name or context requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EntitySearchRequest" responses: "200": description: Entity search results content: application/json: schema: $ref: "#/components/schemas/EntitySearchResponse" "400": description: Missing query "401": description: Unauthorized