REST API endpoints

Simple History has a few WP REST API endpoints that developers can use to fetch the log themself.

To access these you must authenticate your requests.

Endpoints

Events

Contains the same data as the main events feed.

  • GET /wp-json/simple-history/v1/events
  • GET /wp-json/simple-history/v1/events/has-updates
  • GET /wp-json/simple-history/v1/events/<event-id>
  • POST /wp-json/simple-history/v1/events/<event-id>/stick
  • POST /wp-json/simple-history/v1/events/<event-id>/unstick

Query Parameters for GET /events

The events endpoint supports various query parameters for filtering and pagination:

Basic Parameters

ParameterTypeDescription
per_pageintNumber of events per page (default: 10)
pageintPage number for pagination (default: 1)
date_fromstringFilter events from this date (YYYY-MM-DD)
date_tostringFilter events until this date (YYYY-MM-DD)
searchstringSearch for events containing this text

Inclusion Filters

ParameterTypeDescription
loggers[]arrayInclude only events from these loggers
loglevels[]arrayInclude only events with these log levels
messages[]arrayInclude only specific message types (format: LoggerSlug:MessageKey)
userintInclude only events by this user ID
initiatorstringInclude only events by this initiator type

Exclusion Filters (Negative Filters)

Use these parameters to exclude events matching specific criteria:

ParameterTypeDescription
exclude_loglevels[]arrayExclude events with these log levels
exclude_loggers[]arrayExclude events from these loggers
exclude_messages[]arrayExclude specific message types (format: LoggerSlug:MessageKey)
exclude_users[]arrayExclude events by these user IDs
exclude_initiator[]arrayExclude events by these initiator types
exclude_searchstringExclude events containing this text

Valid Initiator Values

  • wp_user – Regular WordPress user actions
  • wp_cli – Actions performed via WP-CLI
  • wp – WordPress system actions (cron jobs, automatic updates)
  • web_user – Non-logged-in web visitors
  • other – Other sources

Example Requests

# Get events excluding debug level
curl -u user:app-password \
  'https://example.com/wp-json/simple-history/v1/events?exclude_loglevels[]=debug'

# Get events excluding WordPress system actions
curl -u user:app-password \
  'https://example.com/wp-json/simple-history/v1/events?exclude_initiator[]=wp'

# Get user events, excluding cron-related entries
curl -u user:app-password \
  'https://example.com/wp-json/simple-history/v1/events?initiator=wp_user&exclude_search=cron'

# Get events excluding multiple loggers
curl -u user:app-password \
  'https://example.com/wp-json/simple-history/v1/events?exclude_loggers[]=SimplePluginLogger&exclude_loggers[]=SimpleThemeLogger'Code language: PHP (php)

Note: When the same value appears in both an inclusion and exclusion filter, exclusion takes precedence.

Stats

These endpoints contain the same data as the Premium add-on uses on the Stats and Summaries page/History insights page.

  • /wp-json/simple-history/v1/stats/summary – Brief overview with total counts for events, users, content, media, plugins, and core updates
  • /wp-json/simple-history/v1/stats/activity-overview – Daily activity breakdown
  • /wp-json/simple-history/v1/stats/peak-days – High activity day analysis
  • /wp-json/simple-history/v1/stats/peak-times – Peak activity time patterns
  • /wp-json/simple-history/v1/stats/users – Detailed user activity insights
  • /wp-json/simple-history/v1/stats/content – Content modification statistics
  • /wp-json/simple-history/v1/stats/media – Media upload and management metrics
  • /wp-json/simple-history/v1/stats/plugins – Plugin installation and update data
  • /wp-json/simple-history/v1/stats/core – WordPress core update tracking