Skip to content

Sync protocol

Events (satellite → hub)

  • Endpoint: POST /wp-json/mindful-events-sync/v2/events/receive
  • Requires schema_version: 2, sync_id, idempotency_token
  • Hub matches existing events by _mindful_sync_id
  • Trust level: pending approval vs auto-publish per satellite registry
  • Idempotency: sync log table + transient cache on hub

Reference (hub → satellite)

  1. GET /v2/reference/types
  2. For each type: GET /v2/reference/{post_type}?page=&per_page=&modified_after=&country_id= (country_id organisers only)
  3. Local import via _mindful_hub_entity_id

Cron (production)

Schedule real server cron for WordPress if possible:

*/15 * * * * cd /path/to/wordpress && wp cron event run --due-now

Plugin hooks:

Hook Purpose
mindful_ref_pull_cron Scheduled reference pull (satellites)
mindful_events_sync_retry Retry failed event syncs
mindful_events_sync_cleanup Log retention

Verify with wp cron event list.