---
updatedAt: 2026-05-12T09:58:44.000Z
---

# Update scan rules

This operation enables you to update the scan rules associated with a particular site, as specified by <b>siteID</b> in the request body.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "ErrorMessage": {
        "description": "ErrorMessage describes the error",
        "properties": {
          "code": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SiteScanRule": {
        "description": "SiteScanRule holds the structure of a scanning rule for this site",
        "properties": {
          "else": {
            "description": "else - branch conditional",
            "type": "string"
          },
          "id": {
            "description": "ID of scan rule",
            "type": "string"
          },
          "isRoot": {
            "description": "isRoot - indicates if this is a root scan rule (there should always be a root rule)",
            "type": "boolean"
          },
          "maxCount": {
            "description": "maxCount - the number of matching URLs that, when reached, will trigger the 'then' condition",
            "format": "int64",
            "type": "integer"
          },
          "regex": {
            "description": "regex - the regular expression used for this rule",
            "type": "string"
          },
          "regexR": {
            "description": "regexR - a condition that allows search and replace in a specific URL for parameter values",
            "type": "string"
          },
          "sift": {
            "description": "sift - a condition that randomizes what links get added to a scan. Values range from 0.1 - 1.0 (0.1 = 10%, 1.0 = 100%). Useful for templated content.",
            "format": "double",
            "type": "number"
          },
          "then": {
            "description": "then - branch conditional",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "SiteScanRules": {
        "description": "SiteScanRules holds the ScanRule collection plus SiteID and AssetID",
        "properties": {
          "assetID": {
            "description": "Asset ID",
            "format": "int64",
            "type": "integer"
          },
          "scanRules": {
            "items": {
              "$ref": "#/components/schemas/SiteScanRule"
            },
            "type": "array"
          },
          "siteID": {
            "description": "Site ID",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "assetID",
          "siteID"
        ],
        "type": "object"
      }
    }
  },
  "info": {
    "license": {
      "name": "(c) Copyright 2023 WhiteHat Security"
    },
    "title": "Sites API",
    "version": "2.0.0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/api/scanRules": {
      "put": {
        "description": "This operation enables you to update the scan rules associated with a particular site, as specified by <b>siteID</b> in the request body.",
        "operationId": "createScanRules",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteScanRules"
              }
            }
          },
          "description": "Body of the request holds the data to input when creating scan rules",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteScanRules"
                }
              }
            },
            "description": "CreateScanRulesResponse provides the response structure for the scan rules api"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessage"
                }
              }
            },
            "description": "BadRequestResponse indicates a request with invalid parameters"
          },
          "401": {
            "description": "UnauthorizedResponse signals an unauthorized API access"
          },
          "403": {
            "description": "ForbiddenResponse signals a request for a resource that does not exist or is not authorized"
          },
          "500": {
            "description": "GenericError generic error"
          }
        },
        "summary": "Update scan rules",
        "tags": [
          "Sites API v2.0"
        ],
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "servers": [
    {
      "url": "https://sentinel.whitehatsec.com/"
    }
  ],
  "tags": [
    {
      "name": "Sites API v2.0"
    }
  ],
  "x-explorer-enabled": false,
  "x-readme": {
    "proxy-enabled": true
  }
}
```