Contents
On this page

Update View - Plugixa Activity Log

PATCH /plugixa-activity-log/v1/views/{id}

Rename a saved view, replace its filters, share or unshare it, or make it your default. PUT works the same way.

Needs the view access level (who can call what). Your own views are yours to change; somebody else’s shared view needs settings access.

Request

PATCH https://your-site.example/wp-json/plugixa-activity-log/v1/views/4

Path parameters

Name Type Description
id integer The view’s id

Request body

Content type: application/json

Send only the fields you are changing: a field you leave out keeps its stored value.

Field Type Required Description
name string No At most 100 characters. Must not be blank, and must be unique among the owner’s views.
filters object No Replaces the saved filters whole. Same keys as in Create View.
shared boolean No Changing it needs settings access. Sending the current value is always accepted.
is_default boolean No Only the owner can send it. true clears that mark from the owner’s other views.
{
  "name": "Failed sign-ins this month",
  "filters": { "group": "authentication", "action": "failed", "date_preset": "30d" }
}

Responses

200 OK. data is your whole list of views after the change.

{
  "success": true,
  "data": [
    {
      "id": 4,
      "user_id": 1,
      "name": "Failed sign-ins this month",
      "filters": { "group": "authentication", "action": "failed", "date_preset": "30d" },
      "shared": false,
      "is_default": true,
      "created_at": "2026-11-12T09:30:00Z",
      "updated_at": "2026-11-12T10:15:00Z",
      "own": true,
      "editable": true
    }
  ]
}

The fields are as in List Views.

Errors

Status Code When
404 plugixa_activity_log_not_found No view with that id, or a view of somebody else that is not shared.
403 plugixa_activity_log_forbidden Somebody else’s shared view without settings access, a change to shared without it, or is_default sent for somebody else’s view.
422 plugixa_activity_log_view_name name is blank.
409 plugixa_activity_log_view_exists The owner already has another view with that name.

Plus the errors every endpoint can return.

Examples

curl -s -X PATCH "https://your-site.example/wp-json/plugixa-activity-log/v1/views/4" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Failed sign-ins this month","filters":{"group":"authentication","action":"failed","date_preset":"30d"}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/views/4');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'name'    => 'Failed sign-ins this month',
        'filters' => ['group' => 'authentication', 'action' => 'failed', 'date_preset' => '30d'],
    ]),
]);
$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/4', {
  method: 'PATCH',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Failed sign-ins this month',
    filters: { group: 'authentication', action: 'failed', date_preset: '30d' },
  }),
});
const { data } = await response.json();

Quick Links

Share