v1

latestOpenAPI 3.0.02026-07-2634192196.8 KB
filtering-rules

Test filtering rules

Tests filtering rules against a specified request ID or custom event payload. You can provide an existing request ID (up to 3 months old) or a custom JSON payload. Optionally, you can provide custom rules to test instead of using existing rules.

post/filtering-rules/test

Headers

X-API-Versionstring required

Management API version.

Request body

environmentstring

Environment ID. Must be provided if rules are not

test_request_idstring

Request ID to test against (up to 3 months old)

Example request

{
  "rules": [
    {
      "expression": "http.request.ip in cidr('192.168.1.1/32')",
      "action": "deny",
      "deny_with": "Forbidden"
    }
  ],
  "environment": "ae_rrETjdWcfqI6AFsk",
  "test_request_id": "req_abc123xyz",
  "test_request_payload": {
    "headers": {
      "user-agent": [
        "Mozilla/5.0"
      ],
      "accept": [
        "application/json"
      ]
    },
    "ip": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
    "sdkPlatform": "js",
    "sdkVersion": "3.8.0",
    "appPackageName": "com.example.app"
  }
}

Response

Test results showing which rule was triggered (if any) and the resulting action.

Example response

{
  "data": {
    "result": "deny",
    "deny_with": "Forbidden",
    "triggered_rule": "http.request.ip in cidr('192.168.1.1/32')"
  }
}