{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cloudflare/main/json-schema/cloudflare-widget-response-schema.json",
  "title": "WidgetResponse",
  "x-generated": "2026-10-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudflare-widgets-api-openapi.yml#/components/schemas/WidgetResponse",
  "type": "object",
  "properties": {
    "result": {
      "$ref": "#/$defs/Widget"
    },
    "success": {
      "type": "boolean"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object"
      }
    }
  },
  "$defs": {
    "Widget": {
      "type": "object",
      "properties": {
        "sitekey": {
          "type": "string",
          "description": "The public site key for the widget."
        },
        "secret": {
          "type": "string",
          "description": "The secret key for server-side verification."
        },
        "name": {
          "type": "string",
          "description": "A human-readable name for the widget."
        },
        "domains": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed domains for the widget."
        },
        "mode": {
          "type": "string",
          "enum": [
            "managed",
            "non-interactive",
            "invisible"
          ],
          "description": "The challenge mode for the widget."
        },
        "bot_fight_mode": {
          "type": "boolean",
          "description": "Whether Bot Fight Mode is enabled."
        },
        "created_on": {
          "type": "string",
          "format": "date-time"
        },
        "modified_on": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}