Contents
On this page

End Other Sessions - Plugixa Activity Log

POST /plugixa-activity-log/v1/sessions/end-others

End every session of your own account except the one making the request.

Any signed-in account may call it, whatever its role (see who can call what). It only ever acts on your own account. Needs Plugixa Activity Log Pro, with the User sessions module on under Plugixa Activity Log -> Monitors.

Note. Over Application Passwords there is no current session to keep, so this ends all of your sessions, the browser you may be signed in with included, and is recorded as “all sessions ended” rather than “other sessions ended”. From a script, it does the same as End All Sessions for your own user id.

When at least one session ended, the log records it (event 9204, or 9201 when nothing was kept). The Application Password you called with keeps working: it is not a session.

Request

POST https://your-site.example/wp-json/plugixa-activity-log/v1/sessions/end-others

Request body

None.

Responses

200 OK. data.ended is how many sessions ended.

{
  "success": true,
  "data": { "ended": 2 }
}
Field Type Meaning
data.ended integer Sessions ended, 0 when there were none

Errors

Status Code When
401 rest_forbidden Nobody is signed in. This route answers with WordPress’s own code.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-activity-log/v1/sessions/end-others" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/sessions/end-others');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$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/sessions/end-others', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share