{
  "openapi": "3.1.0",
  "info": {
    "title": "ProcessMind External API",
    "version": "1.0.0",
    "description": "REST API for integrating ProcessMind process mining and simulation into your own systems.\n\nAuthentication: every request must send an API key in the `x-api-key` header. Keys are created in the ProcessMind app (Admin Settings → API Keys). Organization write endpoints additionally require an organization-scoped API key.\n\nThe base URL is `https://api.processmind.com` (stage-specific URLs may differ).",
    "contact": {
      "name": "ProcessMind",
      "url": "https://processmind.com"
    }
  },
  "servers": [
    {
      "url": "https://api.processmind.com"
    }
  ],
  "tags": [
    {
      "name": "Tenant"
    },
    {
      "name": "Users"
    },
    {
      "name": "Processes"
    },
    {
      "name": "Simulations"
    },
    {
      "name": "Mappings"
    },
    {
      "name": "Datasets"
    },
    {
      "name": "Datatables"
    },
    {
      "name": "Versions"
    },
    {
      "name": "Artifacts"
    },
    {
      "name": "Search"
    },
    {
      "name": "AI"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Organization"
    },
    {
      "name": "API keys"
    },
    {
      "name": "MCP"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key issued in the ProcessMind app"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Short-lived OAuth access token for the MCP endpoint"
      }
    },
    "parameters": {
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Maximum number of items to return",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "default": 100
        }
      },
      "Offset": {
        "name": "offset",
        "in": "query",
        "required": false,
        "description": "Number of items to skip",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Error response: either { message } or a machine-readable { code, message }",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Bad request: e.g. an invalid filter expression, a process without a model, an unsupported upload type or a missing required field",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid, disabled or expired API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "API key lacks the required scope or organization access, the tenant is inactive, or the plan blocks the file type",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InternalError": {
        "description": "Unexpected server error: the request can be retried safely",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with the current state (e.g. a seat gate or a reused id)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotAcceptable": {
        "description": "The value cannot be accepted (e.g. a reserved or duplicate short name)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limited: see the endpoint's documented rate limit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Data pipeline not ready or an upstream query failed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "File exceeds the platform's maximum upload size",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "Tenant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "createdBy": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.724Z",
            "type": "string",
            "format": "date-time"
          },
          "displayName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "contactEmail": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "shortName": {
            "default": null,
            "nullable": true,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30,
                "pattern": "^[\\da-z]([\\da-z-]{0,28}[\\da-z])?$"
              },
              {
                "type": "string",
                "maxLength": 0
              }
            ]
          },
          "useOrganizationTheme": {
            "default": true,
            "type": "boolean"
          },
          "description": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "organizationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "allowedLogins": {
            "type": "object",
            "properties": {
              "Microsoft": {
                "type": "boolean"
              },
              "Google": {
                "type": "boolean"
              },
              "LinkedIn": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "tenantType": {
            "default": "normal",
            "type": "string",
            "enum": [
              "normal",
              "sandbox",
              "demo"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "createdBy",
          "createdAt",
          "displayName",
          "contactEmail",
          "isActive",
          "shortName",
          "useOrganizationTheme",
          "description",
          "organizationId",
          "allowedLogins",
          "tenantType",
          "url"
        ],
        "additionalProperties": false
      },
      "Organization": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.726Z",
            "type": "string",
            "format": "date-time"
          },
          "contactEmail": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "allowedLogins": {
            "default": {
              "Microsoft": false,
              "Google": false,
              "LinkedIn": false
            },
            "type": "object",
            "properties": {
              "Microsoft": {
                "type": "boolean"
              },
              "Google": {
                "type": "boolean"
              },
              "LinkedIn": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "createdBy": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          }
        },
        "required": [
          "id",
          "displayName",
          "createdAt",
          "contactEmail",
          "isActive",
          "allowedLogins",
          "createdBy"
        ],
        "additionalProperties": false
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "firstName": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 64
          },
          "lastName": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 64
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.707Z",
            "type": "string",
            "format": "date-time"
          },
          "lastLoginAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "isActiveInTenant": {
            "default": false,
            "description": "Whether the user is active in this tenant",
            "type": "boolean"
          },
          "isAdminInTenant": {
            "default": false,
            "description": "Admin rights in this tenant (honored verbatim: full tenant-admin surface)",
            "type": "boolean"
          },
          "access": {
            "default": "designer",
            "description": "Single-select seat: none | portalViewer | designer | architect | intelligence",
            "type": "string",
            "enum": [
              "none",
              "portalViewer",
              "designer",
              "architect",
              "intelligence"
            ]
          },
          "isDashboardViewer": {
            "default": false,
            "description": "Whether the user has read-only dashboard view (paid rungs and enterprise portal viewers)",
            "type": "boolean"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "isActiveInOrganization": {
            "default": false,
            "description": "Whether the user is active in the organization",
            "type": "boolean"
          },
          "isAdminInOrganization": {
            "default": false,
            "description": "Organization admin rights (honored verbatim: only issue organization-scoped keys to org admins)",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "email",
          "firstName",
          "lastName",
          "createdAt",
          "lastLoginAt",
          "tenantId",
          "isActiveInTenant",
          "isAdminInTenant",
          "access",
          "isDashboardViewer",
          "organizationId",
          "isActiveInOrganization",
          "isAdminInOrganization"
        ],
        "additionalProperties": false
      },
      "OrganizationUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "firstName": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 64
          },
          "lastName": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 64
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.707Z",
            "type": "string",
            "format": "date-time"
          },
          "lastLoginAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "isActiveInOrganization": {
            "default": false,
            "description": "Whether the user is active in the organization",
            "type": "boolean"
          },
          "isAdminInOrganization": {
            "default": false,
            "description": "Organization admin rights (honored verbatim: only issue organization-scoped keys to org admins)",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "email",
          "firstName",
          "lastName",
          "createdAt",
          "lastLoginAt",
          "organizationId",
          "isActiveInOrganization",
          "isAdminInOrganization"
        ],
        "additionalProperties": false
      },
      "Process": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "treeParentId": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "treeNodeType": {
            "default": "Process",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Process"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "TreeGroup"
                ]
              }
            ]
          },
          "displayName": {
            "default": "New Process",
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "createdAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "designerModelId": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          }
        },
        "required": [
          "id",
          "treeParentId",
          "treeNodeType",
          "displayName",
          "createdAt",
          "updatedAt",
          "designerModelId"
        ],
        "additionalProperties": false
      },
      "Bpmn": {
        "type": "object",
        "properties": {
          "bpmnXml": {
            "type": "string",
            "description": "BPMN 2.0 XML"
          }
        },
        "required": [
          "bpmnXml"
        ],
        "additionalProperties": false
      },
      "Dataset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "treeParentId": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "treeNodeType": {
            "default": "Dataset",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Dataset"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "TreeGroup"
                ]
              }
            ]
          },
          "displayName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "createdAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "dataTableId": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          }
        },
        "required": [
          "id",
          "treeParentId",
          "treeNodeType",
          "displayName",
          "createdAt",
          "updatedAt",
          "dataTableId"
        ],
        "additionalProperties": false
      },
      "DataTable": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "datasetId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "createdAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "hasDataLoaded": {
            "default": false,
            "type": "boolean"
          },
          "filterExpression": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 4096
          },
          "metaInfo": {
            "default": {
              "type": "nodata"
            },
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "nodata"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "upload"
                    ]
                  },
                  "uploadedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "fileName": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 255
                  },
                  "fileSize": {
                    "type": "number"
                  },
                  "fileLastModified": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "rows": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "uploadedAt",
                  "fileName",
                  "fileSize",
                  "fileLastModified",
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "simulation"
                    ]
                  },
                  "simulationId": {
                    "type": "string"
                  },
                  "simulationName": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 255
                  },
                  "simulatedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "fileSize": {
                    "type": "number"
                  },
                  "rows": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "simulationId",
                  "simulationName",
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "error"
                    ]
                  },
                  "fileName": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 255
                  },
                  "errorAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "type",
                  "errorAt"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "id",
          "datasetId",
          "displayName",
          "createdAt",
          "updatedAt",
          "hasDataLoaded",
          "filterExpression",
          "metaInfo"
        ],
        "additionalProperties": false
      },
      "Simulation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "datasetName": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "startTime": {
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "useWarmUp": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "displayName",
          "datasetName",
          "startTime",
          "endTime",
          "useWarmUp"
        ],
        "additionalProperties": false
      },
      "Mapping": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "modelId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "dataTableId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "color": {
            "default": null,
            "nullable": true,
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "data-1",
                      "data-2",
                      "data-3",
                      "data-4",
                      "data-5",
                      "data-6",
                      "data-7",
                      "data-8",
                      "data-9",
                      "data-10",
                      "data-11"
                    ]
                  },
                  {}
                ]
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          },
          "showByDefault": {
            "default": true,
            "type": "boolean"
          },
          "mappingRole": {
            "default": "comparison",
            "type": "string",
            "enum": [
              "primary",
              "comparison"
            ]
          },
          "sortOrder": {
            "default": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "modelId",
          "dataTableId",
          "displayName",
          "color",
          "showByDefault",
          "mappingRole",
          "sortOrder"
        ],
        "additionalProperties": false
      },
      "TenantStatistics": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "uploadedDataSize": {
            "type": "number"
          },
          "uploadedDataCount": {
            "type": "number"
          },
          "modelCount": {
            "type": "number"
          },
          "simulationCount": {
            "type": "number"
          },
          "userCount": {
            "type": "number"
          }
        },
        "required": [
          "tenantId",
          "uploadedDataSize",
          "uploadedDataCount",
          "modelCount",
          "simulationCount",
          "userCount"
        ],
        "additionalProperties": false
      },
      "OrganizationStatistics": {
        "type": "object",
        "properties": {
          "userCount": {
            "type": "number"
          },
          "tenantCount": {
            "type": "number"
          },
          "tenantStatistics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tenantId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "uploadedDataSize": {
                  "type": "number"
                },
                "uploadedDataCount": {
                  "type": "number"
                },
                "modelCount": {
                  "type": "number"
                },
                "simulationCount": {
                  "type": "number"
                },
                "userCount": {
                  "type": "number"
                }
              },
              "required": [
                "tenantId",
                "uploadedDataSize",
                "uploadedDataCount",
                "modelCount",
                "simulationCount",
                "userCount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "userCount",
          "tenantCount",
          "tenantStatistics"
        ],
        "additionalProperties": false
      },
      "PreSignedUpload": {
        "type": "object",
        "properties": {
          "PreSignedUploadUrl": {
            "type": "string",
            "description": "Presigned S3 PUT URL (valid ~1h)"
          }
        },
        "required": [
          "PreSignedUploadUrl"
        ],
        "additionalProperties": false
      },
      "Download": {
        "type": "object",
        "properties": {
          "downloadUrl": {
            "type": "string"
          },
          "expiresInSeconds": {
            "type": "number"
          }
        },
        "required": [
          "downloadUrl",
          "expiresInSeconds"
        ],
        "additionalProperties": false
      },
      "OAuthToken": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Short-lived Bearer JWT for POST /v1/mcp/{tenantId}"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "expires_in": {
            "type": "number"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "additionalProperties": false
      },
      "SearchResults": {
        "type": "object",
        "properties": {
          "hits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "role",
                    "process",
                    "element",
                    "documentation",
                    "version",
                    "comment"
                  ]
                },
                "entityType": {
                  "type": "string",
                  "enum": [
                    "role",
                    "process",
                    "element",
                    "documentation",
                    "version",
                    "comment"
                  ]
                },
                "entityId": {
                  "type": "string"
                },
                "subKey": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                },
                "score": {
                  "type": "number"
                },
                "processId": {
                  "nullable": true,
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "processDisplayName": {
                  "nullable": true,
                  "type": "string"
                },
                "elementType": {
                  "nullable": true,
                  "type": "string"
                },
                "docSection": {
                  "nullable": true,
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "category",
                "entityType",
                "entityId",
                "subKey",
                "title",
                "snippet",
                "score",
                "processId",
                "processDisplayName",
                "elementType",
                "docSection",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "required": [
              "role",
              "process",
              "element",
              "documentation",
              "version",
              "comment"
            ]
          },
          "total": {
            "type": "number"
          },
          "suggestions": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "hits",
          "counts",
          "total",
          "suggestions"
        ],
        "additionalProperties": false
      },
      "SeatAvailability": {
        "type": "object",
        "properties": {
          "contractType": {
            "type": "string",
            "enum": [
              "free",
              "selfServe",
              "fixed",
              "unlimited"
            ]
          },
          "isTrial": {
            "type": "boolean"
          },
          "purchased": {
            "nullable": true,
            "type": "object",
            "properties": {
              "foundation": {
                "type": "number"
              },
              "architecture": {
                "type": "number"
              },
              "intelligence": {
                "type": "number"
              }
            },
            "required": [
              "foundation",
              "architecture",
              "intelligence"
            ],
            "additionalProperties": false
          },
          "inUseBillable": {
            "type": "object",
            "properties": {
              "foundation": {
                "type": "number"
              },
              "architecture": {
                "type": "number"
              },
              "intelligence": {
                "type": "number"
              }
            },
            "required": [
              "foundation",
              "architecture",
              "intelligence"
            ],
            "additionalProperties": false
          },
          "inUseFree": {
            "type": "number"
          },
          "inUseDashboardViewers": {
            "type": "number"
          },
          "totalBillable": {
            "type": "number"
          },
          "freeViewerAllowance": {
            "nullable": true,
            "type": "number"
          },
          "freeViewerOverAllowance": {
            "type": "number"
          },
          "dashboardViewerAllowance": {
            "nullable": true,
            "type": "number"
          },
          "dashboardViewerOverAllowance": {
            "type": "number"
          },
          "fixedOverage": {
            "nullable": true,
            "type": "number"
          },
          "target": {
            "nullable": true,
            "type": "object",
            "properties": {
              "foundation": {
                "type": "number"
              },
              "architecture": {
                "type": "number"
              },
              "intelligence": {
                "type": "number"
              }
            },
            "required": [
              "foundation",
              "architecture",
              "intelligence"
            ],
            "additionalProperties": false
          },
          "drift": {
            "nullable": true,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rung": {
                  "type": "string",
                  "enum": [
                    "foundation",
                    "architecture",
                    "intelligence"
                  ]
                },
                "paid": {
                  "type": "number"
                },
                "actual": {
                  "type": "number"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "equal",
                    "monthlyPendingIncrease",
                    "monthlyHeldDecrease",
                    "annualInBufferGrace",
                    "annualTopUpPending",
                    "annualNewLinePending",
                    "annualOverPaid"
                  ]
                },
                "buffer": {
                  "type": "number"
                }
              },
              "required": [
                "rung",
                "paid",
                "actual",
                "state",
                "buffer"
              ],
              "additionalProperties": false
            }
          },
          "interval": {
            "nullable": true,
            "type": "string",
            "enum": [
              "month",
              "year"
            ]
          },
          "nextBilledAt": {
            "nullable": true,
            "type": "string"
          },
          "externalApiSeatPolicy": {
            "nullable": true,
            "type": "string",
            "enum": [
              "autoBill",
              "requireCapacity"
            ]
          }
        },
        "required": [
          "contractType",
          "isTrial",
          "purchased",
          "inUseBillable",
          "inUseFree",
          "inUseDashboardViewers",
          "totalBillable",
          "freeViewerAllowance",
          "freeViewerOverAllowance",
          "dashboardViewerAllowance",
          "dashboardViewerOverAllowance",
          "fixedOverage",
          "target",
          "drift",
          "interval",
          "nextBilledAt",
          "externalApiSeatPolicy"
        ],
        "additionalProperties": false
      },
      "SimulationDetails": {
        "type": "object",
        "properties": {
          "simulation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "displayName": {
                "type": "string",
                "minLength": 0,
                "maxLength": 128
              },
              "datasetName": {
                "default": null,
                "nullable": true,
                "type": "string",
                "minLength": 0,
                "maxLength": 128
              },
              "startTime": {
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "endTime": {
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "useWarmUp": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "displayName",
              "datasetName",
              "startTime",
              "endTime",
              "useWarmUp"
            ],
            "additionalProperties": false,
            "description": "Simulation header"
          },
          "elementSettings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "simulationId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "modelElementId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "settings": {
                  "default": {},
                  "type": "object",
                  "properties": {
                    "processingTimeDistribution": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timeslot": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Always"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Default"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "FixedPeriod"
                                    ]
                                  },
                                  "startDateTime": {
                                    "type": "number"
                                  },
                                  "endDateTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDateTime",
                                  "endDateTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekendDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeek"
                                    ]
                                  },
                                  "startDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDay",
                                  "startTime",
                                  "endDay",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachMonth"
                                    ]
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachYear"
                                    ]
                                  },
                                  "startMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startMonth",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endMonth",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "conditions": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Values"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Range"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "minValue": {
                                      "type": "number"
                                    },
                                    "maxValue": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "minValue",
                                    "maxValue"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "distribution": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Fixed"
                                    ]
                                  },
                                  "value": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Normal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Uniform"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Poisson"
                                    ]
                                  },
                                  "lambda": {
                                    "type": "number"
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "lambda",
                                  "rateUnit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Triangular"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "mode": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "mode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Weibull"
                                    ]
                                  },
                                  "scale": {
                                    "type": "number"
                                  },
                                  "shape": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "scale",
                                  "shape"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Lognormal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "PearsonVI"
                                    ]
                                  },
                                  "alpha1": {
                                    "type": "number"
                                  },
                                  "alpha2": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "alpha1",
                                  "alpha2",
                                  "beta"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Beta"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "alpha": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "alpha",
                                  "beta"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "timeUnit": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "minutes",
                              "hours",
                              "days"
                            ]
                          },
                          "rateUnit": {
                            "type": "string",
                            "enum": [
                              "perTimeSlot",
                              "perHour",
                              "perDay",
                              "perWeek",
                              "perMonth",
                              "perYear"
                            ]
                          }
                        },
                        "required": [
                          "timeslot",
                          "conditions",
                          "distribution"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "processingTimeUnit": {
                      "type": "string",
                      "enum": [
                        "seconds",
                        "minutes",
                        "hours",
                        "days"
                      ]
                    },
                    "updateAttributeRules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "attributeId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "timeslot": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Always"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Default"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "FixedPeriod"
                                    ]
                                  },
                                  "startDateTime": {
                                    "type": "number"
                                  },
                                  "endDateTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDateTime",
                                  "endDateTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekendDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeek"
                                    ]
                                  },
                                  "startDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDay",
                                  "startTime",
                                  "endDay",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachMonth"
                                    ]
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachYear"
                                    ]
                                  },
                                  "startMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startMonth",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endMonth",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "conditions": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Values"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Range"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "minValue": {
                                      "type": "number"
                                    },
                                    "maxValue": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "minValue",
                                    "maxValue"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "newValue": {
                            "type": "string"
                          },
                          "isEnabled": {
                            "default": true,
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "attributeId",
                          "timeslot",
                          "conditions",
                          "newValue",
                          "isEnabled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "requiredResources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "resourceId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                          },
                          "amount": {
                            "default": 1,
                            "type": "number",
                            "minimum": 0
                          }
                        },
                        "required": [
                          "resourceId",
                          "amount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "caseStartsDistribution": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timeslot": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Always"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Default"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "FixedPeriod"
                                    ]
                                  },
                                  "startDateTime": {
                                    "type": "number"
                                  },
                                  "endDateTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDateTime",
                                  "endDateTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekendDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeek"
                                    ]
                                  },
                                  "startDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDay",
                                  "startTime",
                                  "endDay",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachMonth"
                                    ]
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachYear"
                                    ]
                                  },
                                  "startMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startMonth",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endMonth",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "conditions": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Values"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Range"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "minValue": {
                                      "type": "number"
                                    },
                                    "maxValue": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "minValue",
                                    "maxValue"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "distribution": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Fixed"
                                    ]
                                  },
                                  "value": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Normal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Uniform"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Poisson"
                                    ]
                                  },
                                  "lambda": {
                                    "type": "number"
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "lambda",
                                  "rateUnit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Triangular"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "mode": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "mode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Weibull"
                                    ]
                                  },
                                  "scale": {
                                    "type": "number"
                                  },
                                  "shape": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "scale",
                                  "shape"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Lognormal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "PearsonVI"
                                    ]
                                  },
                                  "alpha1": {
                                    "type": "number"
                                  },
                                  "alpha2": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "alpha1",
                                  "alpha2",
                                  "beta"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Beta"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "alpha": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "alpha",
                                  "beta"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "timeUnit": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "minutes",
                              "hours",
                              "days"
                            ]
                          },
                          "rateUnit": {
                            "type": "string",
                            "enum": [
                              "perTimeSlot",
                              "perHour",
                              "perDay",
                              "perWeek",
                              "perMonth",
                              "perYear"
                            ]
                          }
                        },
                        "required": [
                          "timeslot",
                          "conditions",
                          "distribution"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "caseStartsTimeUnit": {
                      "type": "string",
                      "enum": [
                        "perTimeSlot",
                        "perHour",
                        "perDay",
                        "perWeek",
                        "perMonth",
                        "perYear"
                      ]
                    },
                    "capacityInterval": {
                      "type": "string",
                      "enum": [
                        "perHour",
                        "perDay",
                        "perWeek"
                      ]
                    },
                    "skipChanceDistribution": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timeslot": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Always"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Default"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "FixedPeriod"
                                    ]
                                  },
                                  "startDateTime": {
                                    "type": "number"
                                  },
                                  "endDateTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDateTime",
                                  "endDateTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekendDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeek"
                                    ]
                                  },
                                  "startDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDay",
                                  "startTime",
                                  "endDay",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachMonth"
                                    ]
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachYear"
                                    ]
                                  },
                                  "startMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startMonth",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endMonth",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "conditions": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Values"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Range"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "minValue": {
                                      "type": "number"
                                    },
                                    "maxValue": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "minValue",
                                    "maxValue"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "distribution": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Fixed"
                                    ]
                                  },
                                  "value": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Normal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Uniform"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Poisson"
                                    ]
                                  },
                                  "lambda": {
                                    "type": "number"
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "lambda",
                                  "rateUnit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Triangular"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "mode": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "mode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Weibull"
                                    ]
                                  },
                                  "scale": {
                                    "type": "number"
                                  },
                                  "shape": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "scale",
                                  "shape"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Lognormal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "PearsonVI"
                                    ]
                                  },
                                  "alpha1": {
                                    "type": "number"
                                  },
                                  "alpha2": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "alpha1",
                                  "alpha2",
                                  "beta"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Beta"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "alpha": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "alpha",
                                  "beta"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "timeUnit": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "minutes",
                              "hours",
                              "days"
                            ]
                          },
                          "rateUnit": {
                            "type": "string",
                            "enum": [
                              "perTimeSlot",
                              "perHour",
                              "perDay",
                              "perWeek",
                              "perMonth",
                              "perYear"
                            ]
                          }
                        },
                        "required": [
                          "timeslot",
                          "conditions",
                          "distribution"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "queueStrategy": {
                      "default": "fifo",
                      "type": "string",
                      "enum": [
                        "fifo",
                        "lifo",
                        "random"
                      ]
                    },
                    "chanceToTakeDistribution": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timeslot": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Always"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Default"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "FixedPeriod"
                                    ]
                                  },
                                  "startDateTime": {
                                    "type": "number"
                                  },
                                  "endDateTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDateTime",
                                  "endDateTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekendDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeek"
                                    ]
                                  },
                                  "startDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDay",
                                  "startTime",
                                  "endDay",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachMonth"
                                    ]
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachYear"
                                    ]
                                  },
                                  "startMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startMonth",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endMonth",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "conditions": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Values"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Range"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "minValue": {
                                      "type": "number"
                                    },
                                    "maxValue": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "minValue",
                                    "maxValue"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "distribution": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Fixed"
                                    ]
                                  },
                                  "value": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Normal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Uniform"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Poisson"
                                    ]
                                  },
                                  "lambda": {
                                    "type": "number"
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "lambda",
                                  "rateUnit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Triangular"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "mode": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "mode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Weibull"
                                    ]
                                  },
                                  "scale": {
                                    "type": "number"
                                  },
                                  "shape": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "scale",
                                  "shape"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Lognormal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "PearsonVI"
                                    ]
                                  },
                                  "alpha1": {
                                    "type": "number"
                                  },
                                  "alpha2": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "alpha1",
                                  "alpha2",
                                  "beta"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Beta"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "alpha": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "alpha",
                                  "beta"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "timeUnit": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "minutes",
                              "hours",
                              "days"
                            ]
                          },
                          "rateUnit": {
                            "type": "string",
                            "enum": [
                              "perTimeSlot",
                              "perHour",
                              "perDay",
                              "perWeek",
                              "perMonth",
                              "perYear"
                            ]
                          }
                        },
                        "required": [
                          "timeslot",
                          "conditions",
                          "distribution"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "simulationId",
                "modelElementId",
                "settings"
              ],
              "additionalProperties": false
            },
            "description": "Per-element simulation settings"
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "simulationId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "displayName": {
                  "default": "New attribute",
                  "type": "string"
                },
                "valueDistribution": {
                  "default": {
                    "type": "Number"
                  },
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "Number",
                        "Text"
                      ]
                    },
                    "numberDistributions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timeslot": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Always"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "Default"
                                    ]
                                  }
                                },
                                "required": [
                                  "periodicity"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "FixedPeriod"
                                    ]
                                  },
                                  "startDateTime": {
                                    "type": "number"
                                  },
                                  "endDateTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDateTime",
                                  "endDateTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeekendDay"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachWeek"
                                    ]
                                  },
                                  "startDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDay": {
                                    "type": "string",
                                    "enum": [
                                      "Sunday",
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday"
                                    ]
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDay",
                                  "startTime",
                                  "endDay",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachMonth"
                                    ]
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "periodicity": {
                                    "type": "string",
                                    "enum": [
                                      "EachYear"
                                    ]
                                  },
                                  "startMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "startDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "startTime": {
                                    "type": "number"
                                  },
                                  "endMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "endDayOfMonth": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 31
                                  },
                                  "endTime": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "periodicity",
                                  "startMonth",
                                  "startDayOfMonth",
                                  "startTime",
                                  "endMonth",
                                  "endDayOfMonth",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "conditions": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Values"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "Range"
                                      ]
                                    },
                                    "attribute": {
                                      "type": "string"
                                    },
                                    "minValue": {
                                      "type": "number"
                                    },
                                    "maxValue": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "attribute",
                                    "minValue",
                                    "maxValue"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "distribution": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Fixed"
                                    ]
                                  },
                                  "value": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Normal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Uniform"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Poisson"
                                    ]
                                  },
                                  "lambda": {
                                    "type": "number"
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "lambda",
                                  "rateUnit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Triangular"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "mode": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "mode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Weibull"
                                    ]
                                  },
                                  "scale": {
                                    "type": "number"
                                  },
                                  "shape": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "scale",
                                  "shape"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Lognormal"
                                    ]
                                  },
                                  "mean": {
                                    "type": "number"
                                  },
                                  "stdDev": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "mean",
                                  "stdDev"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "PearsonVI"
                                    ]
                                  },
                                  "alpha1": {
                                    "type": "number"
                                  },
                                  "alpha2": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "alpha1",
                                  "alpha2",
                                  "beta"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "Beta"
                                    ]
                                  },
                                  "min": {
                                    "type": "number"
                                  },
                                  "max": {
                                    "type": "number"
                                  },
                                  "alpha": {
                                    "type": "number"
                                  },
                                  "beta": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "type",
                                  "min",
                                  "max",
                                  "alpha",
                                  "beta"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "timeUnit": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "minutes",
                              "hours",
                              "days"
                            ]
                          },
                          "rateUnit": {
                            "type": "string",
                            "enum": [
                              "perTimeSlot",
                              "perHour",
                              "perDay",
                              "perWeek",
                              "perMonth",
                              "perYear"
                            ]
                          },
                          "id": {
                            "type": "string"
                          },
                          "isEnabled": {
                            "type": "boolean"
                          },
                          "isDefault": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "timeslot",
                          "conditions",
                          "distribution",
                          "id",
                          "isEnabled",
                          "isDefault"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "textDistributions": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "timeslot": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Always"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Default"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "FixedPeriod"
                                        ]
                                      },
                                      "startDateTime": {
                                        "type": "number"
                                      },
                                      "endDateTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDateTime",
                                      "endDateTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekendDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeek"
                                        ]
                                      },
                                      "startDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDay",
                                      "startTime",
                                      "endDay",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachMonth"
                                        ]
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachYear"
                                        ]
                                      },
                                      "startMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startMonth",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endMonth",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "isEnabled": {
                                "type": "boolean"
                              },
                              "isDefault": {
                                "type": "boolean"
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "list"
                                ]
                              },
                              "textValues": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "chance": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "value",
                                    "chance"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "id",
                              "timeslot",
                              "isEnabled",
                              "isDefault",
                              "mode",
                              "textValues"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "timeslot": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Always"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Default"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "FixedPeriod"
                                        ]
                                      },
                                      "startDateTime": {
                                        "type": "number"
                                      },
                                      "endDateTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDateTime",
                                      "endDateTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekendDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeek"
                                        ]
                                      },
                                      "startDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDay",
                                      "startTime",
                                      "endDay",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachMonth"
                                        ]
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachYear"
                                        ]
                                      },
                                      "startMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startMonth",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endMonth",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "isEnabled": {
                                "type": "boolean"
                              },
                              "isDefault": {
                                "type": "boolean"
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "numbered"
                                ]
                              },
                              "numberedValue": {
                                "type": "object",
                                "properties": {
                                  "prefix": {
                                    "type": "string"
                                  },
                                  "startNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "endNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "distributionType": {
                                    "default": "uniform",
                                    "type": "string",
                                    "enum": [
                                      "uniform",
                                      "longTail"
                                    ]
                                  }
                                },
                                "required": [
                                  "prefix",
                                  "startNumber",
                                  "endNumber",
                                  "distributionType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "timeslot",
                              "isEnabled",
                              "isDefault",
                              "mode",
                              "numberedValue"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "timeslot": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Always"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Default"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "FixedPeriod"
                                        ]
                                      },
                                      "startDateTime": {
                                        "type": "number"
                                      },
                                      "endDateTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDateTime",
                                      "endDateTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekendDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeek"
                                        ]
                                      },
                                      "startDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDay",
                                      "startTime",
                                      "endDay",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachMonth"
                                        ]
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachYear"
                                        ]
                                      },
                                      "startMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startMonth",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endMonth",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "isEnabled": {
                                "type": "boolean"
                              },
                              "isDefault": {
                                "type": "boolean"
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "fictionalNames"
                                ]
                              },
                              "fictionalNamesValue": {
                                "type": "object",
                                "properties": {
                                  "distributionType": {
                                    "default": "uniform",
                                    "type": "string",
                                    "enum": [
                                      "uniform",
                                      "longTail"
                                    ]
                                  },
                                  "uniqueCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 10000
                                  }
                                },
                                "required": [
                                  "distributionType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "timeslot",
                              "isEnabled",
                              "isDefault",
                              "mode",
                              "fictionalNamesValue"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "timeslot": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Always"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Default"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "FixedPeriod"
                                        ]
                                      },
                                      "startDateTime": {
                                        "type": "number"
                                      },
                                      "endDateTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDateTime",
                                      "endDateTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekendDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeek"
                                        ]
                                      },
                                      "startDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDay",
                                      "startTime",
                                      "endDay",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachMonth"
                                        ]
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachYear"
                                        ]
                                      },
                                      "startMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startMonth",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endMonth",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "isEnabled": {
                                "type": "boolean"
                              },
                              "isDefault": {
                                "type": "boolean"
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "fictionalCompanies"
                                ]
                              },
                              "fictionalCompaniesValue": {
                                "type": "object",
                                "properties": {
                                  "distributionType": {
                                    "default": "uniform",
                                    "type": "string",
                                    "enum": [
                                      "uniform",
                                      "longTail"
                                    ]
                                  },
                                  "uniqueCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 10000
                                  }
                                },
                                "required": [
                                  "distributionType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "timeslot",
                              "isEnabled",
                              "isDefault",
                              "mode",
                              "fictionalCompaniesValue"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "timeslot": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Always"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "Default"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "periodicity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "FixedPeriod"
                                        ]
                                      },
                                      "startDateTime": {
                                        "type": "number"
                                      },
                                      "endDateTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDateTime",
                                      "endDateTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeekendDay"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachWeek"
                                        ]
                                      },
                                      "startDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDay": {
                                        "type": "string",
                                        "enum": [
                                          "Sunday",
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday"
                                        ]
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDay",
                                      "startTime",
                                      "endDay",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachMonth"
                                        ]
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "periodicity": {
                                        "type": "string",
                                        "enum": [
                                          "EachYear"
                                        ]
                                      },
                                      "startMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "startDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "startTime": {
                                        "type": "number"
                                      },
                                      "endMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "endDayOfMonth": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 31
                                      },
                                      "endTime": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "periodicity",
                                      "startMonth",
                                      "startDayOfMonth",
                                      "startTime",
                                      "endMonth",
                                      "endDayOfMonth",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "isEnabled": {
                                "type": "boolean"
                              },
                              "isDefault": {
                                "type": "boolean"
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "countries"
                                ]
                              },
                              "countriesValue": {
                                "type": "object",
                                "properties": {
                                  "distributionType": {
                                    "default": "uniform",
                                    "type": "string",
                                    "enum": [
                                      "uniform",
                                      "longTail"
                                    ]
                                  },
                                  "uniqueCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 10000
                                  }
                                },
                                "required": [
                                  "distributionType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "timeslot",
                              "isEnabled",
                              "isDefault",
                              "mode",
                              "countriesValue"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                "simulationAttributeType": {
                  "default": null,
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "simulationId",
                "displayName",
                "valueDistribution",
                "simulationAttributeType"
              ],
              "additionalProperties": false
            },
            "description": "Simulated attributes"
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "simulationId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "displayName": {
                  "default": "New resource",
                  "type": "string"
                },
                "levelDistribution": {
                  "default": [],
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "timeslot": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "Always"
                                ]
                              }
                            },
                            "required": [
                              "periodicity"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "Default"
                                ]
                              }
                            },
                            "required": [
                              "periodicity"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "FixedPeriod"
                                ]
                              },
                              "startDateTime": {
                                "type": "number"
                              },
                              "endDateTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startDateTime",
                              "endDateTime"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "EachDay"
                                ]
                              },
                              "startTime": {
                                "type": "number"
                              },
                              "endTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startTime",
                              "endTime"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "EachWeekDay"
                                ]
                              },
                              "startTime": {
                                "type": "number"
                              },
                              "endTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startTime",
                              "endTime"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "EachWeekendDay"
                                ]
                              },
                              "startTime": {
                                "type": "number"
                              },
                              "endTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startTime",
                              "endTime"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "EachWeek"
                                ]
                              },
                              "startDay": {
                                "type": "string",
                                "enum": [
                                  "Sunday",
                                  "Monday",
                                  "Tuesday",
                                  "Wednesday",
                                  "Thursday",
                                  "Friday",
                                  "Saturday"
                                ]
                              },
                              "startTime": {
                                "type": "number"
                              },
                              "endDay": {
                                "type": "string",
                                "enum": [
                                  "Sunday",
                                  "Monday",
                                  "Tuesday",
                                  "Wednesday",
                                  "Thursday",
                                  "Friday",
                                  "Saturday"
                                ]
                              },
                              "endTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startDay",
                              "startTime",
                              "endDay",
                              "endTime"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "EachMonth"
                                ]
                              },
                              "startDayOfMonth": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 31
                              },
                              "startTime": {
                                "type": "number"
                              },
                              "endDayOfMonth": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 31
                              },
                              "endTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startDayOfMonth",
                              "startTime",
                              "endDayOfMonth",
                              "endTime"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "periodicity": {
                                "type": "string",
                                "enum": [
                                  "EachYear"
                                ]
                              },
                              "startMonth": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 12
                              },
                              "startDayOfMonth": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 31
                              },
                              "startTime": {
                                "type": "number"
                              },
                              "endMonth": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 12
                              },
                              "endDayOfMonth": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 31
                              },
                              "endTime": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "periodicity",
                              "startMonth",
                              "startDayOfMonth",
                              "startTime",
                              "endMonth",
                              "endDayOfMonth",
                              "endTime"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "conditions": {
                        "default": [],
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "Values"
                                  ]
                                },
                                "attribute": {
                                  "type": "string"
                                },
                                "values": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "attribute",
                                "values"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "Range"
                                  ]
                                },
                                "attribute": {
                                  "type": "string"
                                },
                                "minValue": {
                                  "type": "number"
                                },
                                "maxValue": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "type",
                                "attribute",
                                "minValue",
                                "maxValue"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "distribution": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Fixed"
                                ]
                              },
                              "value": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Normal"
                                ]
                              },
                              "mean": {
                                "type": "number"
                              },
                              "stdDev": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "mean",
                              "stdDev"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Uniform"
                                ]
                              },
                              "min": {
                                "type": "number"
                              },
                              "max": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "min",
                              "max"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Poisson"
                                ]
                              },
                              "lambda": {
                                "type": "number"
                              },
                              "rateUnit": {
                                "type": "string",
                                "enum": [
                                  "perTimeSlot",
                                  "perHour",
                                  "perDay",
                                  "perWeek",
                                  "perMonth",
                                  "perYear"
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "lambda",
                              "rateUnit"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Triangular"
                                ]
                              },
                              "min": {
                                "type": "number"
                              },
                              "max": {
                                "type": "number"
                              },
                              "mode": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "min",
                              "max",
                              "mode"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Weibull"
                                ]
                              },
                              "scale": {
                                "type": "number"
                              },
                              "shape": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "scale",
                              "shape"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Lognormal"
                                ]
                              },
                              "mean": {
                                "type": "number"
                              },
                              "stdDev": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "mean",
                              "stdDev"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "PearsonVI"
                                ]
                              },
                              "alpha1": {
                                "type": "number"
                              },
                              "alpha2": {
                                "type": "number"
                              },
                              "beta": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "alpha1",
                              "alpha2",
                              "beta"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Beta"
                                ]
                              },
                              "min": {
                                "type": "number"
                              },
                              "max": {
                                "type": "number"
                              },
                              "alpha": {
                                "type": "number"
                              },
                              "beta": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "type",
                              "min",
                              "max",
                              "alpha",
                              "beta"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "timeUnit": {
                        "type": "string",
                        "enum": [
                          "seconds",
                          "minutes",
                          "hours",
                          "days"
                        ]
                      },
                      "rateUnit": {
                        "type": "string",
                        "enum": [
                          "perTimeSlot",
                          "perHour",
                          "perDay",
                          "perWeek",
                          "perMonth",
                          "perYear"
                        ]
                      }
                    },
                    "required": [
                      "timeslot",
                      "conditions",
                      "distribution"
                    ],
                    "additionalProperties": false
                  }
                },
                "attributeId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                }
              },
              "required": [
                "id",
                "simulationId",
                "displayName",
                "levelDistribution"
              ],
              "additionalProperties": false
            },
            "description": "Resource pools"
          }
        },
        "required": [
          "simulation",
          "elementSettings",
          "attributes",
          "resources"
        ],
        "additionalProperties": false
      },
      "SimulationRunStatus": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "notStarted",
              "running",
              "processing",
              "ready",
              "error"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          },
          "step": {
            "type": "string"
          },
          "casesSimulated": {
            "type": "number"
          },
          "targetCases": {
            "nullable": true,
            "type": "number"
          },
          "eventsGenerated": {
            "type": "number"
          },
          "errorMessage": {
            "type": "string"
          },
          "simulationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          }
        },
        "required": [
          "state",
          "simulationId"
        ],
        "additionalProperties": false
      },
      "Version": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "processId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "modelId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "versionNumber": {
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 9007199254740991
          },
          "versionType": {
            "default": "manual",
            "type": "string",
            "enum": [
              "manual",
              "auto"
            ]
          },
          "displayName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "description": {
            "default": null,
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "processDisplayName": {
            "default": null,
            "nullable": true,
            "type": "string"
          },
          "processShortDescription": {
            "default": null,
            "nullable": true,
            "type": "string"
          },
          "publishedState": {
            "default": null,
            "nullable": true,
            "type": "string",
            "enum": [
              "draft",
              "review",
              "approved",
              "archived",
              "retired"
            ]
          },
          "elementCount": {
            "default": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "connectionCount": {
            "default": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "processId",
          "modelId",
          "versionNumber",
          "versionType",
          "displayName",
          "description",
          "createdAt",
          "updatedAt",
          "processDisplayName",
          "processShortDescription",
          "publishedState",
          "elementCount",
          "connectionCount"
        ],
        "additionalProperties": false
      },
      "Artifact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 500
          },
          "description": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 2000
          },
          "originalFileName": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 500
          },
          "mimeType": {
            "default": "",
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "kind": {
            "type": "string",
            "enum": [
              "Image",
              "Pdf",
              "Docx",
              "Xlsx",
              "Pptx",
              "Text",
              "Video"
            ]
          },
          "artifactType": {
            "default": "modelIcon",
            "type": "string",
            "enum": [
              "modelIcon",
              "processArtifact",
              "doc",
              "orgDoc",
              "levelFrontPageImage"
            ]
          },
          "uploadState": {
            "default": "Uploading",
            "type": "string",
            "enum": [
              "Uploading",
              "Ready",
              "Failed",
              "Deleted"
            ]
          },
          "hasThumbnail": {
            "default": false,
            "type": "boolean"
          },
          "sizeBytes": {
            "default": 0,
            "type": "number"
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.741Z",
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          }
        },
        "required": [
          "id",
          "displayName",
          "description",
          "originalFileName",
          "mimeType",
          "kind",
          "artifactType",
          "uploadState",
          "hasThumbnail",
          "sizeBytes",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "process.created",
                "process.updated",
                "process.deleted",
                "mapping.created",
                "data.ready",
                "simulation.completed",
                "webhook.test"
              ]
            }
          },
          "description": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 500
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.782Z",
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "isActive",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "WebhookCreateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "process.created",
                "process.updated",
                "process.deleted",
                "mapping.created",
                "data.ready",
                "simulation.completed",
                "webhook.test"
              ]
            }
          },
          "description": {
            "default": null,
            "nullable": true,
            "type": "string",
            "minLength": 0,
            "maxLength": 500
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "createdAt": {
            "default": "2026-10-15T20:00:17.782Z",
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "Signing secret; only returned here, at creation"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "isActive",
          "createdAt",
          "secret"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "deliveryId": {
            "type": "string",
            "description": "Unique id of this delivery — use it to deduplicate retries (deliveries are at-least-once)"
          },
          "event": {
            "type": "string",
            "description": "Event name (e.g. data.ready, simulation.completed)"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "type": "object",
            "additionalProperties": {},
            "description": "Event-specific data"
          }
        },
        "required": [
          "deliveryId",
          "event",
          "occurredAt",
          "payload"
        ],
        "additionalProperties": false,
        "description": "The JSON body ProcessMind POSTs to your webhook URL. Verify authenticity with X-ProcessMind-Signature (HMAC-SHA256 of the raw body using your webhook secret)."
      },
      "AiPromptBody": {
        "type": "object",
        "properties": {
          "prompt": {
            "description": "Natural language prompt",
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "summaryVariant": {
            "type": "string"
          }
        },
        "required": [
          "prompt"
        ],
        "additionalProperties": false
      },
      "AiPromptResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error",
              "generating"
            ]
          },
          "result": {
            "description": "Prompt-specific result payload (present when status is success)",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "processAnalysis"
                    ]
                  },
                  "analysis": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "analysis"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "processQuestion"
                    ]
                  },
                  "answer": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "answer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "AiSummary"
                    ]
                  },
                  "summary": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "performance"
                            ]
                          },
                          "cycleTimeInsights": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "stage": {
                                  "type": "string"
                                },
                                "observation": {
                                  "type": "string"
                                },
                                "impact": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "stage",
                                "observation",
                                "impact"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "efficiencyOpportunities": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "potentialGain": {
                                  "type": "string"
                                },
                                "howToAchieve": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "potentialGain",
                                "howToAchieve"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "cycleTimeInsights",
                          "efficiencyOpportunities",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "bottleneck"
                            ]
                          },
                          "bottlenecks": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "location": {
                                  "type": "string"
                                },
                                "severity": {
                                  "type": "string",
                                  "enum": [
                                    "high",
                                    "medium",
                                    "low"
                                  ]
                                },
                                "rootCause": {
                                  "type": "string"
                                },
                                "affectedCases": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "location",
                                "severity",
                                "rootCause",
                                "affectedCases"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "quickWins": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "effort": {
                                  "type": "string",
                                  "enum": [
                                    "low",
                                    "medium",
                                    "high"
                                  ]
                                },
                                "impact": {
                                  "type": "string",
                                  "enum": [
                                    "low",
                                    "medium",
                                    "high"
                                  ]
                                },
                                "description": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "effort",
                                "impact",
                                "description"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "bottlenecks",
                          "quickWins",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "compliance"
                            ]
                          },
                          "deviations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "deviation": {
                                  "type": "string"
                                },
                                "frequency": {
                                  "type": "string"
                                },
                                "riskLevel": {
                                  "type": "string",
                                  "enum": [
                                    "high",
                                    "medium",
                                    "low"
                                  ]
                                },
                                "consequence": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "deviation",
                                "frequency",
                                "riskLevel",
                                "consequence"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "riskAlerts": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "urgency": {
                                  "type": "string",
                                  "enum": [
                                    "immediate",
                                    "soon",
                                    "monitor"
                                  ]
                                },
                                "description": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "urgency",
                                "description"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "deviations",
                          "riskAlerts",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "trend"
                            ]
                          },
                          "trendObservations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "metric": {
                                  "type": "string"
                                },
                                "direction": {
                                  "type": "string",
                                  "enum": [
                                    "improving",
                                    "declining",
                                    "stable",
                                    "volatile"
                                  ]
                                },
                                "observation": {
                                  "type": "string"
                                },
                                "significance": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "metric",
                                "direction",
                                "observation",
                                "significance"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "patterns": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "actionableInsight": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "actionableInsight"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "trendObservations",
                          "patterns",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "comparison"
                            ]
                          },
                          "comparisons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "aspectCompared": {
                                  "type": "string"
                                },
                                "finding": {
                                  "type": "string"
                                },
                                "winner": {
                                  "type": "string"
                                },
                                "gap": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "aspectCompared",
                                "finding",
                                "winner",
                                "gap"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "discrepancies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "expected": {
                                  "type": "string"
                                },
                                "actual": {
                                  "type": "string"
                                },
                                "impact": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "expected",
                                "actual",
                                "impact"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "comparisons",
                          "discrepancies",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "healthCheck"
                            ]
                          },
                          "topIssues": {
                            "minItems": 1,
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "severity": {
                                  "type": "string",
                                  "enum": [
                                    "critical",
                                    "warning",
                                    "info"
                                  ]
                                },
                                "metric": {
                                  "type": "string"
                                },
                                "detail": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "severity",
                                "metric",
                                "detail"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "quickActions": {
                            "minItems": 1,
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "expectedImprovement": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "expectedImprovement"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "topIssues",
                          "quickActions",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "processHealth"
                            ]
                          },
                          "focusArea": {
                            "type": "object",
                            "properties": {
                              "dimension": {
                                "type": "string",
                                "enum": [
                                  "conformance",
                                  "uniformity",
                                  "rework",
                                  "efficiency",
                                  "smoothness"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "dimension",
                              "title",
                              "reason"
                            ],
                            "additionalProperties": false
                          },
                          "topIssues": {
                            "minItems": 1,
                            "maxItems": 4,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "severity": {
                                  "type": "string",
                                  "enum": [
                                    "critical",
                                    "warning",
                                    "info"
                                  ]
                                },
                                "dimension": {
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                },
                                "metric": {
                                  "type": "string"
                                },
                                "detail": {
                                  "type": "string"
                                },
                                "inAppHint": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "severity",
                                "dimension",
                                "metric",
                                "detail",
                                "inAppHint"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "nextActions": {
                            "minItems": 1,
                            "maxItems": 4,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "inAppTarget": {
                                  "type": "string"
                                },
                                "whyNow": {
                                  "type": "string"
                                },
                                "expectedImprovement": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "inAppTarget",
                                "whyNow",
                                "expectedImprovement"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "keepMomentum": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title",
                              "description"
                            ],
                            "additionalProperties": false
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "focusArea",
                          "topIssues",
                          "nextActions",
                          "keepMomentum",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "processName": {
                            "type": "string"
                          },
                          "dashboardTitle": {
                            "type": "string"
                          },
                          "processAndDashboardDescription": {
                            "type": "string"
                          },
                          "managementSummary": {
                            "type": "string"
                          },
                          "variant": {
                            "type": "string",
                            "enum": [
                              "rpaAutomation"
                            ]
                          },
                          "automationCandidates": {
                            "minItems": 1,
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "activity": {
                                  "type": "string"
                                },
                                "rpaFit": {
                                  "type": "string",
                                  "enum": [
                                    "high",
                                    "medium",
                                    "low"
                                  ]
                                },
                                "implementationComplexity": {
                                  "type": "string",
                                  "enum": [
                                    "low",
                                    "medium",
                                    "high"
                                  ]
                                },
                                "whyGoodCandidate": {
                                  "type": "string"
                                },
                                "automationIdea": {
                                  "type": "string"
                                },
                                "expectedBenefit": {
                                  "type": "string"
                                },
                                "relevantVariations": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "activity",
                                "rpaFit",
                                "implementationComplexity",
                                "whyGoodCandidate",
                                "automationIdea",
                                "expectedBenefit",
                                "relevantVariations"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "notRecommended": {
                            "maxItems": 5,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "activity": {
                                  "type": "string"
                                },
                                "reason": {
                                  "type": "string"
                                },
                                "blocker": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "activity",
                                "reason",
                                "blocker"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "implementationNotes": {
                            "minItems": 1,
                            "maxItems": 5,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "description"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "recommendations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "dimension": {
                                  "nullable": true,
                                  "type": "string",
                                  "enum": [
                                    "conformance",
                                    "uniformity",
                                    "rework",
                                    "efficiency",
                                    "smoothness"
                                  ]
                                }
                              },
                              "required": [
                                "title",
                                "description",
                                "dimension"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "processName",
                          "dashboardTitle",
                          "processAndDashboardDescription",
                          "managementSummary",
                          "variant",
                          "automationCandidates",
                          "notRecommended",
                          "implementationNotes",
                          "recommendations"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "summary"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "processDocumentation"
                    ]
                  },
                  "documentation": {
                    "type": "object",
                    "properties": {
                      "sections": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "section": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "description",
                                    "purpose",
                                    "scope",
                                    "triggers",
                                    "outcomes",
                                    "inputs",
                                    "outputs",
                                    "kpis",
                                    "risks",
                                    "exceptions",
                                    "regulatoryReferences",
                                    "systems",
                                    "relatedProcesses",
                                    "glossary",
                                    "_element",
                                    "sop",
                                    "screenRecordings",
                                    "interviewNotes",
                                    "templates",
                                    "evidence",
                                    "references",
                                    "relatedLinks",
                                    "goals",
                                    "model",
                                    "raci"
                                  ]
                                },
                                {
                                  "type": "string"
                                }
                              ]
                            },
                            "content": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "section",
                            "content"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "sections"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "documentation"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "processRaci"
                    ]
                  },
                  "raci": {
                    "type": "object",
                    "properties": {
                      "roles": {
                        "nullable": true,
                        "description": "Roles referenced in RACI assignments",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "abbreviation": {
                              "type": "string",
                              "minLength": 0,
                              "maxLength": 20
                            },
                            "description": {
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "abbreviation",
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "assignments": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "elementIndex": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            },
                            "responsible": {
                              "nullable": true,
                              "type": "string"
                            },
                            "accountable": {
                              "nullable": true,
                              "type": "string"
                            },
                            "consulted": {
                              "nullable": true,
                              "type": "string"
                            },
                            "informed": {
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": [
                            "elementIndex",
                            "responsible",
                            "accountable",
                            "consulted",
                            "informed"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "roles",
                      "assignments"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "raci"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "processMetaEdit"
                    ]
                  },
                  "processMeta": {
                    "type": "object",
                    "properties": {
                      "displayName": {
                        "nullable": true,
                        "type": "string"
                      },
                      "classification": {
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "public",
                          "internal",
                          "confidential"
                        ]
                      },
                      "shortDescription": {
                        "nullable": true,
                        "type": "string",
                        "minLength": 0,
                        "maxLength": 150
                      },
                      "treeParentName": {
                        "nullable": true,
                        "type": "string"
                      },
                      "publishedState": {
                        "nullable": true,
                        "type": "string",
                        "enum": [
                          "draft",
                          "published",
                          "archived"
                        ]
                      },
                      "processCodePrefix": {
                        "nullable": true,
                        "type": "string",
                        "minLength": 0,
                        "maxLength": 10
                      },
                      "owner": {
                        "nullable": true,
                        "type": "string"
                      },
                      "versionNumber": {
                        "nullable": true,
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "processMeta"
                ],
                "additionalProperties": false
              }
            ]
          },
          "error": {
            "description": "Error message when status is error",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false
      },
      "Success": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "additionalProperties": false
      },
      "Message": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "Deleted": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean"
          }
        },
        "required": [
          "deleted"
        ],
        "additionalProperties": false
      },
      "UserAdded": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The id of the newly added user"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "message"
        ],
        "additionalProperties": false
      },
      "ArtifactPresignedUpload": {
        "type": "object",
        "properties": {
          "artifactId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "originalUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "artifactId",
          "originalUrl",
          "thumbnailUrl"
        ],
        "additionalProperties": false
      },
      "ProcessArtifact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "artifactId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "section": {
            "type": "string"
          },
          "artifact": {
            "nullable": true,
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "displayName": {
                "default": "",
                "type": "string",
                "minLength": 0,
                "maxLength": 500
              },
              "description": {
                "default": null,
                "nullable": true,
                "type": "string",
                "minLength": 0,
                "maxLength": 2000
              },
              "originalFileName": {
                "default": "",
                "type": "string",
                "minLength": 0,
                "maxLength": 500
              },
              "mimeType": {
                "default": "",
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              },
              "kind": {
                "type": "string",
                "enum": [
                  "Image",
                  "Pdf",
                  "Docx",
                  "Xlsx",
                  "Pptx",
                  "Text",
                  "Video"
                ]
              },
              "artifactType": {
                "default": "modelIcon",
                "type": "string",
                "enum": [
                  "modelIcon",
                  "processArtifact",
                  "doc",
                  "orgDoc",
                  "levelFrontPageImage"
                ]
              },
              "uploadState": {
                "default": "Uploading",
                "type": "string",
                "enum": [
                  "Uploading",
                  "Ready",
                  "Failed",
                  "Deleted"
                ]
              },
              "hasThumbnail": {
                "default": false,
                "type": "boolean"
              },
              "sizeBytes": {
                "default": 0,
                "type": "number"
              },
              "createdAt": {
                "default": "2026-10-15T20:00:17.741Z",
                "type": "string",
                "format": "date-time"
              },
              "createdBy": {
                "nullable": true,
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              }
            },
            "required": [
              "id",
              "displayName",
              "description",
              "originalFileName",
              "mimeType",
              "kind",
              "artifactType",
              "uploadState",
              "hasThumbnail",
              "sizeBytes",
              "createdAt"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "artifactId",
          "section",
          "artifact"
        ],
        "additionalProperties": false
      },
      "ProcessCaseFeatures": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "ready"
                ]
              },
              "processId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "modelId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "dataTableId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "rowCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "hasMore": {
                "type": "boolean"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                          null
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "required": [
              "state",
              "processId",
              "modelId",
              "dataTableId",
              "rowCount",
              "hasMore",
              "rows"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "preprocessing"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "state",
              "message"
            ],
            "additionalProperties": false
          }
        ]
      },
      "VersionCreated": {
        "type": "object",
        "properties": {
          "version": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "processId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "modelId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "versionNumber": {
                "type": "integer",
                "minimum": 0,
                "exclusiveMinimum": true,
                "maximum": 9007199254740991
              },
              "versionType": {
                "default": "manual",
                "type": "string",
                "enum": [
                  "manual",
                  "auto"
                ]
              },
              "displayName": {
                "default": "",
                "type": "string",
                "minLength": 0,
                "maxLength": 128
              },
              "description": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "createdAt": {
                "default": null,
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "default": null,
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "processDisplayName": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "processShortDescription": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "publishedState": {
                "default": null,
                "nullable": true,
                "type": "string",
                "enum": [
                  "draft",
                  "review",
                  "approved",
                  "archived",
                  "retired"
                ]
              },
              "elementCount": {
                "default": 0,
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "connectionCount": {
                "default": 0,
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "processId",
              "modelId",
              "versionNumber",
              "versionType",
              "displayName",
              "description",
              "createdAt",
              "updatedAt",
              "processDisplayName",
              "processShortDescription",
              "publishedState",
              "elementCount",
              "connectionCount"
            ],
            "additionalProperties": false
          },
          "restoredFrom": {
            "nullable": true,
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "processId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "modelId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "versionNumber": {
                "type": "integer",
                "minimum": 0,
                "exclusiveMinimum": true,
                "maximum": 9007199254740991
              },
              "versionType": {
                "default": "manual",
                "type": "string",
                "enum": [
                  "manual",
                  "auto"
                ]
              },
              "displayName": {
                "default": "",
                "type": "string",
                "minLength": 0,
                "maxLength": 128
              },
              "description": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "createdAt": {
                "default": null,
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "default": null,
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "processDisplayName": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "processShortDescription": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "publishedState": {
                "default": null,
                "nullable": true,
                "type": "string",
                "enum": [
                  "draft",
                  "review",
                  "approved",
                  "archived",
                  "retired"
                ]
              },
              "elementCount": {
                "default": 0,
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "connectionCount": {
                "default": 0,
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "processId",
              "modelId",
              "versionNumber",
              "versionType",
              "displayName",
              "description",
              "createdAt",
              "updatedAt",
              "processDisplayName",
              "processShortDescription",
              "publishedState",
              "elementCount",
              "connectionCount"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "restoredFrom"
        ],
        "additionalProperties": false
      },
      "VersionResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "processId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "modelId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "versionNumber": {
                "type": "integer",
                "minimum": 0,
                "exclusiveMinimum": true,
                "maximum": 9007199254740991
              },
              "versionType": {
                "default": "manual",
                "type": "string",
                "enum": [
                  "manual",
                  "auto"
                ]
              },
              "displayName": {
                "default": "",
                "type": "string",
                "minLength": 0,
                "maxLength": 128
              },
              "description": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "createdAt": {
                "default": null,
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "default": null,
                "nullable": true,
                "type": "string",
                "format": "date-time"
              },
              "processDisplayName": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "processShortDescription": {
                "default": null,
                "nullable": true,
                "type": "string"
              },
              "publishedState": {
                "default": null,
                "nullable": true,
                "type": "string",
                "enum": [
                  "draft",
                  "review",
                  "approved",
                  "archived",
                  "retired"
                ]
              },
              "elementCount": {
                "default": 0,
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "connectionCount": {
                "default": 0,
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "processId",
              "modelId",
              "versionNumber",
              "versionType",
              "displayName",
              "description",
              "createdAt",
              "updatedAt",
              "processDisplayName",
              "processShortDescription",
              "publishedState",
              "elementCount",
              "connectionCount"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version"
        ],
        "additionalProperties": false
      },
      "SimulationActionResponse": {
        "type": "object",
        "properties": {
          "simulation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              },
              "displayName": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "displayName"
            ],
            "additionalProperties": false
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "simulation",
          "message"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenantId": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "organizationId": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "partialKey": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "createdAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "lastUsedAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "type": "object",
            "properties": {
              "read": {
                "default": true,
                "type": "boolean"
              },
              "write": {
                "default": true,
                "type": "boolean"
              },
              "uploadData": {
                "default": true,
                "type": "boolean"
              },
              "sessions": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "read",
              "write",
              "uploadData",
              "sessions"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "tenantId",
          "organizationId",
          "displayName",
          "partialKey",
          "enabled",
          "createdAt",
          "lastUsedAt",
          "expiresAt",
          "scope"
        ],
        "additionalProperties": false
      },
      "ApiKeyCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "tenantId": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "organizationId": {
            "nullable": true,
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "displayName": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "partialKey": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "createdAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "lastUsedAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "type": "object",
            "properties": {
              "read": {
                "default": true,
                "type": "boolean"
              },
              "write": {
                "default": true,
                "type": "boolean"
              },
              "uploadData": {
                "default": true,
                "type": "boolean"
              },
              "sessions": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "read",
              "write",
              "uploadData",
              "sessions"
            ],
            "additionalProperties": false
          },
          "secret": {
            "type": "string",
            "minLength": 0,
            "maxLength": 128
          }
        },
        "required": [
          "id",
          "tenantId",
          "organizationId",
          "displayName",
          "partialKey",
          "enabled",
          "createdAt",
          "lastUsedAt",
          "expiresAt",
          "scope",
          "secret"
        ],
        "additionalProperties": false
      },
      "LoginToken": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "expiresInSeconds": {
            "type": "number"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "token",
          "url",
          "expiresInSeconds",
          "expiresAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v1/openapi.json": {
      "get": {
        "operationId": "getOpenapiJson",
        "tags": [
          "Tenant"
        ],
        "summary": "This OpenAPI specification",
        "x-required-key-type": "none",
        "x-required-scope": "none",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}": {
      "get": {
        "operationId": "getTenantTenantId",
        "tags": [
          "Tenant"
        ],
        "summary": "Get tenant information",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantId",
        "tags": [
          "Tenant"
        ],
        "summary": "Update tenant settings",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "contactEmail": {
                    "type": "string"
                  },
                  "shortName": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "406": {
            "$ref": "#/components/responses/NotAcceptable"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/statistics": {
      "get": {
        "operationId": "getTenantTenantIdStatistics",
        "tags": [
          "Tenant"
        ],
        "summary": "Get tenant statistics (data size, models, simulations, users)",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantStatistics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/users": {
      "get": {
        "operationId": "getTenantTenantIdUsers",
        "tags": [
          "Users"
        ],
        "summary": "List users in the tenant",
        "description": "Returns the matching users as a bare JSON array: there is no total count; page with `limit`/`offset`.",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdUsers",
        "tags": [
          "Users"
        ],
        "summary": "Add a user to the tenant (no invitation email is sent)",
        "description": "Role fields in the body (isAdminInTenant, access: none|portalViewer|designer|architect|intelligence, isDashboardViewer) are honored verbatim; this endpoint is a full tenant-admin surface, so only issue write-scoped keys to trusted callers. Dashboard viewing is the isDashboardViewer boolean; the legacy read-only viewer rung has been removed.",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                    "description": "The user's email address (also the login identity)"
                  },
                  "firstName": {
                    "description": "Optional first name",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 64
                  },
                  "lastName": {
                    "description": "Optional last name",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 64
                  },
                  "isActiveInTenant": {
                    "description": "Whether the user is active in this tenant",
                    "type": "boolean"
                  },
                  "isAdminInTenant": {
                    "description": "Admin rights in this tenant (honored verbatim: full tenant-admin surface)",
                    "type": "boolean"
                  },
                  "access": {
                    "description": "Single-select seat: none | portalViewer | designer | architect | intelligence",
                    "type": "string",
                    "enum": [
                      "none",
                      "portalViewer",
                      "designer",
                      "architect",
                      "intelligence"
                    ]
                  },
                  "isDashboardViewer": {
                    "description": "Whether the user has read-only dashboard view",
                    "type": "boolean"
                  },
                  "preferredLocale": {
                    "description": "Preferred UI locale for the user",
                    "type": "string",
                    "enum": [
                      "en",
                      "zh",
                      "es",
                      "fr",
                      "de",
                      "pt",
                      "it",
                      "nl",
                      "ja",
                      "tr"
                    ]
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAdded"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/users/{userId}": {
      "put": {
        "operationId": "putTenantTenantIdUsersUserId",
        "tags": [
          "Users"
        ],
        "summary": "Update a user's tenant settings",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isActiveInTenant": {
                    "description": "Whether the user is active in this tenant",
                    "type": "boolean"
                  },
                  "isAdminInTenant": {
                    "description": "Admin rights in this tenant (honored verbatim: full tenant-admin surface)",
                    "type": "boolean"
                  },
                  "access": {
                    "description": "Single-select seat: none | portalViewer | designer | architect | intelligence. Dashboard viewing is the isDashboardViewer boolean.",
                    "type": "string",
                    "enum": [
                      "none",
                      "portalViewer",
                      "designer",
                      "architect",
                      "intelligence"
                    ]
                  },
                  "isDashboardViewer": {
                    "description": "Whether the user has read-only dashboard view",
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdUsersUserId",
        "tags": [
          "Users"
        ],
        "summary": "Remove a user from the tenant",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/users/{userId}/login-token": {
      "post": {
        "operationId": "postTenantTenantIdUsersUserIdLoginToken",
        "tags": [
          "Users"
        ],
        "summary": "Mint a one-time login handoff token for a user",
        "description": "Returns a single-use token (60s TTL) bound to the user, tenant and organization, plus the `url` to send the user's browser to. Open the URL in the user's browser and they land in ProcessMind already authenticated: no email link, no impersonation; the user gets their own session. Requires the dedicated `sessions` scope on the API key: an **organization-scoped** key may mint for any tenant of its organization, a **tenant-scoped** key only for users of its own tenant. Treat the token as password-equivalent: it is returned once, never logged, and revoked by disabling the key or the user.",
        "x-required-key-type": "tenant-or-organization",
        "x-required-scope": "sessions",
        "x-rate-limit": {
          "rate": 2,
          "burst": 4
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Optional landing path (relative app path, e.g. \"app\" or \"app/dashboards\")",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 512
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Login handoff token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginToken"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/api-keys": {
      "get": {
        "operationId": "getTenantTenantIdApiKeys",
        "tags": [
          "API keys"
        ],
        "summary": "List the tenant's API keys",
        "description": "Requires an **organization-scoped** API key. The secret is never returned.",
        "x-required-key-type": "organization",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of API keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKey"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdApiKeys",
        "tags": [
          "API keys"
        ],
        "summary": "Create a tenant-scoped API key",
        "description": "Requires an **organization-scoped** write key. The secret is generated server-side and returned exactly once in the response; store it safely. Only its hash is kept.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "scope": {
                    "type": "object",
                    "properties": {
                      "read": {
                        "default": true,
                        "type": "boolean"
                      },
                      "write": {
                        "default": true,
                        "type": "boolean"
                      },
                      "uploadData": {
                        "default": true,
                        "type": "boolean"
                      },
                      "sessions": {
                        "default": false,
                        "type": "boolean"
                      }
                    },
                    "required": [],
                    "additionalProperties": false
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "expiresAt": {
                    "nullable": true,
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key created (includes the one-time secret)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/api-keys/{keyId}": {
      "put": {
        "operationId": "putTenantTenantIdApiKeysKeyId",
        "tags": [
          "API keys"
        ],
        "summary": "Update a tenant-scoped API key",
        "description": "Requires an **organization-scoped** write key. Scope fields are merged with the stored scope.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "scope": {
                    "type": "object",
                    "properties": {
                      "read": {
                        "type": "boolean"
                      },
                      "write": {
                        "type": "boolean"
                      },
                      "uploadData": {
                        "type": "boolean"
                      },
                      "sessions": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "expiresAt": {
                    "nullable": true,
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdApiKeysKeyId",
        "tags": [
          "API keys"
        ],
        "summary": "Delete a tenant-scoped API key",
        "description": "Requires an **organization-scoped** write key. The key is soft-deleted and stops authenticating immediately.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes": {
      "get": {
        "operationId": "getTenantTenantIdProcesses",
        "tags": [
          "Processes"
        ],
        "summary": "List processes",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of processes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Process"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdProcesses",
        "tags": [
          "Processes"
        ],
        "summary": "Create a process (with an empty model)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Process name shown in the process tree",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "treeParentId": {
                    "description": "Parent folder id (null = top level)",
                    "nullable": true,
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "treeNodeType": {
                    "default": "Process",
                    "description": "Process or TreeGroup (folder)",
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "Process"
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "TreeGroup"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created process",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Process"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessId",
        "tags": [
          "Processes"
        ],
        "summary": "Get a process",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Process",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Process"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdProcessesProcessId",
        "tags": [
          "Processes"
        ],
        "summary": "Update a process",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Process name shown in the process tree",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "treeParentId": {
                    "description": "Parent folder id (null = top level)",
                    "nullable": true,
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated process",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Process"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdProcessesProcessId",
        "tags": [
          "Processes"
        ],
        "summary": "Soft-delete a process",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Process deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/bpmn": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdBpmn",
        "tags": [
          "Processes"
        ],
        "summary": "Export the process model as BPMN 2.0 XML",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BPMN XML",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bpmn"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdProcessesProcessIdBpmn",
        "tags": [
          "Processes"
        ],
        "summary": "Import a BPMN 2.0 model for the process (replaces the current model)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Bpmn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "BPMN uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/generate-model": {
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdGenerateModel",
        "tags": [
          "Processes"
        ],
        "summary": "Generate a process model from a natural-language prompt (async; poll the status endpoint)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "x-rate-limit": {
          "rate": 2,
          "burst": 4
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generation started / result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/generate-model/status": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdGenerateModelStatus",
        "tags": [
          "Processes"
        ],
        "summary": "Poll model generation status",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generation status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/simulations": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdSimulations",
        "tags": [
          "Simulations"
        ],
        "summary": "List simulations for a process",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of simulations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Simulation"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdSimulations",
        "tags": [
          "Simulations"
        ],
        "summary": "Create a simulation (idempotent when an id is supplied)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "Optional id for idempotent retries (must be a UUID)",
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "displayName": {
                    "default": "New Simulation",
                    "description": "Simulation name",
                    "type": "string"
                  },
                  "datasetName": {
                    "description": "Name of the dataset the simulation runs on",
                    "nullable": true,
                    "type": "string"
                  },
                  "startTime": {
                    "description": "Simulation start time",
                    "nullable": true,
                    "type": "string",
                    "format": "date-time"
                  },
                  "endTime": {
                    "description": "Simulation end time",
                    "nullable": true,
                    "type": "string",
                    "format": "date-time"
                  },
                  "useWarmUp": {
                    "default": false,
                    "description": "Whether to discard the warm-up period",
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Simulation created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationActionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/simulations/{simulationId}": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdSimulationsSimulationId",
        "tags": [
          "Simulations"
        ],
        "summary": "Get a simulation with its element settings, attributes and resources",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Simulation details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationDetails"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdProcessesProcessIdSimulationsSimulationId",
        "tags": [
          "Simulations"
        ],
        "summary": "Update a simulation (fields and/or element settings)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Simulation name",
                    "type": "string"
                  },
                  "datasetName": {
                    "description": "Name of the dataset the simulation runs on",
                    "nullable": true,
                    "type": "string"
                  },
                  "startTime": {
                    "description": "Simulation start time",
                    "nullable": true,
                    "type": "string",
                    "format": "date-time"
                  },
                  "endTime": {
                    "description": "Simulation end time",
                    "nullable": true,
                    "type": "string",
                    "format": "date-time"
                  },
                  "useWarmUp": {
                    "description": "Whether to discard the warm-up period",
                    "type": "boolean"
                  },
                  "elementSettings": {
                    "description": "Per-element settings overrides",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "modelElementId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                        },
                        "settings": {
                          "type": "object",
                          "properties": {
                            "caseStartsDistribution": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "timeslot": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "Always"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "periodicity"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "Default"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "periodicity"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "FixedPeriod"
                                            ]
                                          },
                                          "startDateTime": {
                                            "type": "number"
                                          },
                                          "endDateTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startDateTime",
                                          "endDateTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachDay"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startTime",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachWeekDay"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startTime",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachWeekendDay"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startTime",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachWeek"
                                            ]
                                          },
                                          "startDay": {
                                            "type": "string",
                                            "enum": [
                                              "Sunday",
                                              "Monday",
                                              "Tuesday",
                                              "Wednesday",
                                              "Thursday",
                                              "Friday",
                                              "Saturday"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endDay": {
                                            "type": "string",
                                            "enum": [
                                              "Sunday",
                                              "Monday",
                                              "Tuesday",
                                              "Wednesday",
                                              "Thursday",
                                              "Friday",
                                              "Saturday"
                                            ]
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startDay",
                                          "startTime",
                                          "endDay",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachMonth"
                                            ]
                                          },
                                          "startDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startDayOfMonth",
                                          "startTime",
                                          "endDayOfMonth",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachYear"
                                            ]
                                          },
                                          "startMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 12
                                          },
                                          "startDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 12
                                          },
                                          "endDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startMonth",
                                          "startDayOfMonth",
                                          "startTime",
                                          "endMonth",
                                          "endDayOfMonth",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "conditions": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "Values"
                                              ]
                                            },
                                            "attribute": {
                                              "type": "string"
                                            },
                                            "values": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "attribute",
                                            "values"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "Range"
                                              ]
                                            },
                                            "attribute": {
                                              "type": "string"
                                            },
                                            "minValue": {
                                              "type": "number"
                                            },
                                            "maxValue": {
                                              "type": "number"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "attribute",
                                            "minValue",
                                            "maxValue"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "distribution": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Fixed"
                                            ]
                                          },
                                          "value": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Normal"
                                            ]
                                          },
                                          "mean": {
                                            "type": "number"
                                          },
                                          "stdDev": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "mean",
                                          "stdDev"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Uniform"
                                            ]
                                          },
                                          "min": {
                                            "type": "number"
                                          },
                                          "max": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "min",
                                          "max"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Poisson"
                                            ]
                                          },
                                          "lambda": {
                                            "type": "number"
                                          },
                                          "rateUnit": {
                                            "type": "string",
                                            "enum": [
                                              "perTimeSlot",
                                              "perHour",
                                              "perDay",
                                              "perWeek",
                                              "perMonth",
                                              "perYear"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "lambda",
                                          "rateUnit"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Triangular"
                                            ]
                                          },
                                          "min": {
                                            "type": "number"
                                          },
                                          "max": {
                                            "type": "number"
                                          },
                                          "mode": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "min",
                                          "max",
                                          "mode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Weibull"
                                            ]
                                          },
                                          "scale": {
                                            "type": "number"
                                          },
                                          "shape": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "scale",
                                          "shape"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Lognormal"
                                            ]
                                          },
                                          "mean": {
                                            "type": "number"
                                          },
                                          "stdDev": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "mean",
                                          "stdDev"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "PearsonVI"
                                            ]
                                          },
                                          "alpha1": {
                                            "type": "number"
                                          },
                                          "alpha2": {
                                            "type": "number"
                                          },
                                          "beta": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "alpha1",
                                          "alpha2",
                                          "beta"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Beta"
                                            ]
                                          },
                                          "min": {
                                            "type": "number"
                                          },
                                          "max": {
                                            "type": "number"
                                          },
                                          "alpha": {
                                            "type": "number"
                                          },
                                          "beta": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "min",
                                          "max",
                                          "alpha",
                                          "beta"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "timeUnit": {
                                    "type": "string",
                                    "enum": [
                                      "seconds",
                                      "minutes",
                                      "hours",
                                      "days"
                                    ]
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "timeslot",
                                  "distribution"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "processingTimeDistribution": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "timeslot": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "Always"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "periodicity"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "Default"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "periodicity"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "FixedPeriod"
                                            ]
                                          },
                                          "startDateTime": {
                                            "type": "number"
                                          },
                                          "endDateTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startDateTime",
                                          "endDateTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachDay"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startTime",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachWeekDay"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startTime",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachWeekendDay"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startTime",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachWeek"
                                            ]
                                          },
                                          "startDay": {
                                            "type": "string",
                                            "enum": [
                                              "Sunday",
                                              "Monday",
                                              "Tuesday",
                                              "Wednesday",
                                              "Thursday",
                                              "Friday",
                                              "Saturday"
                                            ]
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endDay": {
                                            "type": "string",
                                            "enum": [
                                              "Sunday",
                                              "Monday",
                                              "Tuesday",
                                              "Wednesday",
                                              "Thursday",
                                              "Friday",
                                              "Saturday"
                                            ]
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startDay",
                                          "startTime",
                                          "endDay",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachMonth"
                                            ]
                                          },
                                          "startDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startDayOfMonth",
                                          "startTime",
                                          "endDayOfMonth",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "periodicity": {
                                            "type": "string",
                                            "enum": [
                                              "EachYear"
                                            ]
                                          },
                                          "startMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 12
                                          },
                                          "startDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "startTime": {
                                            "type": "number"
                                          },
                                          "endMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 12
                                          },
                                          "endDayOfMonth": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 31
                                          },
                                          "endTime": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "periodicity",
                                          "startMonth",
                                          "startDayOfMonth",
                                          "startTime",
                                          "endMonth",
                                          "endDayOfMonth",
                                          "endTime"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "conditions": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "Values"
                                              ]
                                            },
                                            "attribute": {
                                              "type": "string"
                                            },
                                            "values": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "attribute",
                                            "values"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "Range"
                                              ]
                                            },
                                            "attribute": {
                                              "type": "string"
                                            },
                                            "minValue": {
                                              "type": "number"
                                            },
                                            "maxValue": {
                                              "type": "number"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "attribute",
                                            "minValue",
                                            "maxValue"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "distribution": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Fixed"
                                            ]
                                          },
                                          "value": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Normal"
                                            ]
                                          },
                                          "mean": {
                                            "type": "number"
                                          },
                                          "stdDev": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "mean",
                                          "stdDev"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Uniform"
                                            ]
                                          },
                                          "min": {
                                            "type": "number"
                                          },
                                          "max": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "min",
                                          "max"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Poisson"
                                            ]
                                          },
                                          "lambda": {
                                            "type": "number"
                                          },
                                          "rateUnit": {
                                            "type": "string",
                                            "enum": [
                                              "perTimeSlot",
                                              "perHour",
                                              "perDay",
                                              "perWeek",
                                              "perMonth",
                                              "perYear"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "lambda",
                                          "rateUnit"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Triangular"
                                            ]
                                          },
                                          "min": {
                                            "type": "number"
                                          },
                                          "max": {
                                            "type": "number"
                                          },
                                          "mode": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "min",
                                          "max",
                                          "mode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Weibull"
                                            ]
                                          },
                                          "scale": {
                                            "type": "number"
                                          },
                                          "shape": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "scale",
                                          "shape"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Lognormal"
                                            ]
                                          },
                                          "mean": {
                                            "type": "number"
                                          },
                                          "stdDev": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "mean",
                                          "stdDev"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "PearsonVI"
                                            ]
                                          },
                                          "alpha1": {
                                            "type": "number"
                                          },
                                          "alpha2": {
                                            "type": "number"
                                          },
                                          "beta": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "alpha1",
                                          "alpha2",
                                          "beta"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "Beta"
                                            ]
                                          },
                                          "min": {
                                            "type": "number"
                                          },
                                          "max": {
                                            "type": "number"
                                          },
                                          "alpha": {
                                            "type": "number"
                                          },
                                          "beta": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "min",
                                          "max",
                                          "alpha",
                                          "beta"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "timeUnit": {
                                    "type": "string",
                                    "enum": [
                                      "seconds",
                                      "minutes",
                                      "hours",
                                      "days"
                                    ]
                                  },
                                  "rateUnit": {
                                    "type": "string",
                                    "enum": [
                                      "perTimeSlot",
                                      "perHour",
                                      "perDay",
                                      "perWeek",
                                      "perMonth",
                                      "perYear"
                                    ]
                                  }
                                },
                                "required": [
                                  "timeslot",
                                  "distribution"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "modelElementId"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Simulation updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdProcessesProcessIdSimulationsSimulationId",
        "tags": [
          "Simulations"
        ],
        "summary": "Hard-delete a simulation",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Simulation deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/simulations/{simulationId}/generate-settings": {
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdSimulationsSimulationIdGenerateSettings",
        "tags": [
          "Simulations"
        ],
        "summary": "Generate simulation settings via AI (async; poll the status endpoint)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "x-rate-limit": {
          "rate": 2,
          "burst": 4
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "processDescription": {
                    "type": "string"
                  },
                  "additionalContext": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generation started / result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/simulations/{simulationId}/generate-settings/status": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdSimulationsSimulationIdGenerateSettingsStatus",
        "tags": [
          "Simulations"
        ],
        "summary": "Poll simulation settings generation status",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generation status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/simulations/{simulationId}/run": {
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdSimulationsSimulationIdRun",
        "tags": [
          "Simulations"
        ],
        "summary": "Start a simulation run (async; results land in the process datatables)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "x-rate-limit": {
          "rate": 5,
          "burst": 10
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Simulation started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/simulations/{simulationId}/run/status": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdSimulationsSimulationIdRunStatus",
        "tags": [
          "Simulations"
        ],
        "summary": "Get the status of the last simulation run (derived from the output datatable)",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "simulationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationRunStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/mappings": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdMappings",
        "tags": [
          "Mappings"
        ],
        "summary": "List data mappings for a process",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of mappings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mapping"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdMappings",
        "tags": [
          "Mappings"
        ],
        "summary": "Map a datatable to the process (starts processing the event log)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dataTableId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                    "description": "Datatable to map to the process"
                  },
                  "displayName": {
                    "description": "Mapping display name",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "color": {
                    "description": "Accent color",
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "id": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "data-1",
                              "data-2",
                              "data-3",
                              "data-4",
                              "data-5",
                              "data-6",
                              "data-7",
                              "data-8",
                              "data-9",
                              "data-10",
                              "data-11"
                            ]
                          },
                          {}
                        ]
                      }
                    },
                    "required": [
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  "showByDefault": {
                    "default": true,
                    "description": "Show this mapping by default in the process view",
                    "type": "boolean"
                  },
                  "mappingRole": {
                    "description": "Role of the mapped data in the model",
                    "type": "string",
                    "enum": [
                      "primary",
                      "comparison"
                    ]
                  }
                },
                "required": [
                  "dataTableId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Mapping created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mapping"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/mappings/{mappingId}": {
      "put": {
        "operationId": "putTenantTenantIdProcessesProcessIdMappingsMappingId",
        "tags": [
          "Mappings"
        ],
        "summary": "Update a mapping",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "mappingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "color": {
                    "nullable": true,
                    "type": "object",
                    "properties": {
                      "id": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "data-1",
                              "data-2",
                              "data-3",
                              "data-4",
                              "data-5",
                              "data-6",
                              "data-7",
                              "data-8",
                              "data-9",
                              "data-10",
                              "data-11"
                            ]
                          },
                          {}
                        ]
                      }
                    },
                    "required": [
                      "id"
                    ],
                    "additionalProperties": false
                  },
                  "showByDefault": {
                    "type": "boolean"
                  },
                  "mappingRole": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "comparison"
                    ]
                  },
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated mapping",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mapping"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdProcessesProcessIdMappingsMappingId",
        "tags": [
          "Mappings"
        ],
        "summary": "Delete a mapping",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "mappingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mapping deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/versions": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdVersions",
        "tags": [
          "Versions"
        ],
        "summary": "List process versions",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of versions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Version"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdVersions",
        "tags": [
          "Versions"
        ],
        "summary": "Create a version snapshot of the process",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "default": "",
                    "description": "Version label",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "description": {
                    "description": "Optional description of the version",
                    "type": "string"
                  },
                  "versionType": {
                    "description": "manual = user-created, auto = created by the system",
                    "type": "string",
                    "enum": [
                      "manual",
                      "auto"
                    ]
                  },
                  "restoreFromVersionId": {
                    "description": "Version to restore from when creating this snapshot",
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Version created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionCreated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/versions/{versionId}": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdVersionsVersionId",
        "tags": [
          "Versions"
        ],
        "summary": "Get a process version",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdProcessesProcessIdVersionsVersionId",
        "tags": [
          "Versions"
        ],
        "summary": "Rename or update a process version",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Version label",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "description": {
                    "description": "Optional description of the version",
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdProcessesProcessIdVersionsVersionId",
        "tags": [
          "Versions"
        ],
        "summary": "Delete a process version",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Version deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/artifacts": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdArtifacts",
        "tags": [
          "Artifacts"
        ],
        "summary": "List artifacts attached to a process",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of process artifacts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProcessArtifact"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/artifacts/uploads/presigned-url": {
      "post": {
        "operationId": "postTenantTenantIdProcessesProcessIdArtifactsUploadsPresignedUrl",
        "tags": [
          "Artifacts"
        ],
        "summary": "Get a presigned S3 upload URL for a new process artifact",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileName",
                  "mimeType",
                  "sizeBytes"
                ],
                "properties": {
                  "fileName": {
                    "type": "string"
                  },
                  "mimeType": {
                    "type": "string"
                  },
                  "sizeBytes": {
                    "type": "number"
                  },
                  "artifactType": {
                    "type": "string",
                    "enum": [
                      "modelIcon",
                      "processArtifact",
                      "doc",
                      "levelFrontPageImage"
                    ],
                    "default": "processArtifact"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Presigned upload URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactPresignedUpload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/processes/{processId}/data/case-features": {
      "get": {
        "operationId": "getTenantTenantIdProcessesProcessIdDataCaseFeatures",
        "tags": [
          "Processes"
        ],
        "summary": "Get per-case metrics of a process (latest model, paged)",
        "description": "Returns one row per case with the computed process metrics (case duration, length, conformance, rework, health score, variant, and more) for the process's latest model. No row filtering is applied. The result is paged: use `limit` (default 1000, max 10000) and `offset`, and keep paging while `hasMore` is true. While the metrics are still being computed, the response has state `preprocessing`.",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of case rows to return (default 1000, max 10000)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1000
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of case rows to skip (default 0)",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Case metrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessCaseFeatures"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/artifacts/{artifactId}": {
      "get": {
        "operationId": "getTenantTenantIdArtifactsArtifactId",
        "tags": [
          "Artifacts"
        ],
        "summary": "Get an artifact",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artifact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Artifact"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdArtifactsArtifactId",
        "tags": [
          "Artifacts"
        ],
        "summary": "Update an artifact's display name or description",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Artifact name",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 500
                  },
                  "description": {
                    "description": "Optional description of the artifact",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 2000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated artifact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Artifact"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdArtifactsArtifactId",
        "tags": [
          "Artifacts"
        ],
        "summary": "Delete an artifact",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artifact deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/artifacts/{artifactId}/open": {
      "get": {
        "operationId": "getTenantTenantIdArtifactsArtifactIdOpen",
        "tags": [
          "Artifacts"
        ],
        "summary": "Redirect to a presigned URL to download the artifact",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to presigned download URL"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datasets": {
      "get": {
        "operationId": "getTenantTenantIdDatasets",
        "tags": [
          "Datasets"
        ],
        "summary": "List datasets",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of datasets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Dataset"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdDatasets",
        "tags": [
          "Datasets"
        ],
        "summary": "Create a dataset (with an empty datatable)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Dataset name shown in the data tree",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "treeParentId": {
                    "description": "Parent folder id (null = top level)",
                    "nullable": true,
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "treeNodeType": {
                    "default": "Dataset",
                    "description": "Dataset or folder",
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "Dataset"
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "TreeGroup"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datasets/{datasetId}": {
      "get": {
        "operationId": "getTenantTenantIdDatasetsDatasetId",
        "tags": [
          "Datasets"
        ],
        "summary": "Get a dataset",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dataset"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdDatasetsDatasetId",
        "tags": [
          "Datasets"
        ],
        "summary": "Soft-delete a dataset",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dataset deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datasets/{datasetId}/datatables": {
      "post": {
        "operationId": "postTenantTenantIdDatasetsDatasetIdDatatables",
        "tags": [
          "Datasets"
        ],
        "summary": "Create an empty datatable inside a dataset",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Datatable name",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  }
                },
                "required": [
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created datatable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataTable"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "get": {
        "operationId": "getTenantTenantIdDatasetsDatasetIdDatatables",
        "tags": [
          "Datasets"
        ],
        "summary": "List the datatables of a dataset",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of datatables in the dataset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataTable"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables": {
      "get": {
        "operationId": "getTenantTenantIdDatatables",
        "tags": [
          "Datatables"
        ],
        "summary": "List datatables",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of datatables",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataTable"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}": {
      "get": {
        "operationId": "getTenantTenantIdDatatablesDataTableId",
        "tags": [
          "Datatables"
        ],
        "summary": "Get a datatable",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Datatable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataTable"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdDatatablesDataTableId",
        "tags": [
          "Datatables"
        ],
        "summary": "Update a datatable (displayName, parseSettings, ...)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Datatable name",
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "filterExpression": {
                    "description": "Filter expression applied to the data",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 4096
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated datatable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataTable"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}/uploads/presigned-url": {
      "get": {
        "operationId": "getTenantTenantIdDatatablesDataTableIdUploadsPresignedUrl",
        "tags": [
          "Datatables"
        ],
        "summary": "Get a presigned S3 upload URL for event log data (CSV/XLSX, full or delta)",
        "description": "Requires the `uploadData` scope on the API key (independent of read/write). The declared `filesize` (bytes) is checked against the platform's maximum upload size; the actual object size is re-verified when the file lands.",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "filename",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filesize",
            "in": "query",
            "required": true,
            "description": "File size in bytes (checked against the platform's maximum upload size)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filelastmodified",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "datasetid",
            "in": "query",
            "required": false,
            "description": "Required for full (non-delta) uploads",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "delta",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "partnumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "validforseconds",
            "in": "query",
            "required": false,
            "description": "Presigned URL lifetime in seconds (1–3600, default 3600)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3600
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Presigned URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreSignedUpload"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}/uploads/multipart/initiate": {
      "post": {
        "operationId": "postTenantTenantIdDatatablesDataTableIdUploadsMultipartInitiate",
        "tags": [
          "Datatables"
        ],
        "summary": "Start a multipart (chunked) upload for event log data (step 1 of 3)",
        "description": "Requires the `uploadData` scope on the API key. Returns an `uploadId` and an opaque `uploadHandle` to pass to the subsequent `parts`, `complete` and `abort` calls. Suitable for large files.",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileName",
                  "fileSize",
                  "fileLastModified"
                ],
                "properties": {
                  "fileName": {
                    "type": "string"
                  },
                  "fileSize": {
                    "type": "number"
                  },
                  "fileLastModified": {
                    "type": "number"
                  },
                  "partCount": {
                    "type": "number",
                    "description": "Number of parts to presign (default 10)"
                  },
                  "delta": {
                    "type": "boolean",
                    "description": "Whether this is a delta (incremental) upload"
                  },
                  "datasetId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "modelId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Initiated upload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uploadId": {
                      "type": "string"
                    },
                    "uploadHandle": {
                      "type": "string",
                      "description": "Opaque handle for the parts/complete/abort steps"
                    },
                    "partCount": {
                      "type": "number"
                    },
                    "partSizeBytes": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}/uploads/multipart/parts": {
      "post": {
        "operationId": "postTenantTenantIdDatatablesDataTableIdUploadsMultipartParts",
        "tags": [
          "Datatables"
        ],
        "summary": "Get presigned URLs for the parts of a multipart upload (step 2 of 3)",
        "description": "Requires the `uploadData` scope on the API key. Returns one presigned PUT URL per requested part number.",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uploadId",
                  "uploadHandle",
                  "partNumbers"
                ],
                "properties": {
                  "uploadId": {
                    "type": "string"
                  },
                  "uploadHandle": {
                    "type": "string",
                    "description": "Opaque handle returned by the initiate step"
                  },
                  "partNumbers": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Part presigned URLs ({ uploadId, parts: [{ partNumber, url }] })",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}/uploads/multipart/complete": {
      "post": {
        "operationId": "postTenantTenantIdDatatablesDataTableIdUploadsMultipartComplete",
        "tags": [
          "Datatables"
        ],
        "summary": "Complete a multipart upload (step 3 of 3)",
        "description": "Requires the `uploadData` scope on the API key. Assembles the uploaded parts (using their ETags) and triggers event log processing.",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uploadId",
                  "uploadHandle",
                  "parts"
                ],
                "properties": {
                  "uploadId": {
                    "type": "string"
                  },
                  "uploadHandle": {
                    "type": "string",
                    "description": "Opaque handle returned by the initiate step"
                  },
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "partNumber",
                        "eTag"
                      ],
                      "properties": {
                        "partNumber": {
                          "type": "number"
                        },
                        "eTag": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed ({ completed: true })",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}/uploads/multipart/abort": {
      "post": {
        "operationId": "postTenantTenantIdDatatablesDataTableIdUploadsMultipartAbort",
        "tags": [
          "Datatables"
        ],
        "summary": "Abort a multipart upload and discard the uploaded parts",
        "description": "Requires the `uploadData` scope on the API key.",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uploadId",
                  "uploadHandle"
                ],
                "properties": {
                  "uploadId": {
                    "type": "string"
                  },
                  "uploadHandle": {
                    "type": "string",
                    "description": "Opaque handle returned by the initiate step"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Aborted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/datatables/{dataTableId}/download": {
      "get": {
        "operationId": "getTenantTenantIdDatatablesDataTableIdDownload",
        "tags": [
          "Datatables"
        ],
        "summary": "Get a presigned URL to download the datatable's source file",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dataTableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Download URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Download"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/search": {
      "post": {
        "operationId": "postTenantTenantIdSearch",
        "tags": [
          "Search"
        ],
        "summary": "Global search across the tenant's roles, processes, elements, documentation, versions and comments",
        "description": "Rate-limited per tenant; a 429 response carries the shared message body ({\"message\": \"Too many search requests, please slow down.\"}).",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "description": "Search query",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "mode": {
                    "default": "hybrid",
                    "description": "semantic = embeddings, exact = literal, hybrid = both",
                    "type": "string",
                    "enum": [
                      "semantic",
                      "exact",
                      "hybrid"
                    ]
                  },
                  "categories": {
                    "description": "Restrict results to these categories",
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "role",
                        "process",
                        "element",
                        "documentation",
                        "version",
                        "comment"
                      ]
                    }
                  },
                  "processId": {
                    "description": "Restrict results to a single process",
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "k": {
                    "default": 20,
                    "description": "Number of results to return",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50
                  }
                },
                "required": [
                  "query"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search results (hits, counts, total, suggestions)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/ai/{promptType}": {
      "post": {
        "operationId": "postTenantTenantIdAiPromptType",
        "tags": [
          "AI"
        ],
        "summary": "Start a direct AI prompt (async; poll POST .../ai/{promptType}/status with the same body)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "promptType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "processAnalysis",
                "processQuestion",
                "aiSummary",
                "processDocumentation",
                "processRaci",
                "processMetaEdit"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiPromptBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI result (status: success | generating | error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiPromptResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Usage limit reached"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/ai/{promptType}/status": {
      "post": {
        "operationId": "postTenantTenantIdAiPromptTypeStatus",
        "tags": [
          "AI"
        ],
        "summary": "Poll an in-flight AI generation (send the exact same body as the POST that started it)",
        "description": "POST-to-poll is deliberate: the generation is keyed by prompt + promptType + summaryVariant, so the poll repeats the body instead of addressing a run id.",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "promptType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "processAnalysis",
                "processQuestion",
                "aiSummary",
                "processDocumentation",
                "processRaci",
                "processMetaEdit"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiPromptBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI result (status: success | generating | error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiPromptResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "Usage limit reached"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/webhooks": {
      "get": {
        "operationId": "getTenantTenantIdWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "List outbound webhooks",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Webhook"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "Create an outbound webhook (returns the signing secret once)",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Public https endpoint that receives signed POST deliveries (no private/loopback addresses)"
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "process.created",
                        "process.updated",
                        "process.deleted",
                        "mapping.created",
                        "data.ready",
                        "simulation.completed",
                        "webhook.test"
                      ]
                    },
                    "description": "Events that trigger a delivery to this webhook"
                  },
                  "description": {
                    "description": "Optional description",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 500
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created webhook (includes the signing secret)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/webhooks/{webhookId}": {
      "get": {
        "operationId": "getTenantTenantIdWebhooksWebhookId",
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a single outbound webhook",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "operationId": "putTenantTenantIdWebhooksWebhookId",
        "tags": [
          "Webhooks"
        ],
        "summary": "Update an outbound webhook",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "Public https endpoint that receives signed POST deliveries",
                    "type": "string"
                  },
                  "events": {
                    "description": "Events that trigger a delivery to this webhook",
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "process.created",
                        "process.updated",
                        "process.deleted",
                        "mapping.created",
                        "data.ready",
                        "simulation.completed",
                        "webhook.test"
                      ]
                    }
                  },
                  "description": {
                    "description": "Optional description",
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 500
                  },
                  "isActive": {
                    "description": "Whether the webhook is enabled",
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated webhook",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdWebhooksWebhookId",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete an outbound webhook",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/webhooks/{webhookId}/test": {
      "post": {
        "operationId": "postTenantTenantIdWebhooksWebhookIdTest",
        "tags": [
          "Webhooks"
        ],
        "summary": "Trigger a test delivery to the webhook",
        "x-required-key-type": "tenant",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test delivery triggered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization": {
      "get": {
        "operationId": "getTenantTenantIdOrganization",
        "tags": [
          "Organization"
        ],
        "summary": "Get the organization for the tenant",
        "description": "Readable with a tenant-scoped API key; an organization-scoped key is accepted as well.",
        "x-required-key-type": "tenant-or-organization",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/statistics": {
      "get": {
        "operationId": "getTenantTenantIdOrganizationStatistics",
        "tags": [
          "Organization"
        ],
        "summary": "Get organization-wide statistics",
        "description": "The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationStatistics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/tenants": {
      "get": {
        "operationId": "getTenantTenantIdOrganizationTenants",
        "tags": [
          "Organization"
        ],
        "summary": "List all tenants in the organization",
        "description": "The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Tenant"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "postTenantTenantIdOrganizationTenants",
        "tags": [
          "Organization"
        ],
        "summary": "Create a new tenant in the organization (requires an organization-scoped API key)",
        "description": "The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 128
                  },
                  "shortName": {
                    "nullable": true,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 30,
                        "pattern": "^[\\da-z]([\\da-z-]{0,28}[\\da-z])?$"
                      },
                      {
                        "type": "string",
                        "maxLength": 0
                      }
                    ]
                  },
                  "description": {
                    "nullable": true,
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 200
                  },
                  "timezone": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 64
                  },
                  "tenantType": {
                    "type": "string",
                    "enum": [
                      "normal",
                      "sandbox",
                      "demo"
                    ]
                  }
                },
                "required": [
                  "shortName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Tenant created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "406": {
            "$ref": "#/components/responses/NotAcceptable"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/tenants/{targetId}": {
      "delete": {
        "operationId": "deleteTenantTenantIdOrganizationTenantsTargetId",
        "tags": [
          "Organization"
        ],
        "summary": "Soft-delete a tenant in the organization (requires an organization-scoped API key)",
        "description": "API access for the tenant stops immediately. The tenant and its data are kept during the deletion-safety window and are removed by the automated full delete afterwards. The tenant you are currently using (the context tenant) cannot be deleted.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/tenants/{targetId}/restore": {
      "post": {
        "operationId": "postTenantTenantIdOrganizationTenantsTargetIdRestore",
        "tags": [
          "Organization"
        ],
        "summary": "Restore a soft-deleted tenant in the organization (requires an organization-scoped API key)",
        "description": "Undo a soft delete inside the deletion-safety window: the tenant and its data come back exactly as they were and API access resumes. The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/users": {
      "get": {
        "operationId": "getTenantTenantIdOrganizationUsers",
        "tags": [
          "Organization"
        ],
        "summary": "List all users in the organization",
        "description": "The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "List of organization users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationUser"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/users/{userId}": {
      "put": {
        "operationId": "putTenantTenantIdOrganizationUsersUserId",
        "tags": [
          "Organization"
        ],
        "summary": "Update an organization user's settings (requires an organization-scoped API key)",
        "description": "Role flags in the body (isAdminInOrganization, isActiveInOrganization) are honored verbatim; only issue organization-scoped keys to organization admins. The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isActiveInOrganization": {
                    "description": "Whether the user is active in the organization",
                    "type": "boolean"
                  },
                  "isAdminInOrganization": {
                    "description": "Organization admin rights (honored verbatim: only issue organization-scoped keys to org admins)",
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "deleteTenantTenantIdOrganizationUsersUserId",
        "tags": [
          "Organization"
        ],
        "summary": "Remove a user from the organization (requires an organization-scoped API key)",
        "description": "The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "organization",
        "x-required-scope": "write",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/tenant/{tenantId}/organization/billing/seats": {
      "get": {
        "operationId": "getTenantTenantIdOrganizationBillingSeats",
        "tags": [
          "Organization"
        ],
        "summary": "Get the organization's seat capacity and auto-sync policy",
        "description": "Returns the org-wide purchased vs in-use seats per rung (Process Foundation, Process Architecture, Process Intelligence), the free-viewer allowance, the auto-sync target, the seat-drift explainer (what the engine will do and when), the billing interval and the externalApiSeatPolicy. Readable with a tenant-scoped API key. The {tenantId} path parameter is the context tenant (the organization of the organization-scoped key), not the target of the operation.",
        "x-required-key-type": "tenant-or-organization",
        "x-required-scope": "read",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Seat capacity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeatAvailability"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/mcp/{tenantId}": {
      "post": {
        "operationId": "postMcpTenantId",
        "tags": [
          "MCP"
        ],
        "summary": "Model Context Protocol server endpoint (JSON-RPC over Streamable HTTP)",
        "description": "JSON-RPC 2.0 over Streamable HTTP: `initialize`, `tools/list`, `tools/call`, `resources/list`, `resources/read`, `prompts/list`. Read tools require the key's `read` scope, write tools the `write` scope. The tool catalogue is documented in the MCP guide. Authenticate with `x-api-key` or `Authorization: Bearer <token>` (token from the OAuth token endpoint).",
        "x-required-key-type": "tenant",
        "x-required-scope": "read",
        "x-rate-limit": {
          "rate": 20,
          "burst": 40
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "MCP JSON-RPC request",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/mcp/{tenantId}/oauth/token": {
      "post": {
        "operationId": "postMcpTenantIdOauthToken",
        "tags": [
          "MCP"
        ],
        "summary": "OAuth 2.0 token endpoint (client_credentials or authorization_code + PKCE)",
        "x-required-key-type": "none",
        "x-required-scope": "none",
        "x-rate-limit": {
          "rate": 5,
          "burst": 10
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id",
                  "client_secret"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "client_credentials",
                      "authorization_code"
                    ]
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthToken"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": []
      }
    },
    "/v1/mcp/{tenantId}/oauth/authorize": {
      "get": {
        "operationId": "getMcpTenantIdOauthAuthorize",
        "tags": [
          "MCP"
        ],
        "summary": "OAuth 2.1 authorization endpoint (PKCE), 302-redirects back to redirect_uri with ?code=...",
        "x-required-key-type": "none",
        "x-required-scope": "none",
        "x-rate-limit": {
          "rate": 10,
          "burst": 20
        },
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to redirect_uri with code + state"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": []
      }
    }
  }
}