Skip to main content

Create Rate Limiting Rule

Create a new rate limiting rule and binds it to one or more websites.

Request

Request-Line

POST /waap/v1.0/pbrStrategy/rateLimitings HTTP/1.1

Request Parameters

Body Parameters

ParameterTypeRequiredDescription
nameStringMandatoryRule name for web access control.
descriptionStringOptionalThe description can have 1-200 characters.
pathOperatorStringMandatoryMatching operator used to evaluate the request path. Supported values: equal, notEqual, contain, notContain, beginsWith, notBeginsWith, endsWith, notEndsWith, regex, notMatchRegex, include, exclude.
pathPatternStringMandatoryThe path pattern to be matched against the request URI. The interpretation depends on pathOperator. For example, when pathOperator is contain, the rule triggers if the request path contains this value.
keyTypeStringMandatoryThe request attribute used for matching. Supported values: ip, fingerprint, cookieId.
rateLimitTypeStringMandatorySpecifies the rate limiting mode. Supported values: rate (Queries per second) or timeWindow (Queries per Time Window).
rateIntegerOptionalThe maximum number of requests allowed per second. The valid range is 1 to 65535. Required when rateLimitType is rate.
burstIntegerOptionalThe maximum burst capacity above the configured rate. The valid range is 0 to 65535. Required when rateLimitType is rate.
windowUnitStringOptionalThe time unit of the rate limit window. Supported values: second, minute, hour. Required when rateLimitType is timeWindow.
maxRequestsIntegerOptionalThe maximum number of requests allowed within the specified time window. The valid range is 1 to 65535. Required when rateLimitType is timeWindow.
devTypeString[]MandatorySpecifies the device types that the rule applies to. Supported values: pc, mac, mobile. Multiple device types can be selected.
triggeringProbabilityIntegerMandatoryThe probability (in percentage) that the configured action will be triggered when the request matches the rule. Supported values: 100, 90, 80, 70, 60, 50, 40, 30, 20, 10.
autoListKeyStringMandatoryThe key type used by Auto-Web ACL to automatically control request access. Supported values: ip, fingerprint.
autoListDurationIntegerMandatoryThe duration (in seconds) that the key will remain in the Auto-Web ACL once triggered. The valid range is 0 to 600000.
websitesInteger[]MandatoryList of website IDs the rule applies to.

Response

Response Body

ParameterTypeDescription
ruleIdIntegerUnique identifier assigned to the created rate limiting rule.

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400Request.BadRequestBad request.
400Name.InvalidName is empty or invalid.
400PathOperator.InvalidPathOperator is empty or invalid.
400PathPattern.InvalidPathPattern is empty or invalid.
400KeyType.InvalidKeyType is empty or invalid.
400RateLimitType.InvalidRateLimitType is empty or invalid.
400Rate.InvalidRate is empty or invalid.
400Burst.InvalidBurst is empty or invalid.
400WindowUnit.InvalidWindowUnit is empty or invalid.
400MaxRequests.InvalidMaxRequests is empty or invalid.
400DevType.InvalidDevType is empty or invalid.
400TriggeringProbability.InvalidTriggeringProbability is empty or invalid.
400AutoListKey.InvalidAutoListKey is empty or invalid.
400AutoListDuration.InvalidAutoListDuration is empty or invalid.
404Website.NotFoundWebsite is not found.

Examples

Create Rate Limiting Rule

Request

POST /waap/v1.0/pbrStrategy/ratelimitings HTTP/1.1

{
"name": "test111",
"description": "test111",
"pathOperator": "contain",
"pathPattern": "/test",
"keyType": "ip",
"rateLimitType": "rate",
"rate": 100,
"burst": 100,
"windowUnit": "minute",
"maxRequests": 0,
"devType": [
"pc",
"mac",
"mobile"
],
"triggeringProbability": 90,
"autoListKey": "fingerprint",
"autoListDuration": 111,
"websites": []
}

Successful Response Body

{
"ruleId": 261700,
}