Contents
On this page
Create View - Plugixa Activity Log
POST /plugixa-activity-log/v1/views
Save a named set of log filters for yourself, or for every reader.
Needs the view access level (who can call what). Sharing a view needs settings access.
Request
POST https://your-site.example/wp-json/plugixa-activity-log/v1/views
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | At most 100 characters. Must be unique among your own views. |
filters |
object |
No | The log filters to save. See below. |
shared |
boolean |
No | true shows the view to every reader. Defaults to false. |
is_default |
boolean |
No | true makes it the view your log opens with, and clears that mark from your other views. Defaults to false. |
filters keeps these keys, each as a string of at most 200 characters: search, group, event_code, object_type, action, user_id, user_label, user_login, user_role, ip, date_from, date_to, plus severity (a list or a comma-separated string of severities) and date_preset (today, yesterday, 7d or 30d, which replaces date_from and date_to). You can save up to 50 views.
Note. Any other key in
filtersis dropped without an error, including some the log itself accepts:min_severity,module,object_idandsite_idcannot be saved in a view.
{
"name": "Failed sign-ins",
"filters": { "group": "authentication", "action": "failed", "date_preset": "7d" },
"is_default": true
}
Responses
201 Created. data is your whole list of views, the new one included.
Note. The response is the list, not the new view on its own. Find the new view in it by
name.
{
"success": true,
"data": [
{
"id": 4,
"user_id": 1,
"name": "Failed sign-ins",
"filters": { "group": "authentication", "action": "failed", "date_preset": "7d" },
"shared": false,
"is_default": true,
"created_at": "2026-11-12T09:30:00Z",
"updated_at": "2026-11-12T09:30:00Z",
"own": true,
"editable": true
}
]
}
The fields are as in List Views.
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_activity_log_view_name |
name is missing or blank. |
409 |
plugixa_activity_log_view_exists |
You already have a view with that name. |
422 |
plugixa_activity_log_view_limit |
You already have 50 views. |
403 |
plugixa_activity_log_forbidden |
shared is true and you do not have settings access. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-activity-log/v1/views" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"name":"Failed sign-ins","filters":{"group":"authentication","action":"failed","date_preset":"7d"},"is_default":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/views');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Failed sign-ins',
'filters' => ['group' => 'authentication', 'action' => 'failed', 'date_preset' => '7d'],
'is_default' => true,
]),
]);
$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/views', {
method: 'POST',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Failed sign-ins',
filters: { group: 'authentication', action: 'failed', date_preset: '7d' },
is_default: true,
}),
});
const { data } = await response.json();
Quick Links
Share