Validate in-flight rule array
curl --request POST \
--url https://api.platform.bitnob.com/policies/validate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"description": "<string>",
"name": "High-value transfer review",
"rules": [
{
"action_type": "require_approval",
"action_config": [
"<string>"
],
"conditions": [
{
"field": "amount_usd",
"operator": "greater_than",
"max": "500",
"min": "100",
"value": "10000",
"values": "[\"BTC\",\"ETH\"]"
}
],
"description": "<string>",
"name": "Block large transfers",
"order": 1
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
name: 'High-value transfer review',
rules: [
{
action_type: 'require_approval',
action_config: ['<string>'],
conditions: [
{
field: 'amount_usd',
operator: 'greater_than',
max: '500',
min: '100',
value: '10000',
values: '["BTC","ETH"]'
}
],
description: '<string>',
name: 'Block large transfers',
order: 1
}
]
})
};
fetch('https://api.platform.bitnob.com/policies/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.bitnob.com/policies/validate"
payload = {
"description": "<string>",
"name": "High-value transfer review",
"rules": [
{
"action_type": "require_approval",
"action_config": ["<string>"],
"conditions": [
{
"field": "amount_usd",
"operator": "greater_than",
"max": "500",
"min": "100",
"value": "10000",
"values": "[\"BTC\",\"ETH\"]"
}
],
"description": "<string>",
"name": "Block large transfers",
"order": 1
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.platform.bitnob.com/policies/validate",
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([
'description' => '<string>',
'name' => 'High-value transfer review',
'rules' => [
[
'action_type' => 'require_approval',
'action_config' => [
'<string>'
],
'conditions' => [
[
'field' => 'amount_usd',
'operator' => 'greater_than',
'max' => '500',
'min' => '100',
'value' => '10000',
'values' => '["BTC","ETH"]'
]
],
'description' => '<string>',
'name' => 'Block large transfers',
'order' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.platform.bitnob.com/policies/validate"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"name\": \"High-value transfer review\",\n \"rules\": [\n {\n \"action_type\": \"require_approval\",\n \"action_config\": [\n \"<string>\"\n ],\n \"conditions\": [\n {\n \"field\": \"amount_usd\",\n \"operator\": \"greater_than\",\n \"max\": \"500\",\n \"min\": \"100\",\n \"value\": \"10000\",\n \"values\": \"[\\\"BTC\\\",\\\"ETH\\\"]\"\n }\n ],\n \"description\": \"<string>\",\n \"name\": \"Block large transfers\",\n \"order\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.platform.bitnob.com/policies/validate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"name\": \"High-value transfer review\",\n \"rules\": [\n {\n \"action_type\": \"require_approval\",\n \"action_config\": [\n \"<string>\"\n ],\n \"conditions\": [\n {\n \"field\": \"amount_usd\",\n \"operator\": \"greater_than\",\n \"max\": \"500\",\n \"min\": \"100\",\n \"value\": \"10000\",\n \"values\": \"[\\\"BTC\\\",\\\"ETH\\\"]\"\n }\n ],\n \"description\": \"<string>\",\n \"name\": \"Block large transfers\",\n \"order\": 1\n }\n ]\n}")
.asString();{
"diagnostics": [
{
"code": "unreachable_rule",
"rule_index": 0,
"severity": "warning"
}
],
"issue_count": {
"error": 0,
"info": 0,
"warning": 1
},
"valid": true
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}Policies
Validate in-flight rule array
Validate a proposed rule array without persisting. Use this to lint a policy before submitting POST /v1/policies. Side-effect-free.
POST
/
policies
/
validate
Validate in-flight rule array
curl --request POST \
--url https://api.platform.bitnob.com/policies/validate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"description": "<string>",
"name": "High-value transfer review",
"rules": [
{
"action_type": "require_approval",
"action_config": [
"<string>"
],
"conditions": [
{
"field": "amount_usd",
"operator": "greater_than",
"max": "500",
"min": "100",
"value": "10000",
"values": "[\"BTC\",\"ETH\"]"
}
],
"description": "<string>",
"name": "Block large transfers",
"order": 1
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
name: 'High-value transfer review',
rules: [
{
action_type: 'require_approval',
action_config: ['<string>'],
conditions: [
{
field: 'amount_usd',
operator: 'greater_than',
max: '500',
min: '100',
value: '10000',
values: '["BTC","ETH"]'
}
],
description: '<string>',
name: 'Block large transfers',
order: 1
}
]
})
};
fetch('https://api.platform.bitnob.com/policies/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.bitnob.com/policies/validate"
payload = {
"description": "<string>",
"name": "High-value transfer review",
"rules": [
{
"action_type": "require_approval",
"action_config": ["<string>"],
"conditions": [
{
"field": "amount_usd",
"operator": "greater_than",
"max": "500",
"min": "100",
"value": "10000",
"values": "[\"BTC\",\"ETH\"]"
}
],
"description": "<string>",
"name": "Block large transfers",
"order": 1
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.platform.bitnob.com/policies/validate",
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([
'description' => '<string>',
'name' => 'High-value transfer review',
'rules' => [
[
'action_type' => 'require_approval',
'action_config' => [
'<string>'
],
'conditions' => [
[
'field' => 'amount_usd',
'operator' => 'greater_than',
'max' => '500',
'min' => '100',
'value' => '10000',
'values' => '["BTC","ETH"]'
]
],
'description' => '<string>',
'name' => 'Block large transfers',
'order' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.platform.bitnob.com/policies/validate"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"name\": \"High-value transfer review\",\n \"rules\": [\n {\n \"action_type\": \"require_approval\",\n \"action_config\": [\n \"<string>\"\n ],\n \"conditions\": [\n {\n \"field\": \"amount_usd\",\n \"operator\": \"greater_than\",\n \"max\": \"500\",\n \"min\": \"100\",\n \"value\": \"10000\",\n \"values\": \"[\\\"BTC\\\",\\\"ETH\\\"]\"\n }\n ],\n \"description\": \"<string>\",\n \"name\": \"Block large transfers\",\n \"order\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.platform.bitnob.com/policies/validate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"name\": \"High-value transfer review\",\n \"rules\": [\n {\n \"action_type\": \"require_approval\",\n \"action_config\": [\n \"<string>\"\n ],\n \"conditions\": [\n {\n \"field\": \"amount_usd\",\n \"operator\": \"greater_than\",\n \"max\": \"500\",\n \"min\": \"100\",\n \"value\": \"10000\",\n \"values\": \"[\\\"BTC\\\",\\\"ETH\\\"]\"\n }\n ],\n \"description\": \"<string>\",\n \"name\": \"Block large transfers\",\n \"order\": 1\n }\n ]\n}")
.asString();{
"diagnostics": [
{
"code": "unreachable_rule",
"rule_index": 0,
"severity": "warning"
}
],
"issue_count": {
"error": 0,
"info": 0,
"warning": 1
},
"valid": true
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"type": "<string>"
}
}Authorizations
Headers
API version (defaults to the latest supported version if omitted).
Available options:
v1 Unique key (1-255 printable ASCII chars) used to safely retry write operations. Same key + body returns the cached response; same key + different body returns 409.
Required string length:
1 - 255Body
application/json