{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cqnce-app/json-schema/cqnce-app-routing-rule-schema.json",
  "title": "RoutingRule",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cqnce-app-openapi.yml#/components/schemas/RoutingRule",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "projectId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "PARALLEL",
        "SERIAL",
        "MAJORITY",
        "CHAIN"
      ]
    },
    "agentIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "teamIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "timeoutMs": {
      "type": [
        "integer",
        "null"
      ]
    },
    "quorum": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tagFilter": {
      "type": [
        "string",
        "null"
      ]
    },
    "priority": {
      "type": "integer"
    },
    "filterExpression": {
      "nullable": true,
      "description": "JSONLogic-compatible filter expression"
    },
    "requireStrongAuth": {
      "type": "boolean"
    },
    "serialRoundRobin": {
      "type": "boolean",
      "description": "SERIAL mode only: rotate the first assignee at each new request to distribute load across agents."
    },
    "rejectReasonRequired": {
      "type": "boolean",
      "description": "When true, agents must provide a rejection reason when submitting REJECTED decisions."
    },
    "rejectReasonOptions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Reusable predefined rejection reasons available to agents for this rule."
    },
    "defaultRejectReason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Default rejection reason preselected for agents; must be one of rejectReasonOptions."
    },
    "allowLateResponse": {
      "type": "boolean",
      "description": "When true, agent responses submitted after the request has expired are accepted and resolve the request."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}