Contents
On this page
Update Alert Rule - Plugixa Activity Log
PUT /plugixa-activity-log/v1/rules/{id}
Change an alert rule. PATCH does exactly the same.
Needs settings access (see who can call what). Needs Plugixa Activity Log Pro, with the Alert rules module on under Plugixa Activity Log -> Monitors.
Note. A top-level field you leave out keeps its stored value, but
conditionsandchannelsare replaced whole when you send them: a condition missing from theconditionsyou send is cleared, and the channel list becomes exactly the one you send. Awebhookchannel sent without itssecret, or with a value other than the masked one, loses the stored secret. Send the masked value from Get Alert Rule back unchanged to keep it.
Request
PUT https://your-site.example/wp-json/plugixa-activity-log/v1/rules/4
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The rule’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank when sent. |
enabled |
boolean |
No | Only true, 1, "1" and "true" count as on. |
conditions |
object |
No | Replaces the stored conditions. Fields as on Create Alert Rule. |
channels |
array |
No | Replaces the stored channels. At least one usable channel must remain. |
throttle_minutes |
integer |
No | 0 to 1440. |
A secret is matched back by its mask: the stored secret whose masked form equals what you send is kept, preferring the channel with the same target. The change is recorded in the log as event 9120.
{
"enabled": false,
"throttle_minutes": 60
}
Responses
200 OK. data is the updated rule.
{
"success": true,
"data": {
"id": 4,
"name": "Administrator sign-ins from outside the office",
"enabled": false,
"conditions": {
"codes": [],
"groups": ["authentication"],
"min_severity": "medium",
"severities": [],
"user_roles": ["administrator"],
"user_ids": [],
"ips": ["203.0.113.0/24"],
"object_types": [],
"search": ""
},
"channels": [
{ "type": "email", "target": "security@example.com", "secret": "", "has_secret": false },
{ "type": "webhook", "target": "https://hooks.example.com/activity", "secret": "••••cret", "has_secret": true }
],
"throttle_minutes": 60,
"created_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:15:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.enabled |
boolean |
Whether the rule is checked against new events |
data.channels[].has_secret |
boolean |
Check this after a change to be sure a webhook kept its secret |
data.throttle_minutes |
integer |
0 sends every match |
data.modified_at |
string |
UTC datetime of this change |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_activity_log_not_found |
No rule with that id. |
422 |
plugixa_activity_log_invalid |
name is blank, no usable channel is left, or an email channel’s address is not valid. |
422 |
plugixa_activity_log_unsafe_url |
A channel’s address is not a valid URL, does not use https://, or points at this machine or a private network. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-activity-log/v1/rules/4" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"enabled":false,"throttle_minutes":60}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/rules/4');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'enabled' => false,
'throttle_minutes' => 60,
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-activity-log/v1/rules/4', {
method: 'PUT',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: false, throttle_minutes: 60 }),
});
const { data } = await response.json();
Quick Links
Share