v1

latestOpenAPI 3.0.02026-07-2634192196.8 KB
filtering-rules

Create filtering rule

Creates a new filtering rule. The rule will be evaluated in order based on the placement parameter. If no placement is specified, the rule is added to the end.

post/filtering-rules

Headers

X-API-Versionstring required

Management API version.

Request body

namestring required

Name of the filtering rule

environmentstring required

Environment ID

expressionstring required

Expression in expr-lang format that defines the rule condition

action'allow' | 'deny' required

Action to take when the rule matches

status'enabled' | 'disabled'

Status of the filtering rule

deny_with'Forbidden'

Error message to return when denying a request

Example request

{
  "name": "Block suspicious IPs",
  "environment": "ae_rrETjdWcfqI6AFsk",
  "expression": "http.request.ip in cidr('192.168.1.1/32')",
  "action": "deny",
  "deny_with": "Forbidden"
}

Response

Created filtering rule object.

Example response

{
  "data": {
    "id": "tr_abc123xyz",
    "name": "Block suspicious IPs",
    "environment": "ae_rrETjdWcfqI6AFsk",
    "expression": "http.request.ip in cidr('192.168.1.1/32')",
    "action": "deny",
    "status": "enabled",
    "deny_with": "Forbidden",
    "created_at": "2024-05-31T01:24:39.506Z",
    "updated_at": "2024-06-01T10:15:30.123Z"
  }
}