Google Workspace
Connect your Google account to let agents access Gmail, Google Calendar, Google Drive, Google Sheets, Google Docs, and Google Contacts.
Prerequisites
- A Google account with access to the services you want to connect
- OAuth credentials configured in your AgentHiFive instance (see below)
OAuth Setup (Admin)
If you're self-hosting, you need to configure Google OAuth credentials:
- Go to Google Cloud Console and create a project
- Enable the APIs you need: Gmail API, Google Calendar API, Google Drive API
- Go to Credentials > Create Credentials > OAuth Client ID
- Application type: Web application
- Add redirect URI:
https://your-domain.com/v1/connections/callback - Copy the Client ID and Client Secret to your
.env:
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-your-secret
Connecting
- Go to Connections in the dashboard
- Select the Data & Productivity tab
- Click the Google service you want (Gmail, Calendar, Drive, etc.)
- You'll be redirected to Google's consent screen
- Sign in and grant the requested permissions
- You'll be redirected back with the connection active
Multiple Connections
Google services support multiple connections per workspace (e.g., connect both your work and personal Gmail). Each connection has its own credentials and policies.
Available Services
| Service ID | Scopes Requested | Capabilities |
|---|---|---|
google-gmail | gmail.modify, gmail.compose, gmail.readonly, gmail.send, gmail.labels | Read messages, search, send emails, manage labels |
google-calendar | calendar.events.readonly, calendar.events, calendar.readonly | Read events, create/modify events |
google-drive | drive.readonly, drive.file, drive | List files, read content, upload files |
google-sheets | spreadsheets.readonly, spreadsheets | Read and edit spreadsheets |
google-docs | documents.readonly, documents | Read and edit documents |
google-contacts | contacts.readonly, contacts | Read and manage contacts |
Vault API Usage
Once connected, agents call the vault with the Google API URLs:
vault_execute({
service: "google-gmail",
connectionId: "your-connection-id", // required -- Google supports multiple connections
method: "GET",
url: "https://gmail.googleapis.com/gmail/v1/users/me/messages",
query: { maxResults: "10" }
})
Connection ID Required
Since Google supports multiple connections, agents must pass connectionId (from vault_connections_list) to specify which account to use.