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>"
}
}
EOFimport requests
url = "https://management-api.fpjs.io/filtering-rules/{id}"
payload = {
"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>"
}
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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>'}
})
};
fetch('https://management-api.fpjs.io/filtering-rules/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.fpjs.io/filtering-rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://management-api.fpjs.io/filtering-rules/{id}"
payload := strings.NewReader("{\n \"id\": \"tr_rrETjdWcfqI6AFsk\",\n \"name\": \"Block suspicious IPs\",\n \"environment\": \"ae_rrETjdWcfqI6AFsk\",\n \"expression\": \"http.request.ip in cidr('192.168.1.1/32')\",\n \"action\": \"deny\",\n \"status\": \"enabled\",\n \"deny_with\": \"Forbidden\",\n \"placement\": {\n \"position\": 1,\n \"after\": \"<string>\",\n \"before\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Version", "<x-api-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://management-api.fpjs.io/filtering-rules/{id}")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"tr_rrETjdWcfqI6AFsk\",\n \"name\": \"Block suspicious IPs\",\n \"environment\": \"ae_rrETjdWcfqI6AFsk\",\n \"expression\": \"http.request.ip in cidr('192.168.1.1/32')\",\n \"action\": \"deny\",\n \"status\": \"enabled\",\n \"deny_with\": \"Forbidden\",\n \"placement\": {\n \"position\": 1,\n \"after\": \"<string>\",\n \"before\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/filtering-rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"tr_rrETjdWcfqI6AFsk\",\n \"name\": \"Block suspicious IPs\",\n \"environment\": \"ae_rrETjdWcfqI6AFsk\",\n \"expression\": \"http.request.ip in cidr('192.168.1.1/32')\",\n \"action\": \"deny\",\n \"status\": \"enabled\",\n \"deny_with\": \"Forbidden\",\n \"placement\": {\n \"position\": 1,\n \"after\": \"<string>\",\n \"before\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}filtering-rules
Update filtering rule
Updates an existing filtering rule. Only provided fields will be updated.
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>"
}
}
EOFimport requests
url = "https://management-api.fpjs.io/filtering-rules/{id}"
payload = {
"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>"
}
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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>'}
})
};
fetch('https://management-api.fpjs.io/filtering-rules/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.fpjs.io/filtering-rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://management-api.fpjs.io/filtering-rules/{id}"
payload := strings.NewReader("{\n \"id\": \"tr_rrETjdWcfqI6AFsk\",\n \"name\": \"Block suspicious IPs\",\n \"environment\": \"ae_rrETjdWcfqI6AFsk\",\n \"expression\": \"http.request.ip in cidr('192.168.1.1/32')\",\n \"action\": \"deny\",\n \"status\": \"enabled\",\n \"deny_with\": \"Forbidden\",\n \"placement\": {\n \"position\": 1,\n \"after\": \"<string>\",\n \"before\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Version", "<x-api-version>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://management-api.fpjs.io/filtering-rules/{id}")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"tr_rrETjdWcfqI6AFsk\",\n \"name\": \"Block suspicious IPs\",\n \"environment\": \"ae_rrETjdWcfqI6AFsk\",\n \"expression\": \"http.request.ip in cidr('192.168.1.1/32')\",\n \"action\": \"deny\",\n \"status\": \"enabled\",\n \"deny_with\": \"Forbidden\",\n \"placement\": {\n \"position\": 1,\n \"after\": \"<string>\",\n \"before\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/filtering-rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Version"] = '<x-api-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"tr_rrETjdWcfqI6AFsk\",\n \"name\": \"Block suspicious IPs\",\n \"environment\": \"ae_rrETjdWcfqI6AFsk\",\n \"expression\": \"http.request.ip in cidr('192.168.1.1/32')\",\n \"action\": \"deny\",\n \"status\": \"enabled\",\n \"deny_with\": \"Forbidden\",\n \"placement\": {\n \"position\": 1,\n \"after\": \"<string>\",\n \"before\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Management API version.
Path Parameters
Body
application/json
ID of the filtering rule
Example:
"tr_rrETjdWcfqI6AFsk"
Name of the filtering rule
Example:
"Block suspicious IPs"
Environment ID
Example:
"ae_rrETjdWcfqI6AFsk"
Expression in expr-lang format that defines the rule condition
Example:
"http.request.ip in cidr('192.168.1.1/32')"
Action to take when the rule matches
Available options:
allow, deny Example:
"deny"
Status of the filtering rule
Available options:
enabled, disabled Error message to return when denying a request
Available options:
Forbidden Example:
"Forbidden"
Placement options for the rule
Show child attributes
Show child attributes
Response
Updated filtering rule object.
Show child attributes
Show child attributes
Was this page helpful?
⌘I