Skip to main content
POST
/
filtering-rules
/
test
Test filtering rules
curl --request POST \
  --url https://management-api.fpjs.io/filtering-rules/test \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Version: <x-api-version>' \
  --data @- <<EOF
{
  "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"
  }
}
EOF
{
  "data": {
    "result": "deny",
    "deny_with": "Forbidden",
    "triggered_rule": "http.request.ip in cidr('192.168.1.1/32')"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-API-Version
string
required

Management API version.

Body

application/json
rules
object[]

Array of rules to test. If omitted, provide environment ID to test against existing rules.

environment
string

Environment ID. Must be provided if rules are not

Example:

"ae_rrETjdWcfqI6AFsk"

test_request_id
string

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

Example:

"req_abc123xyz"

test_request_payload
object

Request data to test against

Response

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

data
object
required