Skip to main content

Google Calendar Integration

Connect your Google Calendar to Trix for AI-powered pre-meeting briefings and intelligent event notifications.

Overview

Google Calendar is the recommended calendar provider for most users. It offers real-time webhook notifications, excellent reliability, and simple OAuth setup.

FeatureDetails
Sync MethodReal-time webhooks (push notifications)
Rate Limit60 requests per minute
Multi-CalendarYes - Primary + shared calendars
AuthenticationOAuth 2.0 with PKCE
Webhook Expiry7 days (auto-renewed by Trix)

Connecting Google Calendar

Via CLI (Recommended)

connect.sh
# Start OAuth flow
trix integrations connect google

# Your browser will open to:
# 1. Sign in to your Google account
# 2. Grant calendar read permissions
# 3. Redirect back to CLI

# Success! Connection created

The CLI handles the entire OAuth flow automatically, including PKCE for enhanced security.

Via API

api-connect.sh
# Step 1: Initiate OAuth
curl -X POST https://api.trixdb.com/v1/integrations/oauth/initiate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google",
    "redirect_uri": "http://localhost:8080/callback"
  }'

# Response includes authorization_url - open in browser
# User grants permission, redirected to redirect_uri with code

# Step 2: Complete OAuth
curl -X POST https://api.trixdb.com/v1/integrations/oauth/callback \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google",
    "code": "AUTHORIZATION_CODE",
    "state": "STATE_FROM_STEP_1"
  }'

# Returns connection_id

Scopes Requested:
• https://www.googleapis.com/auth/calendar.readonly - Read calendar events
• https://www.googleapis.com/auth/userinfo.email - Identify account

Managing Calendars

List All Calendars

list-calendars.sh
# CLI
trix google calendar list

# Output:
# Work Calendar (primary) - Syncing
# Family Calendar - Not syncing
# Holidays - Not syncing

Enable/Disable Specific Calendars

configure-calendars.sh
# Enable a specific Google calendar
trix google calendar enable <calendar-id>

# Disable a specific Google calendar
trix google calendar disable <calendar-id>

API: Toggle Calendar Sync

api-toggle-calendar.sh
# Enable a calendar
PATCH /v1/integrations/connections/{id}/calendars/{calendar_id}
Content-Type: application/json

{
  "sync_enabled": true
}

# Disable a calendar
{
  "sync_enabled": false
}

Viewing Events

Upcoming Events

upcoming.sh
# Show all upcoming Google Calendar events
trix google calendar list

# Output:
# Today (Jan 12)
#   10:00 AM - Team Standup (30m)
#   2:00 PM - Product Review (1h)
#
# Tomorrow (Jan 13)
#   9:00 AM - 1:1 with Sarah (30m)
#   4:00 PM - Sprint Planning (2h)

Unified View (All Providers)

unified-upcoming.sh
# API: Show events from ALL connected calendars
# (Google + Microsoft + Apple)
curl "https://api.trixdb.com/v1/integrations/calendars/upcoming?days=7" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Events are merged and sorted chronologically

API: Get Events

api-events.sh
# Get upcoming events
GET /v1/integrations/connections/{id}/events?days=7

# Response
{
  "events": [
    {
      "id": "evt_abc123",
      "title": "Team Standup",
      "start": "2026-01-13T10:00:00Z",
      "end": "2026-01-13T10:30:00Z",
      "calendar_id": "primary",
      "attendees": [
        {
          "email": "[email protected]",
          "display_name": "Alice Johnson",
          "response_status": "accepted"
        }
      ],
      "location": "Conference Room A",
      "description": "Daily sync meeting",
      "conferenceData": {
        "type": "hangoutsMeet",
        "uri": "https://meet.google.com/abc-defg-hij"
      }
    }
  ],
  "total": 15
}

Real-Time Webhooks

Google Calendar uses webhooks (push notifications) to notify Trix immediately when events change. This enables real-time sync without polling.

How It Works

  1. When you connect, Trix registers a webhook with Google Calendar
  2. Google sends notifications when events are created/updated/deleted
  3. Trix processes the notification and updates your memories
  4. Webhook subscriptions expire after 7 days
  5. Trix automatically renews them before expiration (hourly check)

Zero Configuration Required!
Webhook setup, renewal, and management are fully automated. You don't need to do anything.

Webhook URL

For self-hosted deployments, Google Calendar webhooks are received at:

webhook-url.txt
https://your-api-domain.com/v1/integrations/webhooks/google

Make sure this URL is publicly accessible and returns 200 OK for verification requests.

Calendar-Specific Features

Google Meet Integration

Events with Google Meet links are automatically detected and included in event data:

conference-data.json
{
  "conferenceData": {
    "type": "hangoutsMeet",
    "uri": "https://meet.google.com/abc-defg-hij",
    "entryPoints": [
      {
        "entryPointType": "video",
        "uri": "https://meet.google.com/abc-defg-hij"
      }
    ]
  }
}

Recurring Events

Recurring events are expanded into individual instances. You'll see each occurrence as a separate event in your upcoming list.

Shared Calendars

Calendars shared with you appear in the calendar list. Enable sync for any calendar you have at least "See all event details" permission.

Permissions & Privacy

What Trix Can Access

  • Read calendar events (title, time, location, attendees, description)
  • List available calendars
  • Receive webhook notifications for changes
  • Cannot create or modify events (read-only)
  • Cannot delete events
  • Cannot share calendars or change settings

Revoking Access

You can revoke Trix's access at any time:

Option 1: Via Trix CLI

revoke-cli.sh
# Disconnect and delete all synced data
trix integrations disconnect <connection-id>

Option 2: Via Google Account

  1. Go to myaccount.google.com/permissions
  2. Find "Trix" in the list of apps
  3. Click "Remove Access"

Revoking access via Google will cause sync to fail until you reconnect. Disconnecting via CLI is recommended as it properly cleans up webhooks and data.

Troubleshooting

Common Issues

ProblemSolution
OAuth flow opens wrong Google accountSign out of all Google accounts, then reconnect
Events from 3+ days ago not showingTrix only syncs upcoming events, not historical
"Invalid grant" errorToken expired. Disconnect and reconnect
Webhooks not workingTry manual sync: trix integrations sync
Missing calendar in listEnsure calendar is shared with connected account

Get Detailed Diagnostics

troubleshoot.sh
# Run built-in troubleshooter
trix integrations troubleshoot google

# Output:
# OAuth token valid (expires in 3542 minutes)
# Webhook subscription active (renews in 6 days)
# Last sync: 2 minutes ago (success)
# Rate limit: 15/60 requests used
#
# Connection healthy!

Rate Limits

Google Calendar API allows 60 requests per minute per user. Trix automatically manages this with:

  • Smart batching - Multiple calendars fetched in parallel
  • Exponential backoff - Retries with increasing delays
  • Request tracking - Monitors usage to stay under limits
  • Webhook-first - Minimizes API calls via push notifications

For most users, you'll never hit the rate limit. Webhooks handle most updates without API calls, and batch operations optimize the rest.

Next Steps