{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-command-center-response-schema.json",
  "title": "CommandCenterResponse",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-command-center-api-openapi.yml#/components/schemas/CommandCenterResponse",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "title": "Workspace Id"
    },
    "voice": {
      "$ref": "#/$defs/VoiceMetrics",
      "default": {
        "active_calls": 0,
        "active_escalated": 0,
        "calls_today": 0,
        "escalation_rate_today": 0.0
      }
    },
    "pipeline": {
      "$ref": "#/$defs/PipelineMetrics",
      "default": {
        "sources_total": 0,
        "sources_healthy": 0,
        "sources_degraded": 0,
        "sources_failing": 0,
        "events_last_hour": 0,
        "outbound_pending": 0,
        "outbound_failed": 0,
        "connector_status": "unavailable"
      }
    },
    "data_quality": {
      "$ref": "#/$defs/DataQualityMetrics",
      "default": {
        "pending_reviews": 0,
        "entities_total": 0,
        "entities_merged_7d": 0
      }
    },
    "identity": {
      "$ref": "#/$defs/IdentityMetrics",
      "default": {
        "active_api_keys": 0
      }
    },
    "alerts": {
      "items": {
        "$ref": "#/$defs/CommandCenterAlert"
      },
      "type": "array",
      "title": "Alerts",
      "default": []
    },
    "degraded_sections": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Degraded Sections",
      "default": []
    },
    "generated_at": {
      "type": "string",
      "title": "Generated At"
    },
    "cached": {
      "type": "boolean",
      "title": "Cached",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "workspace_id",
    "generated_at"
  ],
  "$defs": {
    "CommandCenterAlert": {
      "properties": {
        "level": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "critical"
          ],
          "title": "Level"
        },
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "section": {
          "type": "string",
          "title": "Section"
        }
      },
      "type": "object",
      "required": [
        "level",
        "code",
        "message",
        "section"
      ],
      "title": "CommandCenterAlert"
    },
    "DataQualityMetrics": {
      "properties": {
        "pending_reviews": {
          "type": "integer",
          "title": "Pending Reviews",
          "default": 0
        },
        "approval_rate_7d": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Approval Rate 7D"
        },
        "avg_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avg Confidence"
        },
        "entities_total": {
          "type": "integer",
          "title": "Entities Total",
          "default": 0
        },
        "entities_merged_7d": {
          "type": "integer",
          "title": "Entities Merged 7D",
          "default": 0
        }
      },
      "type": "object",
      "title": "DataQualityMetrics"
    },
    "IdentityMetrics": {
      "properties": {
        "active_api_keys": {
          "type": "integer",
          "title": "Active Api Keys",
          "default": 0
        },
        "active_sessions": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Active Sessions"
        },
        "failed_auths_1h": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Failed Auths 1H"
        },
        "locked_accounts": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Locked Accounts"
        },
        "mfa_coverage_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mfa Coverage Pct"
        }
      },
      "type": "object",
      "title": "IdentityMetrics"
    },
    "PipelineMetrics": {
      "properties": {
        "sources_total": {
          "type": "integer",
          "title": "Sources Total",
          "default": 0
        },
        "sources_healthy": {
          "type": "integer",
          "title": "Sources Healthy",
          "default": 0
        },
        "sources_degraded": {
          "type": "integer",
          "title": "Sources Degraded",
          "default": 0
        },
        "sources_failing": {
          "type": "integer",
          "title": "Sources Failing",
          "default": 0
        },
        "events_last_hour": {
          "type": "integer",
          "title": "Events Last Hour",
          "default": 0
        },
        "outbound_pending": {
          "type": "integer",
          "title": "Outbound Pending",
          "default": 0
        },
        "outbound_failed": {
          "type": "integer",
          "title": "Outbound Failed",
          "default": 0
        },
        "connector_status": {
          "type": "string",
          "enum": [
            "healthy",
            "degraded",
            "unavailable"
          ],
          "title": "Connector Status",
          "default": "unavailable"
        }
      },
      "type": "object",
      "title": "PipelineMetrics"
    },
    "VoiceMetrics": {
      "properties": {
        "active_calls": {
          "type": "integer",
          "title": "Active Calls",
          "default": 0
        },
        "active_escalated": {
          "type": "integer",
          "title": "Active Escalated",
          "default": 0
        },
        "calls_today": {
          "type": "integer",
          "title": "Calls Today",
          "default": 0
        },
        "avg_quality_score_today": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avg Quality Score Today"
        },
        "escalation_rate_today": {
          "type": "number",
          "title": "Escalation Rate Today",
          "default": 0.0
        }
      },
      "type": "object",
      "title": "VoiceMetrics"
    }
  }
}