Skip to content
Get started

List rules for a detector

GET/api/detectors/{detectorId}/rules

List rules for a detector

Path ParametersExpand Collapse
detectorId: string
ReturnsExpand Collapse
errors: array of object { code, message }
code: number
minimum1000
message: string
messages: array of object { code, message }
code: number
minimum1000
message: string
result: object { rules }
rules: array of object { id, condition, detectorId, 4 more }
id: string
condition: Condition
One of the following:
LeafCondition object { leaf }
leaf: object { fact, op, value }
fact: string
op: "eq" or "neq" or "in" or 4 more
One of the following:
"eq"
"neq"
"in"
"nin"
"contains"
"matches"
"between"
value: string or number or boolean or 2 more
One of the following:
string
number
boolean
array of string
array of number
RefCondition object { ref }
ref: object { fact, op, reference }
fact: string
op: "eq" or "neq" or "in" or "nin"
One of the following:
"eq"
"neq"
"in"
"nin"
reference: string
InRelationCondition object { in_relation }
in_relation: object { args, relation }
args: array of unknown
relation: string
AllCondition object { all }
all: array of Condition
AnyCondition object { any }
any: array of Condition
NotCondition object { not }
OnceCondition object { once }
once: Condition
HistoricallyCondition object { historically }
historically: Condition
SinceCondition object { since }
since: object { left, right }
left: Condition
right: Condition
OnceWithinCondition object { once_within }
once_within: object { inner, window_secs }
inner: Condition
window_secs: number
HistoricallyForCondition object { historically_for }
historically_for: object { inner, window_secs, boundary }
inner: Condition
window_secs: number
boundary: optional "weak" or "strong"
One of the following:
"weak"
"strong"
SinceWithinCondition object { since_within }
since_within: object { left, right, window_secs }
left: Condition
right: Condition
window_secs: number
KeyedCondition object { keyed }
keyed: object { inner, key }
inner: Condition
key: string
detectorId: string
enabled: boolean
name: string
notify: boolean
priority: number
success: boolean

List rules for a detector

curl https://rake.dev/api/detectors/$DETECTOR_ID/rules \
    -H "Authorization: Bearer $RAKE_API_KEY"
{
  "errors": [
    {
      "code": 1000,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message"
    }
  ],
  "result": {
    "rules": [
      {
        "id": "id",
        "condition": {
          "leaf": {
            "fact": "fact",
            "op": "eq",
            "value": "string"
          }
        },
        "detectorId": "detectorId",
        "enabled": true,
        "name": "name",
        "notify": true,
        "priority": 0
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message"
    }
  ],
  "result": {
    "rules": [
      {
        "id": "id",
        "condition": {
          "leaf": {
            "fact": "fact",
            "op": "eq",
            "value": "string"
          }
        },
        "detectorId": "detectorId",
        "enabled": true,
        "name": "name",
        "notify": true,
        "priority": 0
      }
    ]
  },
  "success": true
}