{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/merofoundry-com/json-schema/merofoundry-com-rule-response-schema.json",
  "title": "RuleResponse",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/merofoundry-com-openapi.json#/components/schemas/RuleResponse",
  "properties": {
    "actions": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Actions",
      "type": "array"
    },
    "applicationId": {
      "format": "uuid",
      "title": "Applicationid",
      "type": "string"
    },
    "condition": {
      "additionalProperties": true,
      "title": "Condition",
      "type": "object"
    },
    "createdAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Createdat"
    },
    "createdBy": {
      "format": "uuid",
      "title": "Createdby",
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "id": {
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "isActive": {
      "title": "Isactive",
      "type": "boolean"
    },
    "modelId": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modelid"
    },
    "name": {
      "title": "Name",
      "type": "string"
    },
    "phase": {
      "$ref": "#/$defs/RulePhase"
    },
    "priority": {
      "title": "Priority",
      "type": "integer"
    },
    "run_as": {
      "$ref": "#/$defs/RuleRunAs",
      "default": "actor"
    },
    "scope": {
      "additionalProperties": true,
      "title": "Scope",
      "type": "object"
    },
    "settings": {
      "additionalProperties": true,
      "title": "Settings",
      "type": "object"
    },
    "tenantId": {
      "format": "uuid",
      "title": "Tenantid",
      "type": "string"
    },
    "trigger": {
      "$ref": "#/$defs/RuleTrigger"
    },
    "updatedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updatedat"
    },
    "workspaceId": {
      "format": "uuid",
      "title": "Workspaceid",
      "type": "string"
    }
  },
  "required": [
    "id",
    "tenantId",
    "workspaceId",
    "applicationId",
    "name",
    "condition",
    "actions",
    "trigger",
    "phase",
    "priority",
    "isActive",
    "settings",
    "createdBy"
  ],
  "type": "object",
  "$defs": {
    "RulePhase": {
      "enum": [
        "pre_save",
        "post_save",
        "response",
        "background"
      ],
      "title": "RulePhase",
      "type": "string"
    },
    "RuleRunAs": {
      "enum": [
        "actor",
        "app_automation"
      ],
      "title": "RuleRunAs",
      "type": "string"
    },
    "RuleTrigger": {
      "enum": [
        "record_create",
        "record_update",
        "record_save",
        "record_delete",
        "record_read",
        "frontend_event",
        "webhook_received",
        "tool_called",
        "manual",
        "login_succeeded",
        "login_failed",
        "function_failed"
      ],
      "title": "RuleTrigger",
      "type": "string"
    }
  }
}