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

# Google Workspace

> Connect Google Drive, Docs, Sheets, Slides, and Gmail to Omni

The Google Workspace connector enables Omni to index and search content from your organization's Google Workspace environment, including Drive, Docs, Sheets, Slides, and optionally Gmail.

## Overview

### What Gets Indexed

| Source           | Content                                 |
| ---------------- | --------------------------------------- |
| Google Drive     | Files, folders, and metadata            |
| Google Docs      | Full document text and comments         |
| Google Sheets    | Sheet names, cell content, and formulas |
| Google Slides    | Slide text and speaker notes            |
| Gmail (optional) | Email subjects, bodies, and attachments |

### How It Works

1. A service account with domain-wide delegation accesses Google Workspace APIs
2. The connector syncs content based on user permissions
3. Permission inheritance ensures users only see content they have access to in Google Workspace

<Note>
  The connector uses read-only access. Omni cannot modify any content in your Google Workspace.
</Note>

## Prerequisites

Before setting up the Google Workspace connector, ensure you have:

* **Google Cloud Platform account** with billing enabled
* **Google Workspace admin access** (Super Admin or delegated admin)
* **Google Cloud CLI** (`gcloud`) installed and authenticated (optional, for enabling APIs via CLI)

## Setup

### Step 1: Create a Google Cloud Project

1. Go to the [Google Cloud Console](https://console.cloud.google.com)
2. Click **Select a project** → **New Project**
3. Enter project name: `omni-workspace-integration`
4. Select your organization
5. Click **Create**

### Step 2: Enable Required APIs

In your new project, enable these APIs:

```bash theme={null}
gcloud services enable admin.googleapis.com
gcloud services enable drive.googleapis.com
gcloud services enable gmail.googleapis.com
gcloud services enable docs.googleapis.com
gcloud services enable sheets.googleapis.com
gcloud services enable slides.googleapis.com
```

Or enable via Console: **APIs & Services** → **Library** → Search and enable each API.

### Step 3: Create Service Account

1. Go to **IAM & Admin** → **Service Accounts**
2. Click **Create Service Account**
3. Name: `omni-workspace-connector`
4. Description: `Service account for Omni Google Workspace integration`
5. Click **Create and Continue**
6. Skip the optional steps and click **Done**

### Step 4: Get the Client ID

1. Click on the newly created service account
2. Go to the **Details** tab
3. Under **Advanced settings**, copy the **Client ID** (also shown as the service account's Unique ID) — you'll need this in Step 6 to authorize domain-wide delegation

### Step 5: Create Service Account Key

1. Go to the **Keys** tab
2. Click **Add Key** → **Create new key**
3. Select **JSON** format
4. Click **Create**
5. Save the downloaded key file securely

<Warning>
  This key file provides access to your entire Google Workspace domain. Store it securely and never commit it to version control.
</Warning>

### Step 6: Configure Domain-Wide Delegation in Admin Console

1. Open the [Google Workspace Admin Console](https://admin.google.com)
2. Navigate to **Security** → **Access and data control** → **API controls**
3. Click **Manage Domain Wide Delegation**
4. Click **Add new**
5. Enter the **Client ID** from Step 4
6. Add the following OAuth scopes:

```
https://www.googleapis.com/auth/admin.directory.user.readonly,
https://www.googleapis.com/auth/admin.directory.group.readonly,
https://www.googleapis.com/auth/drive.readonly,
https://www.googleapis.com/auth/gmail.readonly,
https://www.googleapis.com/auth/documents.readonly,
https://www.googleapis.com/auth/spreadsheets.readonly,
https://www.googleapis.com/auth/presentations.readonly
```

7. Click **Authorize**

<Warning>
  If Gmail access is not needed, exclude `https://www.googleapis.com/auth/gmail.readonly` from the scopes.
</Warning>

### Step 7: Configure Omni

1. Navigate to **Settings** → **Integrations** in Omni
2. Find **Google Workspace** and click **Connect**
3. Paste the contents of the service account key file from Step 5
4. Enter your Google Workspace domain
5. Enter the admin email address
6. Click **Connect**, and click **Configure** against either the Drive or Gmail source
7. Choose which sources you want enabled, select any specific users to include/exclude, and click **Save Configuration**
8. Wait for the initial sync to complete

<Check>
  Your Google Workspace connector is now configured. Initial indexing may take a while, depending on the amount of content in your Google account.
</Check>

***

## Managing the Integration

### Viewing Sync Status

Navigate to **Settings** → **Integrations** to view the sync status for each source directly on the list, including last sync time, number of indexed items, and any errors. Click **Configure** on a source for more details.

### Rotating Service Account Keys

It's recommended to rotate service account keys every 90 days.

1. Create a new key in Google Cloud Console
2. Update the key in Omni settings
3. Delete the old key

### Removing the Integration

1. Navigate to **Settings** → **Integrations**
2. Click **Configure** against the Google Workspace source
3. Click **Delete Permanently**
4. Optionally, delete the service account in Google Cloud and remove the domain-wide delegation entry in Admin Console

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Insufficient permissions">
    The setup requires:

    * **Project Creator** - to create the GCP project
    * **Google Workspace Super Admin** - for domain-wide delegation

    Some permissions may take 10-15 minutes to propagate.
  </Accordion>

  <Accordion title="API not enabled error">
    APIs may take a few minutes to propagate after enabling. Check status:

    ```bash theme={null}
    gcloud services list --enabled --project=YOUR_PROJECT_ID
    ```
  </Accordion>

  <Accordion title="Domain-wide delegation not working">
    Common causes:

    * Client ID mismatch - verify the ID in Admin Console matches the service account
    * Missing scopes - ensure all required scopes are added
    * Propagation delay - wait 5-10 minutes for changes to take effect
    * Wrong admin email - ensure the admin email has Google Workspace admin privileges
  </Accordion>

  <Accordion title="Sync taking too long">
    Initial sync duration depends on:

    * Number of users in your organization
    * Amount of content in Drive and Gmail
    * API quota limits

    For large organizations (1000+ users), initial sync may take 24-48 hours. You can monitor progress in the Omni admin panel.
  </Accordion>
</AccordionGroup>

## Security Considerations

* **Read-only access**: The service account only has read permissions
* **Permission inheritance**: Users only see content they can access in Google Workspace
* **Key security**: Service account keys should be treated like passwords
* **Audit logging**: Enable Cloud Audit Logs to monitor API access
* **Key rotation**: Rotate service account keys every 90 days

## What's Next

<CardGroup cols={3}>
  <Card title="Search Your Data" icon="magnifying-glass" href="/user-guide/search">
    Learn how to search across Google Workspace content
  </Card>

  <Card title="AI Assistant" icon="robot" href="/user-guide/ai-assistant">
    Ask questions about your documents and emails
  </Card>

  <Card title="Add More Connectors" icon="plug" href="/connectors/overview">
    Connect additional data sources
  </Card>
</CardGroup>
