v1

latestOpenAPI 3.0.02026-07-2634192196.8 KB
filtering-rules

Update filtering rule

Updates an existing filtering rule. Only provided fields will be updated.

post/filtering-rules/{id}

Path parameters

idstring required

Headers

X-API-Versionstring required

Management API version.

Request body

namestring

Name of the filtering rule

environmentstring

Environment ID

expressionstring

Expression in expr-lang format that defines the rule condition

action'allow' | 'deny'

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

idstring required

ID of the filtering rule

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",
  "id": "tr_rrETjdWcfqI6AFsk"
}

Response

Updated 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"
  }
}