{"openapi":"3.1.0","info":{"title":"KPI Enterprise Mining API","description":"v1 API per `kpi-enterprise/api/openapi.v1.yaml`. Demo auth mode: pass `X-Tenant-Id: tnt_<slug>` header. Production auth: Keycloak JWT (Bearer) with `tenant_id` claim.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["system"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/ready":{"get":{"tags":["system"],"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Ready Ready Get"}}}}}}},"/v1/tenants":{"get":{"tags":["tenants"],"summary":"List Tenants","operationId":"list_tenants_v1_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Tenant"},"type":"array","title":"Response List Tenants V1 Tenants Get"}}}}}},"post":{"tags":["tenants"],"summary":"Create Tenant","operationId":"create_tenant_v1_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","operationId":"get_tenant_v1_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Update Tenant","operationId":"update_tenant_v1_tenants__tenant_id__patch","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Tenant","operationId":"delete_tenant_v1_tenants__tenant_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Tenant V1 Tenants  Tenant Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sources":{"get":{"tags":["sources"],"summary":"List Sources","operationId":"list_sources_v1_sources_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Source"},"title":"Response List Sources V1 Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["sources"],"summary":"Create Source","operationId":"create_source_v1_sources_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sources/{source_id}/sync":{"post":{"tags":["sources"],"summary":"Sync Source","operationId":"sync_source_v1_sources__source_id__sync_post","parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunRef"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/datasets":{"get":{"tags":["datasets"],"summary":"List Datasets","operationId":"list_datasets_v1_datasets_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Dataset"},"title":"Response List Datasets V1 Datasets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/datasets/{dataset_id}/profile":{"get":{"tags":["datasets"],"summary":"Dataset Profile","operationId":"dataset_profile_v1_datasets__dataset_id__profile_get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetProfile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metric-definitions":{"get":{"tags":["metrics"],"summary":"List Metric Definitions","operationId":"list_metric_definitions_v1_metric_definitions_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricDefinition"},"title":"Response List Metric Definitions V1 Metric Definitions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["metrics"],"summary":"Create Metric Definition","operationId":"create_metric_definition_v1_metric_definitions_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricDefinitionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metric-definitions/{metric_id}/versions":{"get":{"tags":["metrics"],"summary":"Metric Versions","operationId":"metric_versions_v1_metric_definitions__metric_id__versions_get","parameters":[{"name":"metric_id","in":"path","required":true,"schema":{"type":"string","title":"Metric Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricDefinition"},"title":"Response Metric Versions V1 Metric Definitions  Metric Id  Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kpi-candidates":{"get":{"tags":["metrics"],"summary":"List Kpi Candidates","operationId":"list_kpi_candidates_v1_kpi_candidates_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KpiCandidate"},"title":"Response List Kpi Candidates V1 Kpi Candidates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["metrics"],"summary":"Trigger Discovery","operationId":"trigger_discovery_v1_kpi_candidates_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryRunRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunRef"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kpi-candidates/{candidate_id}/promote":{"post":{"tags":["metrics"],"summary":"Promote Candidate","operationId":"promote_candidate_v1_kpi_candidates__candidate_id__promote_post","parameters":[{"name":"candidate_id","in":"path","required":true,"schema":{"type":"string","title":"Candidate Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kpi-observations":{"get":{"tags":["kpis"],"summary":"List Observations","operationId":"list_observations_v1_kpi_observations_get","parameters":[{"name":"metric_id","in":"query","required":true,"schema":{"type":"string","description":"Required filter","title":"Metric Id"},"description":"Required filter"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KpiObservation"},"title":"Response List Observations V1 Kpi Observations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/driver-trees":{"get":{"tags":["trees"],"summary":"List Driver Trees","operationId":"list_driver_trees_v1_driver_trees_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DriverTree"},"title":"Response List Driver Trees V1 Driver Trees Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["trees"],"summary":"Create Driver Tree","operationId":"create_driver_tree_v1_driver_trees_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverTreeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverTree"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/driver-trees/{tree_id}/nodes":{"get":{"tags":["trees"],"summary":"List Tree Nodes","operationId":"list_tree_nodes_v1_driver_trees__tree_id__nodes_get","parameters":[{"name":"tree_id","in":"path","required":true,"schema":{"type":"string","title":"Tree Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DriverNode"},"title":"Response List Tree Nodes V1 Driver Trees  Tree Id  Nodes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["trees"],"summary":"Add Tree Node","operationId":"add_tree_node_v1_driver_trees__tree_id__nodes_post","parameters":[{"name":"tree_id","in":"path","required":true,"schema":{"type":"string","title":"Tree Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverNode"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverNode"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/driver-trees/{tree_id}/edges":{"get":{"tags":["trees"],"summary":"List Tree Edges","operationId":"list_tree_edges_v1_driver_trees__tree_id__edges_get","parameters":[{"name":"tree_id","in":"path","required":true,"schema":{"type":"string","title":"Tree Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DriverEdge"},"title":"Response List Tree Edges V1 Driver Trees  Tree Id  Edges Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["trees"],"summary":"Add Tree Edge","operationId":"add_tree_edge_v1_driver_trees__tree_id__edges_post","parameters":[{"name":"tree_id","in":"path","required":true,"schema":{"type":"string","title":"Tree Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverEdge"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverEdge"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/driver-trees/{tree_id}/suggest":{"post":{"tags":["trees"],"summary":"Suggest Driver Edges","operationId":"suggest_driver_edges_v1_driver_trees__tree_id__suggest_post","parameters":[{"name":"tree_id","in":"path","required":true,"schema":{"type":"string","title":"Tree Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunRef"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/driver-trees/by-metric/{metric_id}/ancestors":{"get":{"tags":["trees"],"summary":"Driver Lineage Ancestors","operationId":"driver_lineage_ancestors_v1_driver_trees_by_metric__metric_id__ancestors_get","parameters":[{"name":"metric_id","in":"path","required":true,"schema":{"type":"string","title":"Metric Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DriverNode"},"title":"Response Driver Lineage Ancestors V1 Driver Trees By Metric  Metric Id  Ancestors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/okr-links":{"get":{"tags":["okrs"],"summary":"List Okr Links","operationId":"list_okr_links_v1_okr_links_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OkrLink"},"title":"Response List Okr Links V1 Okr Links Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["okrs"],"summary":"Create Okr Link","operationId":"create_okr_link_v1_okr_links_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkrLink"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkrLink"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/insights":{"get":{"tags":["insights"],"summary":"List Insights","operationId":"list_insights_v1_insights_get","parameters":[{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Insight"},"title":"Response List Insights V1 Insights Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefings":{"get":{"tags":["briefings"],"summary":"List Briefings","operationId":"list_briefings_v1_briefings_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Briefing"},"title":"Response List Briefings V1 Briefings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["briefings"],"summary":"Create Briefing","operationId":"create_briefing_v1_briefings_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefingCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunRef"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefings/latest":{"get":{"tags":["briefings"],"summary":"Latest Briefing","operationId":"latest_briefing_v1_briefings_latest_get","parameters":[{"name":"audience","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Latest Briefing V1 Briefings Latest Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefings/{briefing_id}":{"get":{"tags":["briefings"],"summary":"Get Briefing","operationId":"get_briefing_v1_briefings__briefing_id__get","parameters":[{"name":"briefing_id","in":"path","required":true,"schema":{"type":"string","title":"Briefing Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Briefing"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent-runs":{"get":{"tags":["agents"],"summary":"List Agent Runs","operationId":"list_agent_runs_v1_agent_runs_get","parameters":[{"name":"agent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentRun"},"title":"Response List Agent Runs V1 Agent Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent-runs/{run_id}":{"get":{"tags":["agents"],"summary":"Get Agent Run","operationId":"get_agent_run_v1_agent_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRun"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent-runs/{run_id}/approve":{"post":{"tags":["agents"],"summary":"Approve Agent Run","operationId":"approve_agent_run_v1_agent_runs__run_id__approve_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":8,"description":"Approval token from the n8n e-mail link","title":"Token"},"description":"Approval token from the n8n e-mail link"},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Approve Agent Run V1 Agent Runs  Run Id  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent-runs/{run_id}/reject":{"post":{"tags":["agents"],"summary":"Reject Agent Run","operationId":"reject_agent_run_v1_agent_runs__run_id__reject_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":8,"title":"Token"}},{"name":"reason","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Agent Run V1 Agent Runs  Run Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/evidence/{evidence_id}":{"get":{"tags":["agents"],"summary":"Get Evidence","operationId":"get_evidence_v1_evidence__evidence_id__get","parameters":[{"name":"evidence_id","in":"path","required":true,"schema":{"type":"string","title":"Evidence Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceBundle"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/benchmarks":{"get":{"tags":["benchmarks"],"summary":"List Benchmarks","operationId":"list_benchmarks_v1_benchmarks_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Benchmark"},"title":"Response List Benchmarks V1 Benchmarks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List Webhooks","operationId":"list_webhooks_v1_webhooks_get","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"},"title":"Response List Webhooks V1 Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["webhooks"],"summary":"Create Webhook","operationId":"create_webhook_v1_webhooks_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentApproval":{"properties":{"required":{"type":"boolean","title":"Required","default":false},"approvers":{"items":{"type":"string"},"type":"array","title":"Approvers"},"granted":{"type":"boolean","title":"Granted","default":false},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason"}},"type":"object","title":"AgentApproval"},"AgentRun":{"properties":{"run_id":{"type":"string","title":"Run Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"agent":{"type":"string","title":"Agent"},"status":{"$ref":"#/components/schemas/AgentRunStatus"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"tools_used":{"items":{"type":"string"},"type":"array","title":"Tools Used"},"llm_calls":{"items":{"$ref":"#/components/schemas/LlmCall"},"type":"array","title":"Llm Calls"},"evidence_bundle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Bundle"},"approval":{"$ref":"#/components/schemas/AgentApproval"},"rollback_snapshot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rollback Snapshot"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["run_id","tenant_id","agent","status","started_at"],"title":"AgentRun"},"AgentRunRef":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"$ref":"#/components/schemas/AgentRunStatus"},"trace_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Url"}},"type":"object","required":["run_id","status"],"title":"AgentRunRef"},"AgentRunStatus":{"type":"string","enum":["queued","running","succeeded","failed","blocked"],"title":"AgentRunStatus"},"Benchmark":{"properties":{"id":{"type":"string","title":"Id"},"metric_name":{"type":"string","title":"Metric Name"},"source":{"type":"string","title":"Source"},"license":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License"},"reference_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reference Value"},"reference_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Period"},"last_fetched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Fetched At"}},"type":"object","required":["id","metric_name","source"],"title":"Benchmark"},"Brand":{"type":"string","enum":["ben-e-fit","medialine","ki-guru","custom"],"title":"Brand"},"Briefing":{"properties":{"id":{"type":"string","title":"Id"},"type":{"$ref":"#/components/schemas/BriefingType"},"audience":{"type":"string","enum":["cfo","ceo","coo","controller","all"],"title":"Audience"},"status":{"$ref":"#/components/schemas/BriefingStatus"},"markdown_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown Url"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url"},"signed_pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Pdf Url"},"delivered_to":{"items":{"type":"string"},"type":"array","title":"Delivered To"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","type","audience","status","created_at"],"title":"Briefing"},"BriefingCreate":{"properties":{"type":{"$ref":"#/components/schemas/BriefingType"},"audience":{"type":"string","enum":["cfo","ceo","coo","controller","all"],"title":"Audience"},"scope":{"anyOf":[{"$ref":"#/components/schemas/BriefingScope"},{"type":"null"}]},"delivery":{"items":{"type":"string","enum":["email","slack","teams","documenso"]},"type":"array","title":"Delivery"}},"type":"object","required":["type","audience"],"title":"BriefingCreate"},"BriefingScope":{"properties":{"kpi_ids":{"items":{"type":"string"},"type":"array","title":"Kpi Ids"},"include_benchmarks":{"type":"boolean","title":"Include Benchmarks","default":true}},"type":"object","title":"BriefingScope"},"BriefingStatus":{"type":"string","enum":["queued","generating","ready","delivered","failed"],"title":"BriefingStatus"},"BriefingType":{"type":"string","enum":["daily","weekly","monthly","ad_hoc"],"title":"BriefingType"},"DataClassification":{"type":"string","enum":["public","internal","confidential","pii"],"title":"DataClassification"},"Dataset":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"catalog_uri":{"type":"string","title":"Catalog Uri"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"row_count_estimate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row Count Estimate"},"sensitivity":{"$ref":"#/components/schemas/DataClassification","default":"internal"}},"type":"object","required":["id","name","catalog_uri"],"title":"Dataset"},"DatasetColumn":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"null_ratio":{"type":"number","title":"Null Ratio"},"distinct_count":{"type":"integer","title":"Distinct Count"},"sample_values":{"items":{"type":"string"},"type":"array","title":"Sample Values"},"detected_pii":{"type":"boolean","title":"Detected Pii","default":false}},"type":"object","required":["name","type","null_ratio","distinct_count"],"title":"DatasetColumn"},"DatasetProfile":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id"},"columns":{"items":{"$ref":"#/components/schemas/DatasetColumn"},"type":"array","title":"Columns"}},"type":"object","required":["dataset_id","columns"],"title":"DatasetProfile"},"Direction":{"type":"string","enum":["up_is_favorable","down_is_favorable","neutral"],"title":"Direction"},"DiscoveryRunRequest":{"properties":{"dataset_ids":{"items":{"type":"string"},"type":"array","title":"Dataset Ids"},"scope_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Hint"}},"type":"object","required":["dataset_ids"],"title":"DiscoveryRunRequest"},"DriverEdge":{"properties":{"id":{"type":"string","title":"Id"},"from_node":{"type":"string","title":"From Node"},"to_node":{"type":"string","title":"To Node"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"}},"type":"object","required":["id","from_node","to_node"],"title":"DriverEdge"},"DriverNode":{"properties":{"id":{"type":"string","title":"Id"},"metric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric Id"},"label":{"type":"string","title":"Label"},"position":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Position"}},"type":"object","required":["id","label"],"title":"DriverNode"},"DriverTree":{"properties":{"name":{"type":"string","title":"Name"},"owner":{"type":"string","title":"Owner"},"id":{"type":"string","title":"Id"},"node_count":{"type":"integer","title":"Node Count","default":0},"edge_count":{"type":"integer","title":"Edge Count","default":0},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","owner","id","updated_at"],"title":"DriverTree"},"DriverTreeCreate":{"properties":{"name":{"type":"string","title":"Name"},"owner":{"type":"string","title":"Owner"}},"type":"object","required":["name","owner"],"title":"DriverTreeCreate"},"EvidenceBundle":{"properties":{"id":{"type":"string","title":"Id"},"run_id":{"type":"string","title":"Run Id"},"signed_url":{"type":"string","title":"Signed Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sha256"}},"type":"object","required":["id","run_id","signed_url","expires_at"],"title":"EvidenceBundle"},"Granularity":{"type":"string","enum":["minute","hour","day","week","month","quarter","year"],"title":"Granularity"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Health":{"properties":{"status":{"type":"string","enum":["ok","degraded"],"title":"Status"},"version":{"type":"string","title":"Version"},"uptime_seconds":{"type":"integer","title":"Uptime Seconds"}},"type":"object","required":["status","version","uptime_seconds"],"title":"Health"},"Insight":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["anomaly","trend_break","threshold","rca"],"title":"Type"},"metric_id":{"type":"string","title":"Metric Id"},"severity":{"$ref":"#/components/schemas/InsightSeverity"},"what_happened":{"type":"string","title":"What Happened"},"why_hypothesis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Why Hypothesis"},"what_to_do":{"items":{"$ref":"#/components/schemas/InsightAction"},"type":"array","title":"What To Do"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"evidence_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","type","metric_id","severity","what_happened","created_at"],"title":"Insight"},"InsightAction":{"properties":{"action_template":{"type":"string","title":"Action Template"},"expected_impact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Impact"}},"type":"object","required":["action_template"],"title":"InsightAction"},"InsightSeverity":{"type":"string","enum":["info","warn","critical"],"title":"InsightSeverity"},"KpiCandidate":{"properties":{"id":{"type":"string","title":"Id"},"proposed_name":{"type":"string","title":"Proposed Name"},"score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Score"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"source_dataset_id":{"type":"string","title":"Source Dataset Id"},"proposed_sql":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proposed Sql"},"suggested_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Unit"},"suggested_granularity":{"anyOf":[{"$ref":"#/components/schemas/Granularity"},{"type":"null"}]},"suggested_direction":{"anyOf":[{"$ref":"#/components/schemas/Direction"},{"type":"null"}]},"suggested_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Domain"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"status":{"type":"string","enum":["new","in_review","accepted","rejected"],"title":"Status","default":"new"}},"type":"object","required":["id","proposed_name","score","source_dataset_id"],"title":"KpiCandidate"},"KpiObservation":{"properties":{"metric_id":{"type":"string","title":"Metric Id"},"metric_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Metric Version"},"ts":{"type":"string","format":"date-time","title":"Ts"},"value":{"type":"number","title":"Value"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["metric_id","ts","value"],"title":"KpiObservation"},"LlmCall":{"properties":{"model":{"type":"string","title":"Model"},"tokens_in":{"type":"integer","title":"Tokens In"},"tokens_out":{"type":"integer","title":"Tokens Out"},"cost_eur":{"type":"number","title":"Cost Eur"},"external":{"type":"boolean","title":"External","default":false}},"type":"object","required":["model","tokens_in","tokens_out","cost_eur"],"title":"LlmCall"},"MetricAnomaly":{"properties":{"method":{"type":"string","enum":["stl_zscore","robust_z","prophet_residual","isolation_forest"],"title":"Method"},"threshold":{"type":"number","title":"Threshold"}},"type":"object","required":["method","threshold"],"title":"MetricAnomaly"},"MetricDefinition":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"owner":{"type":"string","title":"Owner"},"domain":{"type":"string","title":"Domain"},"unit":{"type":"string","title":"Unit"},"granularity":{"$ref":"#/components/schemas/Granularity"},"direction":{"$ref":"#/components/schemas/Direction"},"dbt_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dbt Model"},"expression":{"type":"string","title":"Expression"},"filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter"},"target":{"anyOf":[{"$ref":"#/components/schemas/MetricTarget"},{"type":"null"}]},"data_classification":{"$ref":"#/components/schemas/DataClassification","default":"internal"},"compliance_tags":{"items":{"type":"string"},"type":"array","title":"Compliance Tags"},"refresh_cron":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Cron"},"anomaly":{"anyOf":[{"$ref":"#/components/schemas/MetricAnomaly"},{"type":"null"}]},"id":{"type":"string","title":"Id"},"version":{"type":"integer","title":"Version"},"tenant_id":{"type":"string","title":"Tenant Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"git_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Ref"}},"type":"object","required":["name","display_name","owner","domain","unit","granularity","direction","expression","id","version","tenant_id","created_at"],"title":"MetricDefinition"},"MetricDefinitionCreate":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"owner":{"type":"string","title":"Owner"},"domain":{"type":"string","title":"Domain"},"unit":{"type":"string","title":"Unit"},"granularity":{"$ref":"#/components/schemas/Granularity"},"direction":{"$ref":"#/components/schemas/Direction"},"dbt_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dbt Model"},"expression":{"type":"string","title":"Expression"},"filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter"},"target":{"anyOf":[{"$ref":"#/components/schemas/MetricTarget"},{"type":"null"}]},"data_classification":{"$ref":"#/components/schemas/DataClassification","default":"internal"},"compliance_tags":{"items":{"type":"string"},"type":"array","title":"Compliance Tags"},"refresh_cron":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Cron"},"anomaly":{"anyOf":[{"$ref":"#/components/schemas/MetricAnomaly"},{"type":"null"}]}},"type":"object","required":["name","display_name","owner","domain","unit","granularity","direction","expression"],"title":"MetricDefinitionCreate"},"MetricTarget":{"properties":{"value":{"type":"number","title":"Value"},"tolerance_pct":{"type":"number","title":"Tolerance Pct"}},"type":"object","required":["value","tolerance_pct"],"title":"MetricTarget"},"OkrLink":{"properties":{"id":{"type":"string","title":"Id"},"objective":{"type":"string","title":"Objective"},"key_result":{"type":"string","title":"Key Result"},"metric_id":{"type":"string","title":"Metric Id"},"action_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Template Id"}},"type":"object","required":["id","objective","key_result","metric_id"],"title":"OkrLink"},"PromoteRequest":{"properties":{"approver":{"type":"string","title":"Approver"},"approval_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Note"},"target_metric_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Metric Name"}},"type":"object","required":["approver"],"title":"PromoteRequest"},"Source":{"properties":{"type":{"type":"string","enum":["airbyte","upload","rest","crawl4ai","nimble"],"title":"Type"},"name":{"type":"string","title":"Name"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"id":{"type":"string","title":"Id"},"last_sync":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync"},"status":{"type":"string","enum":["healthy","degraded","failed","unknown"],"title":"Status","default":"unknown"}},"type":"object","required":["type","name","id"],"title":"Source"},"SourceCreate":{"properties":{"type":{"type":"string","enum":["airbyte","upload","rest","crawl4ai","nimble"],"title":"Type"},"name":{"type":"string","title":"Name"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["type","name"],"title":"SourceCreate"},"Tenant":{"properties":{"slug":{"type":"string","title":"Slug"},"display_name":{"type":"string","title":"Display Name"},"brand":{"$ref":"#/components/schemas/Brand"},"external_llm_allowed":{"type":"boolean","title":"External Llm Allowed","default":false},"id":{"type":"string","pattern":"^tnt_[a-z0-9]{4,32}$","title":"Id"},"keycloak_realm":{"type":"string","title":"Keycloak Realm"},"data_classification_default":{"$ref":"#/components/schemas/DataClassification","default":"internal"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["slug","display_name","brand","id","keycloak_realm","created_at"],"title":"Tenant"},"TenantCreate":{"properties":{"slug":{"type":"string","title":"Slug"},"display_name":{"type":"string","title":"Display Name"},"brand":{"$ref":"#/components/schemas/Brand"},"external_llm_allowed":{"type":"boolean","title":"External Llm Allowed","default":false},"admin_email":{"type":"string","title":"Admin Email"}},"type":"object","required":["slug","display_name","brand","admin_email"],"title":"TenantCreate"},"TenantUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"brand":{"anyOf":[{"$ref":"#/components/schemas/Brand"},{"type":"null"}]},"external_llm_allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"External Llm Allowed"}},"type":"object","title":"TenantUpdate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Webhook":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string","enum":["insight.created","briefing.delivered","agent_run.completed","action.applied"]},"type":"array","title":"Events"},"secret_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret Ref"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["id","url","events"],"title":"Webhook"}}}}