Read a rule and one definition version for editing
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | — |
version |
query | integer | No | Defaults to the latest draft/version. min 1 |
Request
This endpoint has no request body.
curl "$MONICHEK_API/rules/{id}" \
-H "Authorization: Bearer $MONICHEK_API_KEY"const res = await fetch(`${MONICHEK_API}/rules/{id}`, {
method: "GET",
headers: {
Authorization: `Bearer ${MONICHEK_API_KEY}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
f"{os.environ['MONICHEK_API']}/rules/{id}",
headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/rules/{id}');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MONICHEK_API_KEY'),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Replace {id} with the resource id.
Responses
200 OK
rule with definition and version history
application/json
{
"object": "string",
"id": "id_01M3R...",
"key": "rule_key",
"name": "Ada Okafor",
"typology": "string",
"version": 1,
"state": "string",
"definition": {
"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"
}
},
"versions": [
{}
]
}Response fields
| Field | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
string | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id |
string | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
key |
string | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name |
string | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
typology |
string | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
version |
integer | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
state |
string | No | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
definition |
object | No | Show 13 nested fields
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
versions |
array of object | No | — |
Error responses
| Status | Meaning | Body |
|---|---|---|
| 404 | Not Found | RFC 9457 problem |
Errors use the RFC 9457 problem format with a stable code.