Skip to main content

General Information

Policy Type

Endpoints

List Policies

Add Policy

Update Policy

Delete Policy


List Policies

Endpoint

Request

Headers

Path Parameters

Response

Success Response (200 OK)

cURL Example


Add Policy

Endpoint

Request

Headers

Path Parameters

Request Body

Full JSON Body Example

Request Body Fields

operationMetadata
Enum: targetScope
  • ALL - Policy applies to all endpoints
  • ENDPOINT - Policy applies only to specified endpoint
Enum: targetPipeline
  • REQUEST - Executes in request pipeline
  • RESPONSE - Executes in response pipeline
  • ERROR - Executes in error pipeline
Enum: targetEndpointHTTPMethod
  • GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
policy
Enum: throttlingInterval
  • ONE_SECOND - 1 second
  • ONE_MINUTE - 1 minute
  • ONE_HOUR - 1 hour
  • ONE_DAY - 1 day
Enum: intervalWindowType
  • FIXED - Fixed time window
  • SLIDING - Sliding time window
Enum: cacheErrorHandlingType
  • FAIL - Fail request if cache error occurs
  • ALLOW - Allow request if cache error occurs
targetVariableForIdentity
See Variable Definition for complete variable documentation.

Variable Types

  • HEADER - Extract from HTTP header
  • PARAMETER - Extract from query/path/form parameter
  • BODY - Extract from request body (XML, JSON, or raw)
  • CONTEXT_VALUES - Extract from system context values (e.g., CLIENT_IP, REQUEST_URI)
  • CUSTOM - Extract using custom script

Common Context Values

  • REQUEST_REMOTE_ADDRESS - Client IP address
  • REQUEST_REQUEST_URI - Request URI
  • REQUEST_HTTP_METHOD - HTTP method
  • REQUEST_USERNAME_KEY - Username or key
For complete list of context values, see EnumVariableContextValue.
detailList (Optional)

Response

Success Response (200 OK)

cURL Example


Update Policy

Endpoint

Request

Headers

Path Parameters

Request Body

Full JSON Body Example
Note: Request body structure is the same as Add Policy. All fields should be provided for update.

Response

Success Response (200 OK)

cURL Example


Delete Policy

Endpoint

Request

Headers

Path Parameters

Request Body

Full JSON Body Example

Request Body Fields

operationMetadata

Response

Success Response (200 OK)

cURL Example


Notes and Warnings

  • Cache Dependency: This policy requires a cache connection. Ensure cache is properly configured.
  • Identity Variable: Choose the identity variable carefully. Common choices:
    • HEADER with API key header - For API key-based throttling
    • CONTEXT with CLIENT_IP - For IP-based throttling
    • PARAMETER with user ID - For user-based throttling
  • Window Types:
    • FIXED - Fixed time windows (e.g., minute 1:00-1:59)
    • SLIDING - Sliding time windows (last 60 seconds from current time)
  • Detail List: Use detailList to provide different limits for specific values (e.g., VIP users)
  • Rate Limit Headers: When showRateLimitStatisticsInResponseHeader is true, response includes:
    • X-RateLimit-Limit - Maximum requests allowed
    • X-RateLimit-Remaining - Remaining requests in current window
    • X-RateLimit-Reset - Time when limit resets
  • Deployment: Policy changes require deployment to take effect. Set deploy: true or deploy manually.