{
  "openapi": "3.0.0",
  "info": {
    "title": "Rules Engine service",
    "version": "1.10.02.02",
    "license": {}
  },
  "paths": {
    "/servicekeys": {
      "get": {
        "summary": "Get service keys (Not Implemented)",
        "description": "This endpoint returns available service keys.\nThe license you are using must be of authLevel 'system'\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n\n|              **Returns**                     |\n|----------------------------------------------|\n\nReturns array with service keys\n",
        "tags": [
          "Service Key"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key encrypted with ECDSA / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceKeysResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "501": {
            "description": "Service Not Implemented"
          }
        }
      }
    },
    "/servicekey/{keyId}": {
      "delete": {
        "summary": "Reset Service Key (Not Implemented)",
        "description": "This endpoint resets service key for given keyId. Deletes current one and recreates a new one.\nThe license you are using must be of authLevel 'system'\n\n|              **Parameters**                  |\n|----------------------------------------------|\n\n### keyId (required)\nThe keyId of service key to reset\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key encrypted with ECDSA\n\n### requestid (required)\nJSON string encrypted with ECDSA which should contain \"appid\" (string), \"uuid\" (string) and \"ts\" (number) representing epoch timestamp in seconds - it shouldn't be more or less than 'environment.allowed_time_span' seconds from now\n\n### publickey (required)\nPublic key\n\n|              **Returns**                     |\n|----------------------------------------------|\n\nReturns re-created service key\n",
        "tags": [
          "Service Key"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "description": "keyId of service key to reset",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key encrypted with ECDSA / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceKeysResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "501": {
            "description": "Service Not Implemented"
          }
        }
      }
    },
    "/sd": {
      "get": {
        "summary": "Get all service directories.",
        "description": "Get all service directories.\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns all service directories.\n",
        "tags": [
          "Service Directory"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetServiceComponentsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/rule": {
      "put": {
        "summary": "Create Rule",
        "description": "Create rule. <br />\n- valid community license with authlevel system, service, service_ext\n- key must be authorized for community\n- creates a new rule\n- returns created rule\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Request Body**                  |\n|----------------------------------------------|\n\n\n### name (required)\nName of rule. <br />\n\n### category (required)\nCategory of rule. <br />\n### tags (required)\nTags of rule.<br />\n### description (required)\nDescription of rule.<br />\n### enabled (required)\nStatus of rule (true or false). <br />\n\n### createdBy (required)\nUrn of person that created the rule. <br />\n### criteria (required)\nCriteria for rule (any, all). <br />\n\n### conditions (required)\nList of conditions for the rule. <br />\n### onMatch (required)\nonMatch data of rule with decision and parameters. <br />\n### onNoMatch (required)\nonNoMatch data of rule with decision and parameters. <br />\n\n### defaultDecision (required)\nDefault decision of rule with decision and parameters\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the created rule. <br />\nThis API throws an error if something goes wrong<br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": {
          "description": "Request body contains below fields to create rules.\n\n```\n{\n    \"name\": \"string required\",\n    \"category\": \"string required\",\n    \"tags\": [\n       \"string required\"\n     ],\n    \"description\": \"string optional\",\n    \"enabled\": \"boolean required\",\n    \"createdBy\": \"string required\",\n    \"criteria\": \"string required - any or all\",\n    \"conditions\": [\n       {\n          \"factName\": \"string required\",\n          \"valueType\": \"string required - STRING, NUMBER, IP, CIDR (192.98.70.00/20), ARRAY, GEODISTANCE\",\n          \"value\": \" 'string' | 10 | '192.98.70.00' | '192.98.70.00/20' | '192.98.70.00-192.98.70.12' | ['some string'] | [] required\",\n          \"operator\": \"string required [eq, neq, gt, lt, in, nin, overlap, nooverlap, isempty]\"\n       }\n    ],\n    \"onMatch\": {\n       \"decision\": \"string required\",\n       \"params\": {}\n    },\n    \"onNoMatch\": {\n       \"decision\": \"string required\",\n       \"params\": {}\n    },\n    \"defaultDecision\": {\n       \"decision\": \"string required\",\n       \"params\": {}\n    }\n}\n\nFor valueType STRING operators [eq, neq, startswith, notstartswith, endswith, notendswith, contains, notcontains] are valid\nFor valueType NUMBER operators [eq, neq, gt, lt] are valid\nFor valueType IP operators [eq, neq, in, nin] are valid\nFor valueType CIDR operators [eq, neq] are valid\nFor valueType ARRAY (String arrays is supported) operators [in, nin, overlap, nooverlap, isempty, startswith, notstartswith, endswith, notendswith, contains, notcontains] are valid\nFor valueType GEODISTANCE operators [gt, lt] are valid\nFor IP/CIDR please follow below examples:\n\n{\n  \"factName\": \"SingleIP\",\n  \"valueType\": \"IP\",\n  \"value\": \"192.98.70.00\",\n  \"operator\": \"eq/neq\"\n}\n{\n  \"factName\": \"cidr_range\",\n  \"valueType\": \"CIDR\",\n  \"value\": \"192.98.70.00/20\",\n  \"operator\": \"eq/neq\"\n}\n{\n  \"factName\": \"ip_range\",\n  \"valueType\": \"IP\",\n  \"value\": \"192.98.70.00-192.98.70.12\",\n  \"operator\": \"eq,neq\"\n}\n{\n  \"factName\": \"ip_cidr_array\",\n  \"valueType\": \"IP\",\n  \"value\": [\"192.98.70.00-192.98.70.12\", \"192.98.70.00/10\", \"192.98.70.00\", \"192.98.70.12\"],\n  \"operator\": \"in/nin\"\n}\n\nFor Array:\n\n{\n  \"factName\": \"factStartsWithArrayElement\",\n  \"valueType\": \"ARRAY\",\n  \"value\": [\"da\", \"sa\"],\n  \"operator\": \"startsWith\"\n}\n{\n  \"factName\": \"factEndsWithArrayElement\",\n  \"valueType\": \"ARRAY\",\n  \"value\": [\"ir\", \"sa\"],\n  \"operator\": \"endsWith\"\n}\n{\n  \"factName\": \"factcontainsArrayElement\",\n  \"valueType\": \"ARRAY\",\n  \"value\": [\"le\", \"ac\"],\n  \"operator\": \"contains\"\n}\n\nfact : { \"factStartsWithArrayElement\" : \"darshan\",  \"factEndsWithArrayElement\" : \"samir\", factcontainsArrayElement: \"jack\"} | matched\n\nFor GEODISTANCE\n{\n  \"factName\": \"mobile_user_distance || browser_user_distance || mobile_browser_distance\",\n  \"valueType\": \"GEODISTANCE\",\n  \"value\": 100 //this is expected in meters,\n  \"operator\": \"gt/lt\"\n}\n\nfacts : {\"browserLocation\" : { \"lat\" : 37.7749, \"lon\" : -122.4194 } , \"mobileLocation\" : { \"lat\" : 37.7749, \"lon\" : -122.4194 }}\n\n```\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success\n\nCreated rule object,\n\n```\n{\n  \"name\": \"xxxxxxxxxxx\"\n  \"category\": \"xxxxxxxxxx\",\n  \"tags\": [\n     \"xxxxxxx\",\n     \"xxxxxxxxxx\"\n   ],\n  \"description\": \"xxxxxxxxxx\",\n  \"enabled\": \"true\",\n  \"createdBy\": \"xxxxxxxx\",\n  \"criteria\": \"any\",\n  \"conditions\": [\n     {\n        \"factName\": \"xxxxxxxxxxxx\",\n        \"valueType\": \"xxxxxxxxxxxxx\",\n        \"value\": \"xxxxxxxxxxxxxxxxxx\",\n        \"operator\": \"xxxxxxxxxxxxxxxxxxx\"\n     }\n  ],\n  \"onMatch\": {\n     \"decision\": \"xxxxxxxxxxxxxx\",\n     \"params\": {}\n  },\n  \"onNoMatch\": {\n     \"decision\": \"xxxxxxxxxxxxxxxx\",\n     \"params\": {}\n  },\n  \"defaultDecision\": {\n     \"decision\": \"xxxxxxxxxxxxxxxxxxxxxxx\",\n     \"params\": {}\n  }\n}\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/rules": {
      "put": {
        "summary": "Create Rules in batch",
        "description": "Create rules in batch. <br />\n- valid community license with authlevel system, service, service_ext\n- key must be authorized for community\n- creates a new rules in given array\n- returns created rules\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Request Body**                  |\n|----------------------------------------------|\n\n\n### name (required)\nName of rule. <br />\n\n### category (required)\nCategory of rule. <br />\n### tags (required)\nTags of rule.<br />\n### description (required)\nDescription of rule.<br />\n### enabled (required)\nStatus of rule (true or false). <br />\n\n### createdBy (required)\nUrn of person that created the rule. <br />\n### criteria (required)\nCriteria for rule (any, all). <br />\n\n### conditions (required)\nList of conditions for the rule. <br />\n### onMatch (required)\nonMatch data of rule with decision and parameters. <br />\n### onNoMatch (required)\nonNoMatch data of rule with decision and parameters. <br />\n\n### defaultDecision (required)\nDefault decision of rule with decision and parameters\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the created rule. <br />\nThis API throws an error if something goes wrong<br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": {
          "description": "Request body contains below fields to create rules.\n\n```\n[{\n    \"name\": \"string required\",\n    \"category\": \"string required\",\n    \"tags\": [\n       \"string required\"\n     ],\n    \"description\": \"string optional\",\n    \"enabled\": \"boolean required\",\n    \"createdBy\": \"string required\",\n    \"criteria\": \"string required - any or all\",\n    \"conditions\": [\n       {\n          \"factName\": \"string required\",\n          \"valueType\": \"string required - STRING, NUMBER, IP, CIDR (192.98.70.00/20), ARRAY, GEODISTANCE\",\n          \"value\": \" 'string' | 10 | '192.98.70.00' | '192.98.70.00/20' | '192.98.70.00-192.98.70.12' | ['some string'] | [] required\",\n          \"operator\": \"string required [eq, neq, gt, lt, in, nin, overlap, nooverlap, isempty]\"\n       }\n    ],\n    \"onMatch\": {\n       \"decision\": \"string required\",\n       \"params\": {}\n    },\n    \"onNoMatch\": {\n       \"decision\": \"string required\",\n       \"params\": {}\n    },\n    \"defaultDecision\": {\n       \"decision\": \"string required\",\n       \"params\": {}\n    }\n}, ...]\n\nFor valueType STRING operators [eq, neq] are valid\nFor valueType NUMBER operators [eq, neq, gt, lt] are valid\nFor valueType IP operators [eq, neq] are valid\nFor valueType CIDR operators [eq, neq] are valid\nFor valueType GEODISTANCE operators [gt, lt] are valid\nFor valueType ARRAY operators [in, nin, overlap, nooverlap, isempty] are valid\n\n```\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRulesInBatchRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success\n\nCreated rule object,\n\n```\n[{\n  \"name\": \"xxxxxxxxxxx\"\n  \"category\": \"xxxxxxxxxx\",\n  \"tags\": [\n     \"xxxxxxx\",\n     \"xxxxxxxxxx\"\n   ],\n  \"description\": \"xxxxxxxxxx\",\n  \"enabled\": \"true\",\n  \"createdBy\": \"xxxxxxxx\",\n  \"criteria\": \"any\",\n  \"conditions\": [\n     {\n        \"factName\": \"xxxxxxxxxxxx\",\n        \"valueType\": \"xxxxxxxxxxxxx\",\n        \"value\": \"xxxxxxxxxxxxxxxxxx\",\n        \"operator\": \"xxxxxxxxxxxxxxxxxxx\"\n     }\n  ],\n  \"onMatch\": {\n     \"decision\": \"xxxxxxxxxxxxxx\",\n     \"params\": {}\n  },\n  \"onNoMatch\": {\n     \"decision\": \"xxxxxxxxxxxxxxxx\",\n     \"params\": {}\n  },\n  \"defaultDecision\": {\n     \"decision\": \"xxxxxxxxxxxxxxxxxxxxxxx\",\n     \"params\": {}\n  }\n}, ...]\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateRulesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/rules/fetch": {
      "post": {
        "summary": "Fetch Rules",
        "description": "Fetch rules by tenantId, communityId,  category (optional), tags ([tag1, ... tagN], optional). <br />\n- valid community license with authlevel system, service, service_ext.\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n|            **Request Body**                  |\n|----------------------------------------------|\n\n\n### category (optional)\nCategory of rules. <br />\n### tags (optional)\nTags of rules.<br />\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the fetched rules ... <br />\nThis API throw an error if something goes wrong.\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": {
          "description": "Request body contains below fields to fetch rules:\n\n```\n{\n    \"category\": \"string optional\",\n    \"tags\": [\n       \"string optional\"\n     ]\n}\n```\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleFetchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success\n\nRules fetch result\n```\n{\n    \"data\": [\n       {\n         \"name\": \"xxxxxxxxxx\"\n         \"category\": \"xxxxxxxxxxxxxx\",\n         \"tags\": [\n            \"xxxxxxxxxxxxxxxxxxxxx\"\n         ],\n         \"description\": \"xxxxxxxxxxxxx\",\n         \"enabled\": true,\n         \"createdBy\": \"xxxxxxxxxxx\",\n         \"criteria\": \"any\",\n         \"conditions\": [\n            {\n               \"factName\": \"xxxxxxxxxxxxxxx\",\n               \"valueType\": \"xxxxxxxxxxxxxx\",\n               \"value\": \"xxxxxxxxxxxxxxxxxx\",\n               \"operator\": \"xxxxxxxxxxxxxxxxxx\"\n            }\n         ],\n         \"onMatch\": {\n            \"decision\": \"xxxxxxxxxxxxxxx\",\n            \"params\": {}\n         },\n         \"onNoMatch\": {\n            \"decision\": \"xxxxxxxxxxxxx\",\n            \"params\": {}\n         },\n         \"defaultDecision\": {\n            \"decision\": \"xxxxxxxxxxxxxxxx\",\n            \"params\": {}\n         }\n     }\n  ]\n}\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleFetchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/rule/{ruleId}": {
      "get": {
        "summary": "Get Single Rule By Id",
        "description": "Fetch a single rule by tenantId, communityId, ruleId. <br />\n- valid community license with authlevel system, service, service_ext.\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n|            **Request Body**                  |\n|----------------------------------------------|\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the fetched rule ... <br />\nThis API throw an error if something goes wrong.\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "ruleId",
            "description": "ID for a single rule",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": null,
        "responses": {
          "200": {
            "description": "Success\n\nRule fetch result\n```\n{\n     \"name\": \"xxxxxxxxxx\"\n     \"category\": \"xxxxxxxxxxxxxx\",\n     \"tags\": [\n         \"xxxxxxxxxxxxxxxxxxxxx\"\n     ],\n     \"description\": \"xxxxxxxxxxxxx\",\n     \"enabled\": true,\n     \"createdBy\": \"xxxxxxxxxxx\",\n     \"criteria\": \"any\",\n     \"conditions\": [\n        {\n           \"factName\": \"xxxxxxxxxxxxxxx\",\n           \"valueType\": \"xxxxxxxxxxxxxx\",\n           \"value\": \"xxxxxxxxxxxxxxxxxx\",\n           \"operator\": \"xxxxxxxxxxxxxxxxxx\"\n        }\n     ],\n     \"onMatch\": {\n        \"decision\": \"xxxxxxxxxxxxxxx\",\n        \"params\": {}\n     },\n     \"onNoMatch\": {\n        \"decision\": \"xxxxxxxxxxxxx\",\n        \"params\": {}\n     },\n     \"defaultDecision\": {\n        \"decision\": \"xxxxxxxxxxxxxxxx\",\n        \"params\": {}\n     }\n}\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleFetchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      },
      "patch": {
        "summary": "Update Rule",
        "description": "Update a rule by ruleId. <br />\n- tenantId, communityId and createdBy cannot be updated.\n\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Request Body**                  |\n|----------------------------------------------|\n\n\n### name (optional)\nName of Rule. <br />\n\n### category (optional)\nCategory of rule. <br />\n### tags (optional)\nTags of rule.<br />\n### description (optional)\nDescription of rule.<br />\n### enabled (required)\nStatus of rule (true or false). <br />\n\n### criteria (optional)\nCriteria for rule (any, all). <br />\n\n### conditions (optional)\nList of conditions for the rule. <br />\n### onMatch (optional)\nonMatch data of rule with decision and parameters. <br />\n### onNoMatch (optional)\nonNoMatch data of rule with decision and parameters. <br />\n\n### defaultDecision (optional)\nDefault decision of rule with decision and parameters\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the updated rule ... <br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "ruleId",
            "description": "Rule _id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": {
          "description": "Request body contains below fields to update rules.\n\n```\n{\n    \"name\": \"string optional\"\n    \"category\": \"string optional\",\n    \"tags\": [\n       \"string optional\"\n     ],\n    \"description\": \"string optional\",\n    \"enabled\": \"boolean optional\",\n    \"criteria\": \"string optional - any or all\",\n    \"conditions\": [\n       {\n          \"factName\": \"string optional\",\n          \"valueType\": \"string required - STRING, NUMBER, IP, CIDR (192.98.70.00/20), ARRAY\",\n          \"value\": \" 'string' | 10 | '192.98.70.00' | '192.98.70.00/20' | '192.98.70.00-192.98.70.12' | ['some string'] | [] required\",\n          \"operator\": \"string required [eq, neq, gt, lt, in, nin, overlap, nooverlap, isempty]\"\n       }\n    ],\n    \"onMatch\": {\n       \"decision\": \"string optional\",\n       \"params\": {}\n    },\n    \"onNoMatch\": {\n       \"decision\": \"string optional\",\n       \"params\": {}\n    },\n    \"defaultDecision\": {\n       \"decision\": \"string optional\",\n       \"params\": {}\n    }\n}\n\nFor valueType STRING operators [eq, neq] are valid\nFor valueType NUMBER operators [eq, neq, gt, lt] are valid\nFor valueType IP operators [eq, neq] are valid\nFor valueType CIDR operators [eq, neq] are valid\nFor valueType ARRAY operators [in, nin, overlap, nooverlap, isempty] are valid\n\n```\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success\n\nUpdated rule object,\n\n```\n{\n  \"name\": \"xxxxxxxxxxx\"\n  \"category\": \"xxxxxxxxxx\",\n  \"tags\": [\n     \"xxxxxxx\",\n     \"xxxxxxxxxx\"\n   ],\n  \"description\": \"xxxxxxxxxx\",\n  \"enabled\": \"true\",\n  \"createdBy\": \"xxxxxxxx\",\n  \"criteria\": \"any\",\n  \"conditions\": [\n     {\n        \"factName\": \"xxxxxxxxxxxx\",\n        \"valueType\": \"xxxxxxxxxxxxx\",\n        \"value\": \"xxxxxxxxxxxxxxxxxx\",\n        \"operator\": \"xxxxxxxxxxxxxxxxxxx\"\n     }\n  ],\n  \"onMatch\": {\n     \"decision\": \"xxxxxxxxxxxxxx\",\n     \"params\": {}\n  },\n  \"onNoMatch\": {\n     \"decision\": \"xxxxxxxxxxxxxxxx\",\n     \"params\": {}\n  },\n  \"defaultDecision\": {\n     \"decision\": \"xxxxxxxxxxxxxxxxxxxxxxx\",\n     \"params\": {}\n  }\n}\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleUpdateResponse"
                }
              }
            }
          },
          "304": {
            "description": "Not modified"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "delete": {
        "summary": "Delete Rule",
        "description": "Delete a rule by ruleId. <br />\n- valid community license with authlevel system, service, service_ext.\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the deleted status ... <br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "ruleId",
            "description": "Rule _id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success\n"
          },
          "304": {
            "description": "Not modified"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/rule/{ruleId}/{action}": {
      "get": {
        "summary": "Enable/Disable Rule",
        "description": "Enable or Diasable a rule by ruleId. <br />\n- valid community license with authlevel system, service, service_ext.\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the OK status ... <br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "ruleId",
            "description": "Rule _id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "enable",
                "disable"
              ],
              "default": "enable"
            }
          }
        ],
        "requestBody": null,
        "responses": {
          "200": {
            "description": "Success\n"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/rules/delete": {
      "post": {
        "summary": "Delete Rules matching tags and/or ids",
        "description": "Delete Rules matching tags and/or ids.  <br />\n- valid community license with authlevel system, service, service_ext.\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the deleted status ... <br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": {
          "description": "Request body contains below fields to update rules.\n\n```\nAt least one of ids or tags is mandatory\n{\n    \"ids\": [ \"string\" ] //optional\n    \"tags\": [ \"string\" ] //optional,\n}\n```\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteRulesByQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success\n"
          },
          "304": {
            "description": "Not modified"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/tenant/{tenantId}/community/{communityId}/evaluate": {
      "post": {
        "summary": "Evaluate Rules",
        "description": "Evaluate rules by tenantId, communityId <br />\n- license key authorized for given community\n\n|              **Headers**                     |\n|----------------------------------------------|\n\n### licensekey (required)\nLicense key\n\n### requestid (optional)\nJSON string\n\n\n|            **Request Body**                  |\n|----------------------------------------------|\n\n\n### category (required)\nCategory for evaluation. <br />\n\n### facts (required)\nfacts for evaluation. <br />\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns the evaluated rules ... <br />\n<br />\n",
        "tags": [
          "Rule"
        ],
        "security": [
          {
            "licensekey": []
          }
        ],
        "parameters": [
          {
            "name": "licensekey",
            "in": "header",
            "description": "License key / Try Authorize &#128274;",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Do not enter anything, use 'Authorize' fields"
            }
          },
          {
            "name": "requestid",
            "in": "header",
            "description": "Request Id (string, plain text)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "description": "ID of tenant",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxx"
            }
          },
          {
            "in": "path",
            "name": "communityId",
            "description": "ID of community",
            "required": true,
            "schema": {
              "type": "string",
              "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
          }
        ],
        "requestBody": {
          "description": "Request body contains below fields to evaluate rules.\n\n```\n{\n    \"category\": \"string required\",\n    \"facts\": {}\n}\n```\n",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleEvaluateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success\n\nEvaluated rules,\n\n```\n{\n  \"rules\": [\n     {\n         \"id\": \"xxxxxxxxxxxxxx\",\n         \"tags\": [\n            \"xxxxxxxxxx\"\n         ],\n         \"category\": \"xxxxxxx\",\n         \"decision\": {},\n         \"reason\": \"xxxxxxxx\",\n         \"factsChecked\": [\n           \"xxxxxx\"\n        ]\n     }\n   ]\n}\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleEvaluateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/healthz": {
      "get": {
        "summary": "Get healthz.",
        "description": "Get healthz<br />\n\n\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns a healthz object\n - ```version = <git-tag>.<commit-id>.<dob>``` <br />\n\n - ```git-tag```: When code is compiled from a git-tag, this must carry the tag name. This should match one of the git tags.\n - ```commit-id```: This is the git-commit-id. eg: When code is built from this, the hex code, in the end, is the commit it.\n - ```dob```: Date Of Build. This is epoch-time in seconds when the build was created.\n - \u200bif the code is not built from a git-tag, then the ```version =\ufffc<commit-id>.<dob>```\n",
        "tags": [
          "Healthz"
        ],
        "responses": {
          "200": {
            "description": "Success\n\n```\n{\n    \"status\": \"all services operational\",\n    \"code\": \"200\",\n    \"version\": \"<version>\" //as defined above\n}\n```\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthzResponse"
                }
              }
            }
          }
        }
      }
    },
    "/environment": {
      "get": {
        "description": "Provide details regarding the environments.\n|            **Returns**                    |\n|-------------------------------------------|\n\nReturns an environment object\n",
        "tags": [
          "Environment"
        ],
        "security": [
          {
            "license": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RuleEvaluateResponse": {
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "category": {
                  "type": "string"
                },
                "decision": {
                  "type": "object"
                },
                "reason": {
                  "type": "string"
                },
                "factsChecked": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "RuleEvaluateRequest": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "facts": {
            "type": "object"
          }
        }
      },
      "RuleUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "description": "optional, default empty array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "criteria": {
            "type": "string"
          },
          "conditions": {
            "type": "array",
            "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
            "items": {
              "type": "object",
              "properties": {
                "factName": {
                  "type": "string"
                },
                "valueType": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "operator": {
                  "type": "string"
                }
              }
            }
          },
          "onMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object"
              }
            }
          },
          "onNoMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object"
              }
            }
          },
          "defaultDecision": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RuleUpdateResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "description": "optional, default empty array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "criteria": {
            "type": "string"
          },
          "conditions": {
            "type": "array",
            "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
            "items": {
              "type": "object",
              "properties": {
                "factName": {
                  "type": "string"
                },
                "valueType": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "operator": {
                  "type": "string"
                }
              }
            }
          },
          "onMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "onNoMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "defaultDecision": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RuleCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "description": "optional, default empty array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "createdBy": {
            "type": "string"
          },
          "criteria": {
            "type": "string"
          },
          "conditions": {
            "type": "array",
            "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
            "items": {
              "type": "object",
              "properties": {
                "factName": {
                  "type": "string"
                },
                "valueType": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "operator": {
                  "type": "string"
                }
              }
            }
          },
          "onMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "onNoMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "defaultDecision": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "properties": null,
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RuleCreateResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "description": "optional, default empty array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "createdBy": {
            "type": "string"
          },
          "criteria": {
            "type": "string"
          },
          "conditions": {
            "type": "array",
            "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
            "items": {
              "type": "object",
              "properties": {
                "factName": {
                  "type": "string"
                },
                "valueType": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "operator": {
                  "type": "string"
                }
              }
            }
          },
          "onMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object"
              }
            }
          },
          "onNoMatch": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object"
              }
            }
          },
          "defaultDecision": {
            "type": "object",
            "properties": {
              "decision": {
                "type": "string"
              },
              "params": {
                "type": "object"
              }
            }
          }
        }
      },
      "RuleFetchRequest": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "description": "optional, default empty array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RuleFetchResponse": {
        "type": "array",
        "description": "required",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "category": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "description": "optional, default empty array",
              "items": {
                "type": "string"
              }
            },
            "description": {
              "type": "string"
            },
            "enabled": {
              "type": "boolean"
            },
            "criteria": {
              "type": "string"
            },
            "conditions": {
              "type": "array",
              "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
              "items": {
                "type": "object",
                "properties": {
                  "factName": {
                    "type": "string"
                  },
                  "valueType": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "operator": {
                    "type": "string"
                  }
                }
              }
            },
            "onMatch": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object",
                  "properties": null,
                  "message": {
                    "type": "string"
                  }
                }
              }
            },
            "onNoMatch": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object",
                  "properties": null,
                  "message": {
                    "type": "string"
                  }
                }
              }
            },
            "defaultDecision": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object",
                  "properties": null,
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "PublicKeyResponse": {
        "type": "object",
        "properties": {
          "publicKey": {
            "type": "string"
          }
        },
        "example": {
          "publicKey": ""
        }
      },
      "HealthzResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "example": {
          "status": "all services operational",
          "publicKey": "//same as <service>/publickeys endpoint",
          "code": "200",
          "version": "xxxx.xxxx.xxxx"
        }
      },
      "EcdsaEncryptDecryptRequest": {
        "type": "object",
        "properties": {
          "dataStr": {
            "type": "string"
          },
          "publicKey": {
            "type": "string"
          },
          "privateKey": {
            "type": "string"
          }
        },
        "example": {
          "dataStr": "Hey, This is example data string.",
          "publicKey": "xxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxx=",
          "privateKey": "xxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxx="
        }
      },
      "EcdsaEncryptDecryptResponse": {
        "type": "object",
        "properties": {
          "publicKey": {
            "type": "string"
          },
          "data": {
            "type": "array"
          }
        },
        "example": {
          "data": "xxxxxxxxxxxxxxxxxxxx",
          "publicKey": "xxxxxxxxxxxxxxxxxxxx"
        }
      },
      "ServiceKeysResponse": {
        "type": "array",
        "description": "Service keys array",
        "items": {
          "type": "object",
          "required": [
            "tag",
            "keyId",
            "keySecret",
            "type"
          ],
          "properties": {
            "tag": {
              "type": "string",
              "description": "service ecdsa"
            },
            "keyId": {
              "type": "string",
              "description": "ecdsa publicKey"
            },
            "keySecret": {
              "type": "string",
              "description": "ecdsa private key"
            },
            "type": {
              "type": "string",
              "description": "default = ecdsa | hawk"
            }
          },
          "example": {
            "tag": "xxxxx",
            "keyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
            "keySecret": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
            "type": "xxxxx"
          }
        }
      },
      "GetServiceComponentsResponse": {
        "type": "object",
        "properties": {
          "name1": {
            "type": "string"
          },
          "name2": {
            "type": "string"
          },
          "name3": {
            "type": "string"
          }
        },
        "example": {
          "name1": "https://xxx.xxxxxx.xxx/xxxxx",
          "name2": "https://xxx.xxxxxx.xxx/xxxxx",
          "name3": "https://xxx.xxxxxx.xxx/xxxxx"
        }
      },
      "CreateRulesInBatchRequest": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "category": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "description": "optional, default empty array",
              "items": {
                "type": "string"
              }
            },
            "description": {
              "type": "string"
            },
            "enabled": {
              "type": "boolean"
            },
            "createdBy": {
              "type": "string"
            },
            "criteria": {
              "type": "string"
            },
            "conditions": {
              "type": "array",
              "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
              "items": {
                "type": "object",
                "properties": {
                  "factName": {
                    "type": "string"
                  },
                  "valueType": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "operator": {
                    "type": "string"
                  }
                }
              }
            },
            "onMatch": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object",
                  "properties": null,
                  "message": {
                    "type": "string"
                  }
                }
              }
            },
            "onNoMatch": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object",
                  "properties": null,
                  "message": {
                    "type": "string"
                  }
                }
              }
            },
            "defaultDecision": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "CreateRulesResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "category": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "description": "optional, default empty array",
              "items": {
                "type": "string"
              }
            },
            "description": {
              "type": "string"
            },
            "enabled": {
              "type": "boolean"
            },
            "createdBy": {
              "type": "string"
            },
            "criteria": {
              "type": "string"
            },
            "conditions": {
              "type": "array",
              "description": "if empty, no conditions defined, rule assumed \"diasbled\"",
              "items": {
                "type": "object",
                "properties": {
                  "factName": {
                    "type": "string"
                  },
                  "valueType": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "operator": {
                    "type": "string"
                  }
                }
              }
            },
            "onMatch": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object"
                }
              }
            },
            "onNoMatch": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object"
                }
              }
            },
            "defaultDecision": {
              "type": "object",
              "properties": {
                "decision": {
                  "type": "string"
                },
                "params": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "DeleteRulesByQuery": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "licensekey": {
        "type": "apiKey",
        "name": "licensekey",
        "in": "header",
        "description": "License key from License Microservice"
      },
      "license": {
        "type": "apiKey",
        "name": "license",
        "in": "header",
        "description": "License key from License Microservice"
      }
    }
  },
  "tags": [
    {
      "name": "Service Key"
    },
    {
      "name": "Healthz"
    },
    {
      "name": "Environment"
    }
  ],
  "servers": [
    {
      "url": "https://pilot-root.1kosmos.net/rules-engine/"
    }
  ]
}