Set filtering rules
curl --request POST \
--url https://management-api.fpjs.io/filtering-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"environment": "<string>",
"allow": [
"<string>"
],
"deny": [
"<string>"
]
}
'import requests
url = "https://management-api.fpjs.io/filtering-rules"
payload = {
"environment": "<string>",
"allow": ["<string>"],
"deny": ["<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({environment: '<string>', allow: ['<string>'], deny: ['<string>']})
};
fetch('https://management-api.fpjs.io/filtering-rules', 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",
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([
'environment' => '<string>',
'allow' => [
'<string>'
],
'deny' => [
'<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"
payload := strings.NewReader("{\n \"environment\": \"<string>\",\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<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")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment\": \"<string>\",\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/filtering-rules")
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 \"environment\": \"<string>\",\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "origin",
"environment": "ae_rrETjdWcfqI6AFsk",
"allow": [
"example.com",
"my-website.com"
],
"deny": [
"*"
]
}
]
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}filtering-rules
Set filtering rules
deprecated
Creates or updates filtering rules for an environment in bulk. This action will overwrite any existing filtering rules on specified environment. If there is no filtering rules for an environment, this action creates them. To completely remove filtering rules, set both allow and deny lists to an empty array ([]).
Currently only supports origin domain filtering.
Note: It can take up to 5 minutes to start filtering incoming requests after setting a rule.
POST
/
filtering-rules
Set filtering rules
curl --request POST \
--url https://management-api.fpjs.io/filtering-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"environment": "<string>",
"allow": [
"<string>"
],
"deny": [
"<string>"
]
}
'import requests
url = "https://management-api.fpjs.io/filtering-rules"
payload = {
"environment": "<string>",
"allow": ["<string>"],
"deny": ["<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({environment: '<string>', allow: ['<string>'], deny: ['<string>']})
};
fetch('https://management-api.fpjs.io/filtering-rules', 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",
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([
'environment' => '<string>',
'allow' => [
'<string>'
],
'deny' => [
'<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"
payload := strings.NewReader("{\n \"environment\": \"<string>\",\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<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")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment\": \"<string>\",\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.fpjs.io/filtering-rules")
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 \"environment\": \"<string>\",\n \"allow\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "origin",
"environment": "ae_rrETjdWcfqI6AFsk",
"allow": [
"example.com",
"my-website.com"
],
"deny": [
"*"
]
}
]
}{
"error": {
"message": "<string>",
"code": "<string>",
"violations": [
{
"property": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}Authorizations
Body
application/json
Was this page helpful?