{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/axonflow/json-schema/axonflow-circuit-breaker-schema.json",
  "title": "CircuitBreaker",
  "description": "A circuit record as returned by the status and history endpoints.\nSource of truth: `platform/agent/circuitbreaker/circuit_breaker.go`\n(Circuit).\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/axonflow-circuit-breaker-api-openapi.yml#/components/schemas/CircuitBreaker",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "scope": {
      "type": "string",
      "enum": [
        "global",
        "tenant",
        "client",
        "policy"
      ]
    },
    "scope_id": {
      "type": "string"
    },
    "org_id": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "closed",
        "open",
        "half_open"
      ],
      "description": "- closed: Normal operation\n- open: circuit tripped — matching requests are blocked\n- half_open: testing recovery — limited requests allowed\n  (auto-recovery transition; can appear in status/history)\n"
    },
    "trip_reason": {
      "type": "string",
      "enum": [
        "manual",
        "policy_violation",
        "risk_level",
        "error_rate"
      ]
    },
    "tripped_by": {
      "type": "string"
    },
    "tripped_by_email": {
      "type": "string"
    },
    "trip_comment": {
      "type": "string"
    },
    "tripped_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Auto-expiry time when the trip carried a duration; absent for indefinite trips"
    },
    "reset_by": {
      "type": "string"
    },
    "reset_at": {
      "type": "string",
      "format": "date-time"
    },
    "error_count": {
      "type": "integer"
    },
    "violation_count": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}