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

# Google Workspace

> Connect Google Drive, Docs, and Sheets to Adapt

<Frame>
  <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=5b2b0cfe49259db884c8be7f926a7cc2" alt="Google Workspace integration" width="2922" height="2122" data-path="images/integrations/google-workspace.png" />
</Frame>

Connect Google Workspace to let Adapt access Google Drive, Docs, Sheets,
and Slides on behalf of your organization using a service account with
domain-wide delegation.

## Prerequisites

Before setting up, you'll need:

* **A Google Cloud account** -- if your organization doesn't have one yet, [create a Google Cloud account](https://cloud.google.com/free) first. You'll need this to access the Google Cloud Console and create a service account. If your organization already uses GCP with Adapt, see the [GCP integration guide](/integrations/gcp) for details.
* **Google Workspace admin access** to configure domain-wide delegation
* **Google Cloud Console access** to create a service account
* A user email that the service account will impersonate

## Setup

### Step 1: Create a Google Cloud Project

<Steps>
  <Step title="Open Google Cloud Console">
    Go to [console.cloud.google.com](https://console.cloud.google.com) and sign in with your Google Workspace admin account.
  </Step>

  <Step title="Create a new project">
    Click the project dropdown at the top, then **New Project**. Name it something like "Adapt Integration".

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/create-project.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=f305da764288dc4726943cb156aa171f" alt="Create a new Google Cloud project" width="2218" height="996" data-path="images/integrations/google-workspace/create-project.png" />
    </Frame>
  </Step>

  <Step title="Select the project">
    Make sure your new project is selected in the project dropdown before continuing.
  </Step>
</Steps>

### Step 2: Enable Required APIs

<Steps>
  <Step title="Navigate to APIs & Services">
    In the left sidebar, go to **APIs & Services > Library**.

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/api-library.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=38221c5e91251ef4bfa7f501ce8a0eb5" alt="Google Cloud API Library" width="2226" height="2610" data-path="images/integrations/google-workspace/api-library.png" />
    </Frame>
  </Step>

  <Step title="Enable the following APIs">
    Search for and enable each of these APIs:

    | API                   | Purpose                      |
    | --------------------- | ---------------------------- |
    | **Google Drive API**  | Access files and folders     |
    | **Google Docs API**   | Read and write documents     |
    | **Google Sheets API** | Read and write spreadsheets  |
    | **Google Slides API** | Read and write presentations |

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/enable-api.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=db90f25aea397a7696720e920c3c9396" alt="Enable an API in Google Cloud" width="1236" height="1254" data-path="images/integrations/google-workspace/enable-api.png" />
    </Frame>
  </Step>
</Steps>

### Step 3: Create a Service Account

<Steps>
  <Step title="Go to Service Accounts">
    Navigate to **IAM & Admin > Service Accounts** in the left sidebar.

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/service-accounts.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=6ef9bf0d144c029fcd7539070cef6ce8" alt="Service Accounts page" width="2232" height="1802" data-path="images/integrations/google-workspace/service-accounts.png" />
    </Frame>
  </Step>

  <Step title="Create service account">
    Click **Create Service Account** at the top.

    * **Name**: `adapt-integration`
    * **Description**: "Service account for Adapt integration with Google Workspace"

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/create-service-account.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=8b6f4bca59ec9fb7f362204b5714b197" alt="Create service account form" width="2230" height="1826" data-path="images/integrations/google-workspace/create-service-account.png" />
    </Frame>
  </Step>

  <Step title="Skip optional steps">
    You can skip the "Grant this service account access" and "Grant users access" steps. Click **Done**.
  </Step>

  <Step title="Create a key">
    Click on your new service account, go to the **Keys** tab, and click **Add Key > Create new key**.

    * Select **JSON** format
    * Click **Create**

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/create-key.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=a60d1678034dfdb66acbb4083febbaf2" alt="Create service account key" width="2644" height="1822" data-path="images/integrations/google-workspace/create-key.png" />
    </Frame>

    <Warning>
      Save this JSON file securely. You'll need it to connect Adapt, and it cannot be downloaded again.
    </Warning>
  </Step>
</Steps>

### Step 4: Configure Domain-Wide Delegation

<Steps>
  <Step title="Enable delegation on the service account">
    In the service account details, click **Advanced Settings**, and note the
    **Client ID** of the service account.

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/enable-delegation.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=7ad2ef36694441262688baaad8eb97cb" alt="Enable domain-wide delegation" width="2236" height="1908" data-path="images/integrations/google-workspace/enable-delegation.png" />
    </Frame>
  </Step>

  <Step title="Open Google Workspace Admin Console">
    Go to [admin.google.com](https://admin.google.com) and navigate to **Security > Access and data control > API controls**.
  </Step>

  <Step title="Manage Domain-wide Delegation">
    Click **Manage Domain Wide Delegation**, then **Add new**.
  </Step>

  <Step title="Add the Client ID and scopes">
    Enter the **Client ID** for the service account, then add the OAuth scopes matching the access level you'll choose in Adapt (comma-separated):

    **For read & write access:**

    ```
    https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/documents,https://www.googleapis.com/auth/presentations
    ```

    **For read-only access:**

    ```
    https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/spreadsheets.readonly,https://www.googleapis.com/auth/documents.readonly,https://www.googleapis.com/auth/presentations.readonly
    ```

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/add-scopes.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=b2a9df44a74029a9086534d1509e6205" alt="Add OAuth scopes" width="1104" height="1002" data-path="images/integrations/google-workspace/add-scopes.png" />
    </Frame>
  </Step>

  <Step title="Authorize">
    Click **Authorize** to complete domain-wide delegation setup.
  </Step>
</Steps>

### Step 5: Connect to Adapt

<Steps>
  <Step title="Go to Integrations">
    In Adapt, navigate to **Settings > Integrations > Google Workspace**.
  </Step>

  <Step title="Add Google Workspace">
    Click **Add Google Workspace** to open the connection dialog.
  </Step>

  <Step title="Enter credentials">
    * **Service Account JSON**: Paste the entire contents of the JSON key file
      for your service account.
    * **Fixed User Email**: Enter the email of a user in your domain that Adapt should impersonate (e.g., `adapt@yourdomain.com`)
    * **Access Level**: Choose **Read & Write** or **Read-only** -- this must match the scopes you configured in Step 4.

    <Frame>
      <img src="https://mintcdn.com/adapt-fa4ae803/D2qeipLO8OyXaFS0/images/integrations/google-workspace/connect-modal.png?fit=max&auto=format&n=D2qeipLO8OyXaFS0&q=85&s=8950b58f411e8eabf7fee993c19b6eeb" alt="Connect Google Workspace dialog" width="1372" height="1076" data-path="images/integrations/google-workspace/connect-modal.png" />
    </Frame>
  </Step>

  <Step title="Connect">
    Click **Connect** to complete the setup.
  </Step>
</Steps>

## Permissions

Depending on the access level you chose during setup, Adapt will have:

| Permission                | Read-Only | Read & Write |
| ------------------------- | :-------: | :----------: |
| Drive - Read files        |     ✓     |       ✓      |
| Drive - Create/edit files |           |       ✓      |

<Note>
  All access is performed by impersonating the **Fixed User Email** you specified during setup. Adapt will have the same access as that user within the authorized scopes.
</Note>

## Capabilities

With Google Workspace connected, Adapt can help you work with your organization's documents and communications.

### Examples

Read and analyze documents:

```
Summarize the product roadmap doc in our Drive
```

Create content:

```
Draft a project proposal doc based on our discussion and create a Google doc for it.
```

## Troubleshooting

### "Unauthorized" or "Access denied" errors

* Check that the OAuth scopes in Admin Console match what Adapt needs
* Ensure the Fixed User Email is a valid user in your domain

### "API not enabled" errors

* Return to the Google Cloud Console and verify all required APIs are enabled
* Make sure you're in the correct project

### Changes not appearing

* Domain-wide delegation can take a few minutes to propagate
* Try disconnecting and reconnecting the integration

## Security Considerations

* **Anyone in your organization can access what Adapt can access.** The organization connection impersonates a single Fixed User Email, so any document that user can open is reachable by everyone in your organization through Adapt. If content should stay scoped to a single person, use a [personal connection](/integrations/overview#personal-connections) instead.
* The service account JSON contains sensitive credentials. Never share it publicly.
* Use **read-only** scopes if Adapt doesn't need to create or modify content.
* Consider creating a dedicated admin user for the Fixed User Email to audit Adapt's activity.
* You can revoke access at any time by deleting the domain-wide delegation entry in Admin Console.
