Skip to main content
POST
/
filtering-rules
/
{id}
Update filtering rule
curl --request POST \
  --url https://management-api.fpjs.io/filtering-rules/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Version: <x-api-version>' \
  --data @- <<EOF
{
  "id": "tr_rrETjdWcfqI6AFsk",
  "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",
  "placement": {
    "position": 1,
    "after": "<string>",
    "before": "<string>"
  }
}
EOF
{
  "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",
    "created_at": "2024-05-31T01:24:39.506Z",
    "deny_with": "Forbidden",
    "updated_at": "2024-06-01T10:15:30.123Z"
  }
}

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.

Path Parameters

id
string
required

Body

application/json
id
string
required

ID of the filtering rule

Example:

"tr_rrETjdWcfqI6AFsk"

name
string

Name of the filtering rule

Example:

"Block suspicious IPs"

environment
string

Environment ID

Example:

"ae_rrETjdWcfqI6AFsk"

expression
string

Expression in expr-lang format that defines the rule condition

Example:

"http.request.ip in cidr('192.168.1.1/32')"

action
enum<string>

Action to take when the rule matches

Available options:
allow,
deny
Example:

"deny"

status
enum<string>
default:enabled

Status of the filtering rule

Available options:
enabled,
disabled
deny_with
enum<string>

Error message to return when denying a request

Available options:
Forbidden
Example:

"Forbidden"

placement
object

Placement options for the rule

Response

Updated filtering rule object.

data
object
required