Skip to content

Microsoft 365 (Outlook Calendar & To Do)

Connects a host's Microsoft 365 account so ConnectGain bookings appear in their Outlook calendar, Outlook meetings appear in ConnectGain, and ConnectGain tasks can be mirrored into Microsoft To Do.

It is the Microsoft counterpart of the Google Calendar integration, and deliberately mirrors its shape — downstream surfaces (meeting recordings, availability, conflict checks) do not care which calendar a meeting came from.

Connected from Scheduling → Integrations (/scheduling/integrations).


What it does

Capability Edge function Direction
Start the connect flow microsoft-oauth-url
Exchange the code, identify the mailbox, store tokens microsoft-oauth-callback
Disconnect microsoft-oauth-revoke
Import Outlook meetings into synced_meetings microsoft-calendar-sync Outlook → ConnectGain
Create / update / delete the Outlook copy of a booking microsoft-calendar-event ConnectGain → Outlook
Mirror a task into the assignee's Microsoft To Do microsoft-todo-sync ConnectGain → Microsoft

microsoft-calendar-event takes an action of create, update or delete, so a booking that is rescheduled or cancelled in ConnectGain stays correct in Outlook rather than leaving a stale slot blocked.

microsoft-todo-sync is the "and tasks" half: an action item extracted from a meeting reaches someone where they already work, instead of only inside ConnectGain.


Setup

1. Register the app in Entra ID (Azure AD)

Create an app registration and note the client id, client secret and tenant id.

Add a Web redirect URI pointing at the callback function:

https://<project-ref>.supabase.co/functions/v1/microsoft-oauth-callback

2. Delegated permissions (Microsoft Graph)

Scope Why
User.Read Identify the connected mailbox
Calendars.ReadWrite Read Outlook meetings, write booking events
Tasks.ReadWrite Mirror ConnectGain tasks into Microsoft To Do
offline_access Refresh tokens without re-prompting the user

3. Edge function secrets

Set these in Supabase Dashboard → Edge Functions → Secrets:

  • MICROSOFT_CLIENT_ID
  • MICROSOFT_CLIENT_SECRET
  • MICROSOFT_TENANT_ID

4. Connect

Each host connects their own account from /scheduling/integrations. The connection is per user, not per organization.


Security notes

  • The profile id is taken from the caller's JWT, never from the request body — a user can only ever connect or act on their own mailbox.
  • Refresh tokens are stored encrypted in microsoft_connections.
  • Microsoft exposes no delegated revoke endpoint for a single grant, so disconnecting deletes the row — the encrypted refresh token goes with it. To revoke the grant itself, the user removes the app from their Microsoft account's connected-apps list.