v1
OpenAPI 3.1.02026-07-13632897.9 KBSync Calendar
Manually trigger calendar sync for a user.
Used for testing and manual sync operations. Syncs Google Calendar events into focused_focus_sessions table.
Process: 1. Check needs_sync flag in Redis 2. Fetch events from Google Calendar (timeMin=-1d, timeMax=+30d) 3. Upsert events in batches of 100 4. Detect and soft-delete orphaned events 5. Update last_synced_at timestamp 6. Clear needs_sync flag
Identity Source (Increment 7D): - Primary: X-User-ID header (from MCP after JWT validation) - Fallback: payload.user_id (for backward compatibility) - Logs warning if fallback is used or mismatch detected
Returns: { "success": True, "data": { "events_fetched": int, "events_inserted": int, "events_updated": int, "events_deleted": int } }
Request body
Response
Successful Response