> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Workspace connectors

> Connect Gmail, Google Calendar, Contacts, Drive, Docs, and Sheets all together to your app with the Google Workspace connector.

Send email, sync calendars and contacts, and work with files from your app. Connect each Google service on its own, or use the Google Workspace connector to work across several in one connection.

***

## What you can do

Choose a Google service to see what you can build with it, or use the [Google Workspace connector](#google-workspace-connector) to combine several in one connection.

> [card] [Gmail](#gmail)
>
> Send, read, and organize email.

> [card] [Google Calendar](#google-calendar)
>
> Sync events and show your availability.

> [card] [Google Contacts](#google-contacts)
>
> Find, add, and update contacts.

> [card] [Google Drive](#google-drive)
>
> Save, share, and organize files.

> [card] [Google Docs](#google-docs)
>
> Generate and update documents.

> [card] [Google Sheets](#google-sheets)
>
> Read, write, and update spreadsheets.

> [!TIP]
>
> Looking for another Google connector? See [Google Maps](https://docs.base44.com/Integrations/google-maps-connector.md), [Google Search Console](https://docs.base44.com/Integrations/google-search-console-connector.md), and more in the [connectors catalog](https://docs.base44.com/Integrations/connectors-catalog).

### Gmail

**Example prompts**

Describe the subject line, message body, formatting, recipients, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Send automated confirmation emails when a new order is placed.
```

```text wrap theme={null}
Read and parse incoming emails to create support tickets.
```

```text wrap theme={null}
Trigger a workflow automatically when a new email arrives.
```

```text wrap theme={null}
Send personalized follow-up emails to new leads.
```

```text wrap theme={null}
Notify team members via email when tasks are assigned.
```

### Google Calendar

**Example prompts**

Describe the calendar, the events, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Sync all my bookings directly to my Google Calendar.
```

```text wrap theme={null}
Show my real-time availability from Google Calendar to clients.
```

```text wrap theme={null}
Run an automation when a calendar event is created or updated.
```

```text wrap theme={null}
Automatically block off meeting times in my personal calendar.
```

```text wrap theme={null}
Add new calendar events when a task is marked as complete.
```

### Google Contacts

**Example prompts**

Describe the contacts, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Build a CRM that syncs clients two-way with my Google Contacts.
```

```text wrap theme={null}
Import leads from people I've emailed but never saved as contacts.
```

```text wrap theme={null}
Analyze my contact network and categorize contacts automatically with AI.
```

```text wrap theme={null}
Create a searchable company directory from my Google Workspace organization.
```

```text wrap theme={null}
Automatically save new customers as contacts when they sign up.
```

### Google Drive

**Example prompts**

Describe the files or folders, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
List all files in my Google Drive and display them in my app.
```

```text wrap theme={null}
Search Google Drive for documents matching a keyword and show results.
```

```text wrap theme={null}
Save generated PDF reports from my app to Google Drive.
```

```text wrap theme={null}
Read a spreadsheet from Google Drive and import its data into my app.
```

```text wrap theme={null}
Trigger a workflow when a file is added or updated in Drive.
```

### Google Docs

**Example prompts**

Describe the document, what triggers it, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Generate meeting notes documents automatically.
```

```text wrap theme={null}
Create contracts from templates with client data.
```

```text wrap theme={null}
Update shared documents when project status changes.
```

```text wrap theme={null}
Export reports to Google Docs format.
```

```text wrap theme={null}
Insert a table of this week's orders into a shared Google Doc.
```

### Google Sheets

**Example prompts**

Describe the spreadsheet, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Export app data to a Google Sheets spreadsheet.
```

```text wrap theme={null}
Import leads from a Google Sheet into the CRM.
```

```text wrap theme={null}
Update inventory counts in Google Sheets automatically.
```

```text wrap theme={null}
Create weekly reports and save them to Google Sheets.
```

```text wrap theme={null}
Sync form submissions to a Google Sheets database.
```

### Google Workspace connector

Build features that work across your inbox, calendar, contacts, and files, such as an assistant that prepares for meetings using related emails and documents.

**Example prompts**

Describe the Google services involved, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Get to know me - skim my emails, meetings and Drive files and tell me what I'm working on.
```

```text wrap theme={null}
Be my personal assistant: watch my inbox and calendar and tell me what needs me today.
```

```text wrap theme={null}
Prep my next meeting from related email threads, files and the attendees' details.
```

```text wrap theme={null}
Draft follow-ups to attendees after each meeting.
```

```text wrap theme={null}
Turn this week's meetings and emails into a Doc and a Sheet.
```

***

## Connecting a Google service

Connect a Google service through one shared account or let each person connect their own.

> [tab] Shared connector
>
> You connect one account once, and everyone who uses your app shares that connection and its data.
>
> **To add a shared Google connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
> 2. Click **Add connector**.
> 3. Search for **Google Workspace**, or a single service such as **Google Calendar**, and click it.
> 4. Select **Shared connector** and then click **Next**.
> 5. Enter a **Connection name**.
> 6. In **Who can access**, choose where the connection can be used: **Apps and Super agent** (the default), **Apps only** or **Super agent only**.
> 7. Choose the [scopes](#scopes-and-permissions) your app needs under **Permissions**:
>    * **Read-only:** Your app can view data. This is the default.
>    * **Read & write:** Your app can also send, create or change data. To send email or create events and files, choose this.
>    * **Custom:** Select the optional permissions your app needs. Required permissions stay selected.
> 8. Click **Add connector** and then sign in with the Google account you want to share.
> 9. Open your app in the app editor.
> 10. Ask the AI chat to use the shared Google connection for the feature you want to build.

> [tab] App user connector
>
> Each person connects their own Google account, so your app works with their data.
>
> Workspace owners and admins set up app user connectors.
>
> * **Let Base44 manage OAuth:** Available for Google Calendar on a [Pro plan](https://base44.com/pricing) or higher. Go straight to **To add an app user Google connector**.
> * **Use your own OAuth client:** Review [Verification with your own OAuth client](#verification-with-your-own-oauth-client), then complete the Google Cloud setup below.
>
> **To prepare your own OAuth client:**
>
> 1. Create or select a project in the Google Cloud console.
> 2. Enable the API for each Google service your app uses.
> 3. Set up the OAuth consent screen with the scopes you plan to request.
> 4. While your OAuth app is in testing mode, add the Google accounts you'll test with as test users.
> 5. Create an OAuth client for a web application.
> 6. Add `https://connectors.base44.com/api/oauth/callback` as an authorized redirect URI.
> 7. Copy the client ID and client secret.
>
> **To add an app user Google connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
> 2. Click **Add connector**.
> 3. Search for **Google Workspace**, or a single service such as **Google Calendar**, and click it.
> 4. Select **App user connector** and then click **Next**.
> 5. If **Choose how to manage authentication** appears, select **Let Base44 manage OAuth** or **Use your own OAuth client**.
> 6. If you use your own OAuth client, copy the **Callback URL** and add it to your Google OAuth client's allowed redirect URIs.
> 7. Enter a **Connector name**.
> 8. If you use your own OAuth client, enter its **Client ID** and **Client Secret**.
> 9. Keep only the [scopes](#scopes-and-permissions) your app needs under **Scopes**. With your own OAuth client, add others under **Additional scopes**.
> 10. Click **Add Connector**.
> 11. Open your app in the app editor.
> 12. Ask the AI chat to add a way for people to connect their own Google account.

***

## Scopes and permissions

Scopes determine what your app can access or change in Google. Use the service cards below to choose only the permissions your app needs.

> [!NOTE]
>
> **Required `email` scope**
>
> Base44 always requests the `email` scope to identify the connected Google account. This required permission stays selected:
>
> * **Shared connector:** Under **Permissions**, when you choose **Custom**.
> * **App user connector:** Under **Scopes**.

> [card] Gmail
>
> Reading mail content is a restricted Google scope.
>
> Gmail scope names start with `https://www.googleapis.com/auth/`:
>
> * `gmail.readonly`: Read messages and metadata
> * `gmail.modify`: Read, label, and change messages, but not permanently delete them
> * `gmail.compose`: Create drafts and send email
> * `gmail.send`: Send messages
> * `gmail.labels`: Manage labels
> * `gmail.settings.basic`: Manage filters, signatures, and the vacation responder
>
> **Access:** Your app works with the mail of the Gmail account that authorizes the connection.

> [card] Google Calendar
>
> The broad `calendar` scope manages every calendar, so choose a narrower scope when your app only reads events or availability.
>
> Google Calendar scope names start with `https://www.googleapis.com/auth/`:
>
> * `calendar`: Manage all calendars and events
> * `calendar.readonly`: View all calendars, events, and their settings
> * `calendar.events`: Manage events on calendars
> * `calendar.events.readonly`: View events on calendars
> * `calendar.events.freebusy`: View free/busy information from calendars without seeing event details
> * `calendar.freebusy`: View free/busy information for calendars
> * `calendar.app.created`: Manage calendars your app created
> * `calendar.calendarlist.readonly`: View the list of calendars
> * `calendar.events.public.readonly`: View public events on calendars
> * `calendar.settings.readonly`: View Google Calendar settings
>
> **Access:** Your app works with the calendars of the Google account that authorizes the connection.

> [card] Google Contacts
>
> Choose `contacts.readonly` when your app only needs to read saved contacts.
>
> Google Contacts scope names start with `https://www.googleapis.com/auth/`:
>
> * `contacts.readonly`: View contacts
> * `contacts`: View, create, edit, and delete contacts
> * `contacts.other.readonly`: View other contacts, such as people you've emailed but haven't saved
> * `directory.readonly`: View your organization's Google Workspace directory
>
> **Access:** Your app works with the contacts of the Google account that authorizes the connection.

> [card] Google Drive
>
> The `drive` scope gives your app access to all files and folders in Google Drive, while `drive.file` covers only the files your app creates or opens.
>
> Google Drive scope names start with `https://www.googleapis.com/auth/`:
>
> * `drive`: View, create, edit, and delete all files and folders in Google Drive
> * `drive.readonly`: View all files and folders in Google Drive
> * `drive.file`: Access only the files your app creates or opens with permission
>
> **Access:** Your app works with files in the Google Drive of the Google account that authorizes the connection.

> [card] Google Docs
>
> The `documents` scope lets your app view and edit every Google Docs document in the connected account, not only the ones it creates.
>
> Google Docs scope names start with `https://www.googleapis.com/auth/`:
>
> * `documents`: View, create, and edit all Google Docs documents
> * `documents.readonly`: View all Google Docs documents
>
> **Access:** Your app works with the documents of the Google account that authorizes the connection.

> [card] Google Sheets
>
> The `spreadsheets` scope lets your app change every spreadsheet in the account, not only the ones it creates.
>
> Google Sheets scope names start with `https://www.googleapis.com/auth/`:
>
> * `spreadsheets`: View, edit, create, and delete all Google Sheets spreadsheets
> * `spreadsheets.readonly`: View all Google Sheets spreadsheets
>
> **Access:** Your app works with the spreadsheets of the Google account that authorizes the connection.

> [card] Google Workspace
>
> This connector requests the scopes below across 6 services, so it needs more access than an individual connector.
>
> * **Gmail:** `gmail.readonly`, `gmail.modify`, `gmail.compose`, `gmail.send`
> * **Calendar:** `calendar.readonly`, `calendar.settings.readonly`, `calendar.events`
> * **Contacts:** `contacts.readonly`
> * **Drive:** `drive.readonly`, `drive`
> * **Docs:** `documents.readonly`, `documents`
> * **Sheets:** `spreadsheets.readonly`, `spreadsheets`
>
> The service cards above explain what these scopes allow.
>
> **Access:** Your app works with the data of the Google account that authorizes the connection.

### Verification with your own OAuth client

When you use your own OAuth client, you own the OAuth app and submit its verification to Google. Shared Google connectors and **Let Base44 manage OAuth** run on Base44's OAuth app, so you don't submit anything to Google for those. See [Using your own OAuth client](https://docs.base44.com/Integrations/Connectors.md#using-your-own-oauth-client).

Google groups the permissions your app requests into 3 categories. These groups determine the verification your app needs before it goes live, so choose the narrowest scopes that support what your app does. This matters most for Gmail, Drive, and Calendar.

* **Basic:** Covers name, email address, and profile. Google asks for nothing extra.
* **Sensitive:** Covers broader access to a Google service, such as creating calendar events. Google asks for app verification, including a review of how you use the data.
* **Restricted:** Covers reading the content of someone's messages or files, such as reading Gmail. Google asks for app verification, and may also require a yearly independent security assessment.

> [!TIP]
>
> To send email without restricted-scope verification, request only `gmail.send`.

Restricted-scope verification can take several weeks. Until Google approves your app, it may limit how many people can connect and show an unverified-app warning.

If Google requires a security assessment, a Google-approved independent assessor reviews your app using the CASA framework. The assessment covers both your code and the platform your app runs on.

Check [Google's developer documentation](https://developers.google.com/identity/protocols/oauth2/production-readiness/restricted-scope-verification) for current requirements, timing, and exceptions before planning your launch.

***

## Using Google services in a backend function

If you write your own backend functions, they can call Google's APIs directly, and Base44 handles the OAuth flow and token storage.

For a shared connection, pass a service ID from the table below to `getConnection()`. For an app user connection, pass your own connector's ID, not a service ID.

> [tab] Shared connector
>
> ```javascript theme={null}
> // One account the whole app uses
> const { accessToken } =
>   await base44.asServiceRole.connectors.getConnection("googlecalendar");
> // Use the access token to call the Google Calendar API.
> ```

> [tab] App user connector
>
> ```javascript theme={null}
> // The signed-in person's own account
> const { accessToken } =
>   await base44.asServiceRole.connectors.getCurrentAppUserConnection(
>     "YOUR_CONNECTOR_ID",
>   );
> // Use the access token to call the Google API for that person.
> ```

| Service | Service ID (shared connections) |
| - | - |
| Gmail | `gmail` |
| Google Calendar | `googlecalendar` |
| Google Contacts | `google_contacts` |
| Google Drive | `googledrive` |
| Google Docs | `googledocs` |
| Google Sheets | `googlesheets` |
| Google Workspace | `googleworkspace` |

> [card] [Shared connectors](https://docs.base44.com/developers/backend/resources/connectors/shared-connectors.md)
>
> Configure, deploy, and call a shared connection from a backend function.

> [card] [App user connectors](https://docs.base44.com/developers/backend/resources/connectors/app-user-connectors.md)
>
> Retrieve a per-user token and call the API as the signed-in person.

***

## Troubleshooting

If you use your own OAuth client, check these when people can't connect their Google account.

> [accordion] Some people can't connect their own account
>
> If you use your own OAuth client, it starts in testing mode, where only approved test users can connect. Before opening access more broadly, move your OAuth app to production and complete any verification Google requires.

> [accordion] Connecting fails with a redirect URI error
>
> Register the callback URL your connection uses as an authorized redirect URI in your Google OAuth client:
>
> * For the single callback URL, enter `https://connectors.base44.com/api/oauth/callback` exactly.
> * For per-app callback URLs, see [Using your own OAuth client](https://docs.base44.com/Integrations/Connectors.md#using-your-own-oauth-client).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.