Contents
On this page

End All Sessions - Plugixa Activity Log

POST /plugixa-activity-log/v1/sessions/{user_id}/end-all

End every session of one user: they are signed out on every device.

You may call it for your own user id with any signed-in account; for anybody else you need settings access (see who can call what). Needs Plugixa Activity Log Pro, with the User sessions module on under Plugixa Activity Log -> Monitors.

When at least one session ended, the log records it as event 9201, or 9204 when your current session was kept. Application Passwords are not sessions: the user’s passwords keep working.

Request

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

Path parameters

Name Type Description
user_id integer The WordPress user id

Request body

Content type: application/json. Optional.

Field Type Required Description
except_current boolean No Keep the session making this request. Only counts for your own user id from a signed-in browser; over Application Passwords there is no current session, so everything ends. Only true, 1, "1" and "true" count as yes.
{
  "except_current": false
}

Responses

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

{
  "success": true,
  "data": { "ended": 3 }
}
Field Type Meaning
data.ended integer Sessions ended, 0 when the user had none

Errors

Status Code When
404 plugixa_activity_log_session_not_found No user with that id.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share