Connect Google Workspace and Microsoft 365 — Operator manual | AI Agent Builder

Connect Google Workspace and Microsoft 365

Step by step so an agent can use a client's calendar, mail or files: the OAuth app to create, where its details go, when permission is requested, which tools the agent gets and how to re-authorize.

8 min read · Updated November 13, 2026

This chapter as a video · 3:23 · with captions · All the manual's videos

This guide connects Clínica del Sol's appointments calendar so the scheduling agent can check availability and book. It works the same for Gmail, Drive and Sheets on Google, and for Outlook's calendar, mail and OneDrive on Microsoft. How an API becomes the agent's tools and how credentials are protected is in the chapter Tools and integrations.

The Google and Microsoft steps follow their consoles as they were when this guide was written. What the guide says about the platform side is verified against the code.

Before you start

  • You create the OAuth app. The platform ships no app of its own: you need an OAuth client in Google Cloud or Microsoft Entra, owned by the clinic or the agency.
  • One connected account per tenant and per provider. The agent acts as the account that granted permission —for example, the clinic's appointments account—, not as the person chatting. Whatever that account can see or change, the agent can too.
  • Permission is requested when each service is turned on, not at install time. Installing only stores the app's details.
  • The screens in this flow are still in English, even when the admin is in Spanish.

1. The redirect URI

In Integrations, pick Google Workspace or Microsoft 365 and install it. The first step, Credentials, shows a Redirect URI box with the URL to register at the provider. On the Synaptic Links installation it is:

https://ai.synapticlinks.com.ar/admin-api/admin/oauth2/callback

Copy it from the screen: it must match what you register character for character.

2. Create the app at the provider

Google

  1. In Google Cloud Console, create a project and enable the APIs you will use: Calendar, Gmail, Drive, Sheets.
  2. Configure the consent screen:
    • Internal, if the account that will connect belongs to the same organisation's Google Workspace. This is the simplest.
    • External, in any other case. While it is in testing mode, the account must be added as a test user, and the permission expires after 7 days: the agent stops being able to use Google and you have to re-authorize.
  3. Create an OAuth client of type web application and add the redirect URI from step 1.
  4. Copy the Client ID and the Client Secret.

Gmail and Drive request scopes Google treats as restricted, and the calendar ones as sensitive. To use an external app without the 7-day limit, it has to pass Google's verification.

Microsoft

  1. In Microsoft Entra, App registrations → New registration.
  2. Choose to accept accounts in any organizational directory and personal accounts. The platform uses Microsoft's common authorization endpoints, and an app restricted to a single directory may fail.
  3. Add the redirect URI from step 1, of type Web.
  4. In Certificates & secrets, create a secret and copy its Value. The secret expires: note the date.
  5. In API permissions, add the matching Microsoft Graph delegated permissions: Calendars.ReadWrite for the calendar, Mail.ReadWrite and Mail.Send for mail, Files.ReadWrite.All for OneDrive.
  6. If the clinic's organisation does not let users grant permissions themselves, an administrator has to give consent.

3. Enter the app in the platform

In the install wizard's Credentials step:

FieldWhat goes in
Client IDThe OAuth client ID
Client SecretThe secret, stored encrypted

The Required scopes box only shows the basic identification scopes. Each service's scopes are added later, when you turn it on.

Connect & Authorize finishes the installation, but does not ask for permission yet: it takes you to the integration's detail page.

4. Turn on services and grant permission

On the integration's detail page, the Capabilities card has one switch per service: Calendar, Gmail, Drive and Sheets, or Outlook Calendar, Outlook Mail and OneDrive.

  1. Turn the service on, for example Calendar.
  2. Additional Authorization Required opens, with the new permissions. Choose Authorize.
  3. Sign in to Google or Microsoft with the account the agent will use and accept.
  4. You return to the admin with the message "OAuth2 connection established successfully". The screen opens the tool source that was created, not the integration's detail page.

If you cancel the permission, the service stays on but in Needs Authorization, with an Authorize button to pick it up again.

Each service you turn on later asks for permission again, adding the new scopes.

5. What the agent gets

Each service turned on becomes a tool source, for example Google Calendar (Google Workspace), with a set of recommended operations enabled:

ServiceEnabled operations
Google CalendarList calendars and events, create, update and delete events, check availability
GmailRead, search, send and label messages and threads
Google DriveList, read, create, update and export files
Google SheetsRead, create and update spreadsheets and values
Outlook CalendarList calendars and events, create, update and delete events, find meeting times
Outlook MailRead, send, reply and create drafts
OneDriveList, search, read and upload files and folders

From View Source you can enable or disable operations. For the agent to use them, the source has to be assigned to its tool step (chapter 5).

No operation asks for approval on its own. If the agent must not delete events or send mail without someone confirming, disable those operations or add an approval step before them (chapter 3).

When you have to re-authorize

Access renews on its own as long as the provider allows it. If Google or Microsoft reject it —the password changed, the permission was revoked, the Microsoft secret expired or a testing-mode Google app reached its 7 days—, the platform notifies owners and admins, in the admin and by email, with the subject "Una conexión de Clínica del Sol necesita reautorización" (the email is in the tenant's language).

To re-authorize:

  1. On the integration's detail page, in the Capabilities card, open View Source for the most recently enabled service.
  2. Choose Re-authorize and sign in with the same account.

Use the most recent source because each source remembers the scopes that existed when it was created: re-authorizing from an older one may ask for fewer scopes than needed. The detail page may point you to the Reconnect button, but for these integrations it does not ask for a new permission: use the path above.

Disconnecting

Disconnect deletes the tool sources and leaves the integration disconnected. It does not revoke the permission at Google or Microsoft: to cut access completely, remove the app from the connected account (in Google, the account's security settings; in Microsoft, the apps with permissions).

When it doesn't work

SymptomLikely causeWhat to do
Google or Microsoft say the redirect URI doesn't matchThe registered URL is not exactly the one on screenCopy it again from the Credentials step
No permission was requested after installingExpected behaviourTurn on a service in Capabilities
Google says the app isn't verified or the account has no accessExternal screen in testing modeAdd the account as a test user
It worked and stopped a week later (Google)External app in testing mode: permission expires after 7 daysRe-authorize, or verify the app with Google
It stopped working (Microsoft)The app's secret expiredCreate a new secret, enter it and re-authorize
Microsoft asks for an administratorThe organisation doesn't let users grant permissionsAn administrator grants consent in Entra
The service is still Needs Authorization after acceptingThe permission was cancelled or not all scopes were grantedUse Authorize again and accept every permission

Where it stops

  • One account per provider and per tenant. The agent does not act as each user.
  • The screens in this flow are in English.
  • The installer's scopes box only shows the basic ones, not each service's.
  • There is no connection test: you check by turning a service on and using it.
  • Re-authorizing is not direct: it is done from the source, not from the integration's detail page.
  • Disconnecting does not revoke the permission at the provider.
  • On Microsoft, the authorization endpoints are fixed (accounts from any organisation and personal ones).
  • Write operations do not ask for approval by default.

To check

  • The registered redirect URI is exactly the one on screen.
  • The account that granted permission is the one the agent should use, and has no more access than needed.
  • Only the services and operations the agent needs are turned on.
  • Deleting events and sending mail go through an approval, or are disabled.
  • On Google, the app is internal or verified; on Microsoft, the secret's expiry date is noted.
  • Owners and admins receive the re-authorization notices.