Skip to main content
PATCH
/
orgs
/
{orgId}
/
anomaly-rules
/
{ruleId}
cURL
curl --request PATCH \
  --url https://api.useanima.sh/v1/orgs/{orgId}/anomaly-rules/{ruleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "threshold": 1,
  "cooldownMinutes": 5040,
  "enabled": true
}
'
{
  "id": "<string>",
  "orgId": "<string>",
  "name": "<string>",
  "threshold": 123,
  "cooldownMinutes": 123,
  "enabled": true,
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

Authorization
string
header
required

JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer

Path Parameters

orgId
string
required

Organization identifier

ruleId
string
required

Rule identifier

Body

application/json

Input for updating an anomaly detection rule

name
string
Required string length: 1 - 200
threshold
number
Required range: x >= 0
severity
enum<string>

Severity level of the anomaly alert

Available options:
INFO,
WARNING,
CRITICAL
quarantineAction
enum<string>

Quarantine action to take when rule triggers

Available options:
NONE,
SOFT,
HARD
cooldownMinutes
integer
Required range: 0 <= x <= 10080
enabled
boolean

Response

200 - application/json

OK

An anomaly detection rule

id
string
required

Unique rule identifier

orgId
string
required

Organization identifier

name
string
required

Human-readable rule name

metric
enum<string>
required

Type of metric being tracked

Available options:
email_send_rate,
sms_send_rate,
vault_access_rate,
api_call_rate,
unique_recipients
condition
enum<string>
required

Detection condition type

Available options:
zscore_gt,
rate_multiplier_gt,
absolute_gt,
time_violation
threshold
number
required

Threshold value for the condition

severity
enum<string>
required

Severity level of the anomaly alert

Available options:
INFO,
WARNING,
CRITICAL
quarantineAction
enum<string>
required

Quarantine action to take when rule triggers

Available options:
NONE,
SOFT,
HARD
cooldownMinutes
integer
required

Minutes to wait between alerts for this rule

enabled
boolean
required

Whether the rule is active

createdAt
string
required

ISO 8601 creation timestamp

updatedAt
string
required

ISO 8601 last update timestamp