Contents
Create Report Schedule - Plugixa Activity Log
POST /plugixa-activity-log/v1/reports/schedules
Create a report that is built and emailed on a schedule.
Needs settings access (see who can call what). Needs Plugixa Activity Log Pro, with the Reports module on under Plugixa Activity Log -> Monitors.
Request
POST https://your-site.example/wp-json/plugixa-activity-log/v1/reports/schedules
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | Must not be blank. At most 191 characters. Used as the report title. |
recipients |
array |
Yes | Email addresses, 1 to 20. A single string separated by commas, semicolons or spaces is accepted too. Duplicates are merged. |
frequency |
string |
No | daily, weekly (the default) or monthly. |
weekday |
integer |
No | Weekly only: 0 (Sunday) to 6. Default 1. |
monthday |
integer |
No | Monthly only: 1 to 28. Default 1. |
hour |
integer |
No | 0 to 23, on the site’s clock. Default 7. |
format |
string |
No | html (the default) or csv. |
sections |
array |
No | As for Run Report. All six when left out. |
filters |
object |
No | As for Run Report. |
enabled |
boolean |
No | Default true. Only true, 1, "1" or "true" count as on. |
weekday, monthday and hour outside their range are brought back into it rather than refused. next_run_at is worked out for you. On multisite, a schedule created by somebody who cannot see the whole network reports on their own site only; otherwise it covers every site (site_id 0).
{
"name": "Weekly security summary",
"frequency": "weekly",
"weekday": 1,
"hour": 7,
"format": "html",
"sections": ["summary", "by_severity", "events"],
"filters": { "min_severity": "high" },
"recipients": ["owner@example.com"]
}
Responses
201 Created. data is the new schedule.
{
"success": true,
"data": {
"id": 3,
"name": "Weekly security summary",
"enabled": true,
"frequency": "weekly",
"weekday": 1,
"monthday": 1,
"hour": 7,
"format": "html",
"sections": ["summary", "by_severity", "events"],
"filters": { "min_severity": "high" },
"recipients": ["owner@example.com"],
"site_id": 0,
"last_run_at": null,
"last_status": "",
"last_error": "",
"next_run_at": "2026-11-16 07:00:00",
"created_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 09:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The new schedule’s id |
data.next_run_at |
string|null |
UTC datetime of the first run, null when created switched off |
data.site_id |
integer |
The site it reports on, 0 for every site |
data.filters |
object|array |
The filters kept. An empty [] when there are none |
The other fields are described on List Report Schedules.
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_activity_log_invalid_schedule |
A field is not acceptable: blank name, unknown frequency or format, no known section, no recipient, an address that is not an email, or more than 20 recipients. data.field names the field. |
500 |
plugixa_activity_log_save_failed |
The schedule could not be stored. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-activity-log/v1/reports/schedules" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"name":"Weekly security summary","frequency":"weekly","weekday":1,"hour":7,"format":"html","sections":["summary","by_severity","events"],"filters":{"min_severity":"high"},"recipients":["owner@example.com"]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/reports/schedules');
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' => 'Weekly security summary',
'frequency' => 'weekly',
'weekday' => 1,
'hour' => 7,
'format' => 'html',
'sections' => ['summary', 'by_severity', 'events'],
'filters' => ['min_severity' => 'high'],
'recipients' => ['owner@example.com'],
]),
]);
$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/reports/schedules', {
method: 'POST',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Weekly security summary',
frequency: 'weekly',
weekday: 1,
hour: 7,
format: 'html',
sections: ['summary', 'by_severity', 'events'],
filters: { min_severity: 'high' },
recipients: ['owner@example.com'],
}),
});
const { data } = await response.json();
Quick Links
Share