> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.swellsystem.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Calendar Connections

# Calendar Connections

Connect your external calendars (Google Calendar, Outlook, etc.) to sync bookings and avoid double-booking.

## Why Connect Calendars?

Connecting external calendars:
- **Prevents Double-Booking**: External events block your availability
- **Syncs Bookings**: Bookings appear in your calendar automatically
- **Shows Real Availability**: Clients see when you're actually free
- **Two-Way Sync**: Changes sync both ways

## Supported Calendars

- **Google Calendar**: Full OAuth integration
- **Microsoft Outlook**: OAuth integration
- **iCloud/CalDAV**: Manual connection
- **Other CalDAV**: Custom server connection

## Connecting Google Calendar

### Step 1: Start Connection

1. Go to **Scheduling** → **Settings** → **Calendar Connections**
2. Click **"Connect Google Calendar"**
3. You'll be redirected to Google

### Step 2: Authorize

1. Sign in to Google account
2. Review permissions requested
3. Click **"Allow"** or **"Authorize"**
4. You'll be redirected back to SWELL

### Step 3: Configure

1. **Select Calendar**: Choose which Google calendar to sync
2. **Sync Direction**: 
   - **Two-Way**: Bookings → Calendar, Calendar → Availability
   - **One-Way (Out)**: Bookings → Calendar only
   - **One-Way (In)**: Calendar → Availability only
3. **Set as Primary**: Make this your main calendar
4. **Save**

### Step 4: Verify

1. Check connection status (should show "Connected")
2. Create a test booking
3. Verify it appears in Google Calendar
4. Add event in Google Calendar
5. Verify it blocks availability

## Connecting Microsoft Outlook

### Step 1: Start Connection

1. Go to **Scheduling** → **Settings** → **Calendar Connections**
2. Click **"Connect Outlook"** or **"Connect Microsoft"**
3. You'll be redirected to Microsoft

### Step 2: Authorize

1. Sign in to Microsoft account
2. Review permissions
3. Click **"Accept"**
4. You'll be redirected back

### Step 3: Configure

Same as Google Calendar:
- Select calendar
- Choose sync direction
- Set as primary (optional)
- Save

## Connecting iCloud/CalDAV

### Manual Connection

1. Go to **Scheduling** → **Settings** → **Calendar Connections**
2. Click **"Add CalDAV Connection"**
3. Enter connection details:
   - **Server URL**: Your CalDAV server
   - **Username**: Your iCloud/CalDAV username
   - **Password**: Your password
   - **Calendar Name**: Name for this connection
4. **Test Connection**
5. **Save**

### iCloud Specific

For iCloud:
- **Server**: `https://caldav.icloud.com`
- **Username**: Your iCloud email
- **Password**: App-specific password (not regular password)

## Managing Connections

### Viewing Connections

See all connected calendars:
1. Go to **Scheduling** → **Settings** → **Calendar Connections**
2. View list of connections
3. See status (Connected, Expired, Error)

### Connection Status

**Connected (Green):**
- Working properly
- Syncing correctly
- No action needed

**Expired (Yellow):**
- Token expired
- Click **"Reconnect"** to refresh
- Re-authorize if needed

**Error (Red):**
- Connection failed
- Check credentials
- Reconnect

### Setting Primary Calendar

One calendar can be primary:
1. Find connection
2. Click **"Set as Primary"**
3. Primary calendar used by default
4. Other calendars still sync

### Disconnecting

Remove a connection:
1. Find connection
2. Click **"Disconnect"**
3. Confirm removal
4. Connection removed
5. Sync stops

## How Sync Works

### Bookings → Calendar

When booking is made:
1. Booking created in SWELL
2. Event automatically added to connected calendar
3. Includes:
   - Title: Event type name + client name
   - Time: Booking date/time
   - Duration: Event type duration
   - Location: Meeting location/link
   - Attendee: Client email

### Calendar → Availability

External calendar events block availability:
1. System checks connected calendars
2. Finds events during your availability
3. Blocks those time slots
4. Clients can't book blocked times

**Sync Frequency:**
- **Real-Time**: Immediate sync (if supported)
- **Hourly**: Checks every hour
- **Daily**: Checks once per day

### Two-Way Sync

Both directions work:
- **Bookings → Calendar**: Your bookings appear in external calendar
- **Calendar → Availability**: External events block booking times

## Troubleshooting

### Connection Not Working

**Can't connect?**
- Check internet connection
- Verify calendar account credentials
- Try reconnecting
- Check browser popup blockers

**Connection expired?**
- Click **"Reconnect"**
- Re-authorize
- Check token expiration
- Set up automatic refresh

### Sync Not Working

**Bookings not appearing in calendar?**
- Verify connection is active
- Check sync direction settings
- Test connection
- Check calendar permissions

**External events not blocking?**
- Verify sync direction includes "In"
- Check sync frequency
- Manually refresh
- Reconnect calendar

### Permission Issues

**"Access Denied" error?**
- Re-authorize connection
- Check calendar sharing settings
- Verify account permissions
- Contact support if persists

## Best Practices

1. **Connect Main Calendar**: Use your primary calendar
2. **Set Two-Way Sync**: Get full benefit
3. **Monitor Status**: Check connection regularly
4. **Reconnect When Expired**: Keep connections active
5. **Test Sync**: Verify bookings appear in calendar
6. **Use Primary**: Set one calendar as primary
7. **Multiple Calendars**: Connect all calendars you use

## Security

### OAuth Security

- **No Password Storage**: OAuth doesn't store passwords
- **Token Encryption**: Tokens stored encrypted
- **Limited Permissions**: Only calendar access requested
- **Revocable**: Can disconnect anytime

### Data Privacy

- **Your Data Only**: Only your calendar data accessed
- **No Sharing**: Data not shared with third parties
- **Secure Connection**: All connections encrypted
- **You Control**: You decide what to connect

## Next Steps

- [Setting Up Availability](https://help.swellsystem.com/en/article/setting-up-availability-17fx861/) - Configure schedule
- [Managing Bookings](https://help.swellsystem.com/en/article/managing-bookings-1wa9wdr/) - Handle appointments
- [Booking Links](https://help.swellsystem.com/en/article/booking-links-1awuscu/) - Share booking page
