---
title: "Google Workspace preservation source"
feature: "Data sources"
audience: ["end user", "developer", "system analyst", "system administrator", "system engineer"]
version: "Relativity aiR"
type: ["User Guide", "Tutorial"]
url: "https://help.relativity.com/RelativityaiR/Content/Relativity/Preservation/Data_sources/Google_Workspace.htm"
lastModified: "2026-10-29"
---

# Google Workspace preservation source

This topic provides details on how to configure and capture Google Workspace Gmail, Drive, and Chats data with the Preservation in Place app.

> **Note:** This documentation contains references to third-party software, or technologies. While efforts are made to keep third-party references updated, the images, documentation, or guidance in this topic may not accurately represent the current behavior or user interfaces of the third-party software. For more considerations regarding third-party software, such as copyright and ownership, see [Terms of Use](https://www.relativity.com/terms-of-use/).

See these related topics:

- [Preservation sources](https://help.relativity.com/RelativityaiR/Content/Relativity/Preservation/Data_sources/Data_sources.md)
- [Preservations](https://help.relativity.com/RelativityaiR/Content/Relativity/Preservation/Preservations.md)
- [Manage preservations](https://help.relativity.com/RelativityaiR/Content/Relativity/Preservation/Manage_preservations.md)

## Considerations

Consider the following when using the Google Workspace data source:

- This data source cannot preserve Google Groups.
- Inactive user data cannot be preserved. For more information, see [Google's documentation](https://support.google.com/vault/answer/7664657?hl=en).
- If the Legal Hold admin cannot access the third-party system, they must contact an internal admin for access.

## Requirements

Before setting up a Google Workspace preservation, you must complete the following:

1. [Create a Google Cloud project](#Create3).
2. [Enable required APIs for the project](#Enable).
   - Google Vault API
   - Admin SDK API
   - Cloud Storage API
3. [Set up OAuth2 consent screen](#Setup).
4. [Create credentials](#Create).
5. [Create admin role for Vault API](#Create4).
6. [Create admin role for the user accounts listing](#Create5).
7. [Create admin role for the groups listing](#Create6).
8. [Enable required privileges](#Enable2).

After completing these required steps, you can create a Google Workspace data source in Relativity aiR. For more information on creating a preservation source in Relativity, see [Creating a preservation data source](https://help.relativity.com/RelativityaiR/Content/Relativity/Preservation/Data_sources/Data_sources.md#Creating).

## Setting up a Google data source

Connecting your Google Workspace to Preservation takes some setup in both Google and Relativity. After setting up the required credentials and admin roles in Google, you complete the data source configuration in Relativity.

Begin with the credential setup in Google.

### Create a Google Cloud project

Create a Google Cloud project to create, enable, and use all Google Cloud services. You will use this account to manage APIs.

To create a Google Cloud project:

1. Open the [Cloud Resource Manager page](https://console.cloud.google.com/cloud-resource-manager), then click **Create Project**.
2. Enter information into the fields:
   - **Project name**—enter a descriptive name for your project.
   - **Organization**—enter the name of your organization.
   - **Location**—enter the parent organization or folder.
3. Click **Create**.

![The New Project modal iin Google Cloud Platform.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Collection/SCR_NewCloudProject.png)

### Enable required APIs for the project

Continuing in this process, you now need to enable the required Google Cloud Console APIs and associate them to a new project.

To start enabling APIs:

1. In the Google Cloud Console, select the newly created project.
2. In the left-navigation menu, select **API & Services > Library**.  
   ![Highlight of the APIs & Services submenu and highlight of Library.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Collection/SCR_APIServicesLibrary.png)  
   This will open up the Library page that includes all available APIs.
3. Enter *Google Vault API* in the search bar and search.
4. Click the **Google Vault API** option, then click **Enable.**
5. In the top left corner, click the **Back arrow** icon.  
   This will take you back to the search results page with the search bar.
6. Enter *Admin SDK API* in the search bar and search.
7. Click the **Admin SDK API** option, then click **Enable**.
8. In the top left corner, click the **Back arrow** icon.  
   This will take you back to the search results page with the search bar.
9. Enter *Cloud Storage API* in the search bar and search.
10. Click the **Cloud Storage API** option, then click **Enable**.  
    ![The Cloud Storage API option.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Collection/SCR_CloudStorageAPI.png)

    > **Note:** This API may be enabled by default.

### Set up OAuth2 consent screen

Follow the steps below to create an OAuth2 consent screen.

1. Open [Google Cloud Console](https://console.cloud.google.com/) and select newly created project.
2. Click on the Navigation menu.
3. Select **APIs & Services > OAuth consent screen**.
4. Click **Get Started** on the OAuth Overview page.  
   ![The Get Started button on the OAuth Overview page.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_GetStarted.png "Click to expand.")
5. Enter descriptive **App name**. For example, *Relativity Preservation*.
6. Enter a User support email from within your organization.
7. Click **Next**.  
   ![The Project configuration page and fields.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_ProjectConfiguration.png "Click to expand.")
8. In the *Audience* section, select **Internal** and click **Next**.  
   ![The API & Service OAuth consent screen.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Collection/SCR_OAuth2ConsentScreen.png "Click to expand.")
9. Under Contact Information, enter any email addresses for Google to notify about any changes to the project. Click **Next**.
10. Click the checkbox to agree to the Google API Services User Data Policy. Click **Continue** and then click **Create**.
11. Navigate to the Branding tab and under **Authorized Domains** click **Add domain** and enter *relativity.one*.  
    ![Google Auth Platform Branding page.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_Branding.png "Click to expand.")

On the next step, you will want to add scopes.

1. Navigate to the **Data Access** tab and click **Add or remove scopes**.  
   ![The Data Access scope page.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_Scopes.png "Click to expand.")
2. Enter filter and select **https://www.googleapis.com/auth/ediscovery** or enter it in a text box.
3. Click **Update**.
4. Click **Save and Continue**.

### Create credentials

1. Navigate to the **Clients** tab on the OAuth Consent Screen..
2. Click **Create Client**.  
   ![The OAuth 2.0 Client IDs on the Clients page.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_Clients.png)
3. Enter the following information in the fields:
   - **Application type**—select *Web* application.
   - **Name**—enter a name for the credentials.
   - **Authorized redirect URIs**—enter the URL based on the Relativity aiR Data Center Geo you intend to run preservations from.
     - For example, *https://{InstanceURL}/Relativity.REST/api/Preservations/v1/Sources/workspace/{WorkspaceID}/GoogleVault/HandleAuthenticationRedirect*
     - When the *{InstanceURL}* is a Relativity instance URL and *{WorkspaceID}* is the Relativity workspace artifact ID where you are setting up the data source.
       - **InstanceURL**— log into your Relativity aiR workspace. The base URL shown is the InstanceURL. For example, *https://***company.relativity.one***/Relativity/.../workspace/1016855/*
       - **WorkspaceID**— log into your Relativity aiR workspace. The numerical value in the URL is the Workspace ID. For example, *https://company.relativity.one/Relativity/.../workspace/***1016855**
     - To add more than one authorized redirect URI:
       1. Navigate to the Authorized redirect URIs section.
       2. Click **+ Add URI** \[2\].
       3. Enter your specific redirect URI. Repeat this for any additional URIs you need.
4. Click **Create**.

![The Create OAuth client ID page.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_OAuthClientID_624x622.png "Click to expand.")

The newly added redirect URIs should now be recognized by Google's OAuth 2.0 server.

After clicking Create, a pop-up window appears and you can save your **Client ID** and **Client Secret**. You will need to use them when creating the new data source under [Create the Google Workspace data source](#Create2).

![The OAuth client created confirmation screen with Your Client ID and Your Client Secret fields.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Collection/SCR_OAuthClientCreated.png "Click to expand.")

## Google Workspace user account setup

A Preservation hold requires a user account on which behalf Relativity exports data. This can be a dedicated or an existing user account.

### Create admin role for Vault API

1. Open the [Google Admin page](https://admin.google.com/ac/home).
2. Click **Account > Admin roles** to open the up the page.
3. Click **Create New Role**.
4. Enter the role name. Relativity suggests *Relativity Preservation*.
5. Click **Continue** to select privileges.
6. Select the following privileges:
   - **Services - Google Vault > Manage Matters**
   - **Services - Google Vault > Manage Holds**

   ![Select the Google Vault services.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Legal_Hold/SCR_PreservationCreateAdminRoleVaultAPI.png)
7. Click **Continue**.
8. Click **Create Role**.

### Create admin role for the user accounts listing

1. Open the [Googe Admin page](https://admin.google.com/ac/home).
2. Click **Account > Admin roles** to open the up the page.
3. Click **Create New Role**.
4. Enter the role name. Relativity suggests *Users Reader for Preservation*.
5. Click **Continue**.
6. Select the **Admin API privileges - Users > Read** privilege.
7. Click **Continue**.
8. Click **Create Role**.

### Create admin role for the groups listing

1. Open the [Google Admin page](https://admin.google.com/ac/home).
2. Click **Account>Admin roles** to open the up the page.
3. Click **Create New Role**.
4. Enter the role name. Relativity suggests *Groups Reader for Preservation*.
5. Click **Continue**.
6. Select the **Admin API privileges - Groups > Read** privilege.
7. Click **Continue**.
8. Click **Create Role**.

### Enable required privileges

1. Open the [Google Admin page](https://admin.google.com/ac/home).
2. Navigate to **Directory > Users** to open the list of users.
3. Select or create the user you want to use.
4. Select and expand the **Admin roles and privileges** pane.
5. Assign the following roles to the user in All organizational units scope:
   - Relativity Preservation
   - Users Reader for Preservation
   - Groups Reader for Preservation

![Enable the required preservation privileges in Google Admin.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Legal_Hold/SCR_PreservationEnableReqdPrivlgs.PNG "Click to expand.")

## Create the Google Workspace data source

There are specific steps to connect Google Workspace to Relativity when creating the Preservation data source. To set up the Google Workspace data source, you must enable API access with Google Workspace and then complete the data source settings in Relativity.

After confirming that your Discover APIs are enabled, complete the set up process in Relativity.

To add the Google Workspace data source, follow the steps below:

1. Within the Preservation application, navigate to the **Preservation Data Source** tab.
2. Click the **New Preservation Data Source** button.
3. Enter in a unique name for the data source in the **Name** field.  
   ![The preservation data source page for Google Vault.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_GoogleVaultSource.png "Click to expand.")
4. Select **Google Vault** as the data **Source Type**.
5. Complete the **Google Vault** fields.
   - **Client ID**—enter the Client ID created when you created credentials. For more information, see [Create credentials](#Create).
   - **Client Domain**—enter the Client Secret created when you created credentials. For more information, see [Create credentials](#Create).
6. Click **Save**.
7. After saving, confirm that four services were created and linked to the data source. One for each of the following:
   1. Gmail
   2. Google Chat
   3. Google Drive
8. The status at the top of the page should read, “The user has never authenticated and must authenticate.”
9. Click the **Authenticate** button in the right pane.
10. Select or sign in to the Google account on which behalf preservations will be performed. For more information, see [Google Workspace user account setup](#Google). ![The Choose an account screen.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Legal_Hold/SCR_PreservationGoogleChooseAnAccount.png)
11. If authentication is successful, you will see the following message:  
    ![Success message.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Legal_Hold/SCR_PreservationAuthentSuccessfulMessage_591x30.png)
12. Close the window the successful authentication window.
13. Click the **Re-Validate Authentication** button in the right pane on the Preservation Data Source that you created. You should see the following status, “The user credentials are authenticated and ready to use.”

![The user credentials confirmation banner.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Relativity_Legal_Hold/SCR_PreservationReValidateAuthMessage.png)

If you are not able to authenticate, or reauthenticate, and see the *No refresh token was retrieved, please re-authenticate* message, you can do the following:

- Use another account to authenticate Google with Relativity.
- Use a different application to authenticate. You must use a different application for each registration.
- Delete all connections to that user in Google. To delete connections in Google Cloud Console:
  1. Navigate to Manage your **Google Account > Data and Privacy**
  2. Scroll to find **Third-party apps & services** section.
  3. Locate and select the app you created in Google to authorize with Relativity.
  4. Click **Delete all connections you have with \<app name>**.

After completing either of these tasks, retry authenticating.

### Preservation data source fields

You must add Google-specific data into the fields in the Default Category during the creation of a Google Workspace data source.

- **Name**—enter a unique name for this preservation data source.
- **Source Type**—select a Google Workspace data source.
- **Entity ID Field**—select an entity type.
- **Client ID**—enter the Client Id copied from Google’s OAuth2 credentials page.
- **Client Secret**—enter Client Secret copied from Google’s OAuth2 credentials page. For more information, see [Create credentials](#Create).

After saving, confirm that four services were created and linked to the data source.

## Data source details

Each data source details page includes a console to complete actions. Each data source has different actions.

For Google Vault:

- **Authenticate**—click to authenticate the client ID and client secret with Google.
- **Re-validate authentication**—click to re-authenticate the client ID and client secret with Google.

![The preservation data source layout with Google Vault details.](https://help.relativity.com/RelativityaiR/Content/Resources/Images/Features/Preservation_hold/SCR_GVDataSourceDetails.png "Click to expand.")
