Contents
On this page

Run Report - Plugixa Activity Log

POST /plugixa-activity-log/v1/reports/run

Build a report for a period, with the sections and filters you choose, and get it back as a CSV or HTML file.

Needs the export access level (see who can call what). Needs Plugixa Activity Log Pro, with the Reports module on under Plugixa Activity Log -> Monitors. Reports depends on the CSV export module, so both must be on.

Note. Every run is recorded in the log, as event 9006, with its title, format, sections, filters and period.

Request

POST https://your-site.example/wp-json/plugixa-activity-log/v1/reports/run

Request body

Content type: application/json

Field Type Required Description
title string No At most 120 characters. Defaults to Activity report. Also names the file.
format string No csv (the default) or html.
sections array No Any of summary, by_severity, by_group, by_user, by_ip, events. All six when left out. Unknown names are dropped.
days integer No The last N days of the site’s calendar, today included. 1 to 365, default 30. A value outside that range is brought back into it, not refused. Ignored when date_from and date_to are sent.
date_from string No Start date, YYYY-MM-DD on the site’s calendar. Send it together with date_to.
date_to string No End date, inclusive, YYYY-MM-DD. Must not be before date_from.
filters object No Any of severity, min_severity, event_code, group, module, user_id, user_login, user_role, ip, object_type, object_id, action, search, site_id, with the meanings of the List Events filters. Other keys are dropped. A list value is joined with commas.
Section Contains
summary Events, high or critical events, failed sign-ins, distinct users and distinct IP addresses
by_severity A count per severity
by_group A count per area
by_user The 25 most active logins
by_ip The 25 most frequent addresses
events The events themselves, oldest first, at most 50,000

On multisite, a site administrator’s report only covers their own site.

{
  "title": "Sign-ins, last 7 days",
  "format": "html",
  "days": 7,
  "sections": ["summary", "by_user", "events"],
  "filters": { "group": "authentication" }
}

Responses

200 OK. The body is the report file, not JSON.

For csv:

Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="sign-ins-last-7-days-2026-11-06-to-2026-11-12.csv"
X-Content-Type-Options: nosniff

For html:

Content-Type: text/html; charset=utf-8
Content-Disposition: attachment; filename="sign-ins-last-7-days-2026-11-06-to-2026-11-12.html"
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'

The file name is the title made into a slug, then the period and the extension. The CSV file starts with the title, site, period, generation time and filters, then one block per section; the events block has the columns Time, Severity, Code, Area, User, Role, IP address, Object and Message. The HTML file is a self-contained page with the same content as tables.

Note. When the events section reaches 50,000 rows, the HTML report says “Only the first 50,000 events are listed.” The CSV report stops at the same point without saying so.

Errors

Status Code When
422 plugixa_activity_log_invalid_format format is not csv or html.
422 plugixa_activity_log_no_sections sections names no known section.
422 plugixa_activity_log_invalid_period Only one of date_from and date_to is sent, one is not a valid YYYY-MM-DD date, or the start is after the end.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-activity-log/v1/reports/run" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"title":"Sign-ins, last 7 days","format":"html","days":7,"sections":["summary","by_user","events"],"filters":{"group":"authentication"}}' \
  -o report.html
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/reports/run');
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([
        'title'    => 'Sign-ins, last 7 days',
        'format'   => 'html',
        'days'     => 7,
        'sections' => ['summary', 'by_user', 'events'],
        'filters'  => ['group' => 'authentication'],
    ]),
]);
file_put_contents('report.html', curl_exec($ch));
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/reports/run', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Sign-ins, last 7 days',
    format: 'html',
    days: 7,
    sections: ['summary', 'by_user', 'events'],
    filters: { group: 'authentication' },
  }),
});
const html = await response.text();

Quick Links

Share