Simulate rule
Request
Content type: application/json · required
| Field | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rule |
object | Yes | Show 13 nested fields
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
transactions |
array of object | Yes | — |
curl -X POST "$MONICHEK_API/rules:simulate" \
-H "Authorization: Bearer $MONICHEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule": {
"key": "rule_key",
"name": "Ada Okafor",
"description": "Example note",
"typology": "string",
"trigger": {
"events": [
"string"
],
"filter": "string"
},
"features": [
{
"name": "Ada Okafor",
"agg": "count",
"window": "string",
"group_by": [
"string"
],
"where": "string",
"field": "string"
}
],
"condition": "string",
"suppress_if": "string",
"groups": [
{
"op": "all_of",
"conditions": [
"string"
]
}
],
"outcome": {
"severity": "low",
"score": 0,
"decision": "ALLOW",
"reason_code": "string",
"explain": "string"
},
"actions": [
{}
],
"params": {},
"schedule": {
"mode": "realtime",
"cron": "string"
}
},
"transactions": [
{}
]
}'const res = await fetch(`${MONICHEK_API}/rules:simulate`, {
method: "POST",
headers: {
Authorization: `Bearer ${MONICHEK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"rule": {
"key": "rule_key",
"name": "Ada Okafor",
"description": "Example note",
"typology": "string",
"trigger": {
"events": [
"string"
],
"filter": "string"
},
"features": [
{
"name": "Ada Okafor",
"agg": "count",
"window": "string",
"group_by": [
"string"
],
"where": "string",
"field": "string"
}
],
"condition": "string",
"suppress_if": "string",
"groups": [
{
"op": "all_of",
"conditions": [
"string"
]
}
],
"outcome": {
"severity": "low",
"score": 0,
"decision": "ALLOW",
"reason_code": "string",
"explain": "string"
},
"actions": [
{}
],
"params": {},
"schedule": {
"mode": "realtime",
"cron": "string"
}
},
"transactions": [
{}
]
}),
});
const data = await res.json();import os
import requests
res = requests.post(
f"{os.environ['MONICHEK_API']}/rules:simulate",
headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
json={
"rule": {
"key": "rule_key",
"name": "Ada Okafor",
"description": "Example note",
"typology": "string",
"trigger": {
"events": [
"string"
],
"filter": "string"
},
"features": [
{
"name": "Ada Okafor",
"agg": "count",
"window": "string",
"group_by": [
"string"
],
"where": "string",
"field": "string"
}
],
"condition": "string",
"suppress_if": "string",
"groups": [
{
"op": "all_of",
"conditions": [
"string"
]
}
],
"outcome": {
"severity": "low",
"score": 0,
"decision": "ALLOW",
"reason_code": "string",
"explain": "string"
},
"actions": [
{}
],
"params": {},
"schedule": {
"mode": "realtime",
"cron": "string"
}
},
"transactions": [
{}
]
},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/rules:simulate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MONICHEK_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'rule' => [
'key' => 'rule_key',
'name' => 'Ada Okafor',
'description' => 'Example note',
'typology' => 'string',
'trigger' => [
'events' => [
'string',
],
'filter' => 'string',
],
'features' => [
[
'name' => 'Ada Okafor',
'agg' => 'count',
'window' => 'string',
'group_by' => [
'string',
],
'where' => 'string',
'field' => 'string',
],
],
'condition' => 'string',
'suppress_if' => 'string',
'groups' => [
[
'op' => 'all_of',
'conditions' => [
'string',
],
],
],
'outcome' => [
'severity' => 'low',
'score' => 0,
'decision' => 'ALLOW',
'reason_code' => 'string',
'explain' => 'string',
],
'actions' => [
[],
],
'params' => [],
'schedule' => [
'mode' => 'realtime',
'cron' => 'string',
],
],
'transactions' => [
[],
],
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
200 OK
simulation
application/json
No response example is published for this status.