# Calendar sync Trigger a manual sync of all connected calendars to fetch the latest events. Manually trigger a synchronization of all connected calendar providers for the authenticated user. This fetches the latest events from each connected calendar and updates the local event store. Syncs happen automatically on a schedule, but this endpoint allows on-demand refresh. ## Returns Returns a sync result summary with counts of synced calendars, new events, updated events, and any errors encountered. | Field | Type | Description | | --- | --- | --- | | `synced_calendars` | integer | Number of calendars successfully synced | | `new_events` | integer | Number of new events discovered | | `updated_events` | integer | Number of existing events updated | | `errors` | array | List of error messages for failed syncs | Request ```bash cURL curl -s -X POST "https://api.aitronos.com/v1/meeting-buddy/calendar/sync" \ -H "Authorization: Bearer $ACCESS_TOKEN" | python3 -m json.tool ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.meeting_buddy.calendar.sync() print(f"Synced: {result.synced_calendars} calendars") print(f"New events: {result.new_events}") print(f"Updated events: {result.updated_events}") if result.errors: print(f"Errors: {result.errors}") ``` ```python Python import os import requests access_token = os.environ["ACCESS_TOKEN"] url = "https://api.aitronos.com/v1/meeting-buddy/calendar/sync" headers = {"Authorization": f"Bearer {access_token}"} response = requests.post(url, headers=headers) data = response.json() print(f"Synced: {data['synced_calendars']} calendars") print(f"New events: {data['new_events']}") ``` ```javascript JavaScript const accessToken = process.env.ACCESS_TOKEN; const response = await fetch( 'https://api.aitronos.com/v1/meeting-buddy/calendar/sync', { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}`, }, } ); const data = await response.json(); console.log(`Synced: ${data.synced_calendars} calendars`); console.log(`New events: ${data.new_events}`); ``` Response ```json 200 OK { "synced_calendars": 2, "new_events": 15, "updated_events": 3, "errors": [] } ``` ```json 200 OK (with errors) { "synced_calendars": 1, "new_events": 8, "updated_events": 1, "errors": [ "outlook_calendar: Token expired, please reconnect" ] } ``` ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication is required to access this resource.", "type": "client_error", "status": 401, "details": {}, "trace_id": "abc-123-def", "timestamp": "2026-03-03T10:00:00Z" } } ``` ## Related Resources - [Calendar Events](/docs/api-reference/meeting-buddy/calendar-events) - [Calendar Connections](/docs/api-reference/meeting-buddy/calendar-connections) - [Auto-Join Rules](/docs/api-reference/meeting-buddy/auto-join-rules) - [List Sessions](/docs/api-reference/meeting-buddy/list-sessions)