Sandra
account_circle
arrow_backAdmin Guides
~20 min setup

Connect Google Workspace

Give Sandra access to your organization’s Gmail, Calendar, Drive, Tasks, Forms, and Contacts. This is the most impactful integration.

What Sandra can do with Google Workspace

ServiceCapabilities
GmailSend emails, create drafts, read & search messages, reply to threads
CalendarCreate events (with Google Meet), list upcoming events, update & cancel events
DriveSearch files, read documents, create Google Docs & Sheets, share files
TasksCreate to-do items, list tasks, mark complete, delete tasks
FormsCreate forms with questions, read form responses
ContactsLook up team members by email, list directory users, find birthdays
Prerequisites: Google Workspace admin access (Super Admin), Google Cloud Console access, and Sandra Admin Portal access.

1. Create a Google Cloud project

2
Click the project selectorNew Project
3
Name it Sandra AI Assistant, select your organization, and click Create

2. Enable required APIs

In your Cloud project, go to APIs & Services → Library and enable each of these:

APIRequired for
Gmail APIEmail sending, reading, drafts
Google Calendar APIEvent management
Google Drive APIFile search, reading, creation
Google Tasks APITask management
Google Forms APIForm creation and responses
Admin SDK APIDirectory / contacts lookup
Google Sheets APISpreadsheet reading
People APIContact details, birthdays

3. Create a service account

Sandra uses a service account to access your Workspace. No individual user sign-in needed.

1
Go to APIs & Services → Credentials
2
Click + Create Credentials → Service Account
3
Name: Sandra AI, ID: sandra-ai
4
Click Create and Continue → skip optional steps → Done

Download the key file

5
Click on your new service account → Keys tab → Add Key → Create new key
6
Select JSON format → Create. A .json file downloads.
⚠️ Keep this file safe! It contains the private key. You’ll upload it to Sandra later. Note the client_id value — you need it in the next step.

4. Set up domain-wide delegation

This authorizes your service account to act on behalf of users in your Workspace domain.

2
Navigate to Security → Access and data control → API controls
3
Click Manage Domain Wide Delegation → Add new
4
Enter the client_id from your service account JSON (numeric, e.g. 123456789)
5
Paste the full OAuth scopes list below → click Authorize

Required OAuth scopes

Copy this entire comma-separated list:

text
https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/drive.file,https://www.googleapis.com/auth/gmail.send,https://www.googleapis.com/auth/gmail.compose,https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/gmail.modify,https://www.googleapis.com/auth/admin.directory.user.readonly,https://www.googleapis.com/auth/admin.directory.group.readonly,https://www.googleapis.com/auth/calendar,https://www.googleapis.com/auth/calendar.events,https://www.googleapis.com/auth/tasks,https://www.googleapis.com/auth/forms.body,https://www.googleapis.com/auth/forms.responses.readonly,https://www.googleapis.com/auth/contacts.readonly,https://www.googleapis.com/auth/spreadsheets.readonly

5. Configure Sandra

Bring the credentials into Sandra via environment variables or the Admin Portal.

Option A: Environment variables

bash
# Entire JSON key file, base64 encoded:
GOOGLE_SA_KEY_JSON=$(cat your-service-account-key.json | base64)

# Your Workspace domain
GOOGLE_WORKSPACE_DOMAIN=yourcompany.com

# Admin email (for directory lookups)
GOOGLE_ADMIN_EMAIL=admin@yourcompany.com

# Sandra's email (for sending)
GOOGLE_DRIVE_IMPERSONATE_EMAIL=sandra@yourcompany.com

# Optional: specific Drive folder IDs
GOOGLE_DRIVE_FOLDER_IDS=folder-id-1,folder-id-2

Option B: Admin Portal

1
Log in to the Admin Portal → Settings tab
2
Under Google Workspace Connection: upload or paste the service account JSON key, enter your domain, admin email, and Sandra’s email
3
Click SaveTest Connection

6. Verify the connection

1
In the Admin Portal, go to Dashboard → System and check for a green indicator next to Google Workspace
2
In the Sandra chat, try: “What meetings do I have this week?”
3
Or: “Search my Drive for the quarterly report”

Scope reference

ScopeLevelWhy needed
drive.readonlyRead-onlySearch and read files in Google Drive
drive.fileRead/write (created files)Create Google Docs and Sheets
gmail.sendSend onlySend emails on behalf of users
gmail.composeCreate draftsSave email drafts
gmail.readonlyRead-onlySearch and read email messages
gmail.modifyMark read / labelsMark emails as read after processing
admin.directory.user.readonlyRead-onlyLook up team members in the directory
admin.directory.group.readonlyRead-onlyLook up groups / teams
calendarFull accessCreate, read, update, delete calendar events
calendar.eventsEvents onlyManage calendar events
tasksFull accessCreate, list, complete, delete tasks
forms.bodyCreate / editCreate Google Forms with questions
forms.responses.readonlyRead-onlyRead form submission responses
contacts.readonlyRead-onlyLook up contact details and birthdays
spreadsheets.readonlyRead-onlyRead data from Google Sheets

Troubleshooting

Insufficient permissions

Go back to the Workspace Admin Console and verify the scopes are correctly configured for the numeric client_id.

Token exchange failed

Ensure the full JSON key file was uploaded correctly. If you rotated the key in Cloud Console, generate a new one.

User not found

The configured admin email must be a real Super Admin in your Workspace.

Sandra can’t find Drive files

Trigger reindexing from Dashboard → System. If you specified folder IDs, verify they are correct.

shieldSecurity notes

  • • Service account JSON key is encrypted at rest
  • • Access tokens are short-lived (1 hour) and automatically refreshed
  • • Sandra accesses Workspace via impersonation of a designated admin user
  • • Revoke access anytime by deleting the key or removing Domain-Wide Delegation

Connect Zoom →

Schedule meetings automatically.

Agent Settings →

Customize Sandra’s email behavior.