---
updatedAt: 2026-10-28T16:50:27.000Z
agentTools:
  projectIndex: https://docs.sublime.security/llms.txt
---

# Self Managed - Google Workspace

<Callout icon="📘" theme="info">
  ### Google Workspace Super Administrator Required

  To add a Google Workspace message source, you need to be a [super administrator](https://support.google.com/a/answer/2405986#super_admin) for your Google Workspace organization or get the help of a super administrator.
</Callout>

You can add a Google Workspace message source when setting up your Sublime organization or by going to `Admin` > `Message Sources` > `New message source` in the Sublime dashboard and selecting `Google Workspace`.

# Overview

In order for your Enterprise self-hosted instance of Sublime on AWS to access mail for your Google Workspace organization programmatically, you must upload a Google Cloud Platform service account key to which you've granted [domain-wide delegation of authority](https://support.google.com/a/answer/162106) for your Google Workspace organization. This is required so that only you have access to your mail, and not anyone else, including the Sublime team.

<Callout icon="📘" theme="info">
  ### Google Cloud Project Creator Permission Required

  To create a Google Workspace message source when self-hosting Sublime, you must have the **Project Creator** permission in Google Cloud, or get the help of a colleague with that permission.

  This requirement for self-hosting is in addition to the Google Workspace super administrator requirement, which applies to both Sublime Cloud and self-hosting.
</Callout>

***

# Setup

There are 4 high-level steps to creating a service account key, which are described in detail below:

1. Set up a Google Cloud Platform project
2. Create a service account for the project
3. Grant domain-wide delegation to the service account
4. Add info to Sublime Platform

## 1. Set up a Google Cloud Platform project

1. Go to <a href="https://console.cloud.google.com" target="__blank"><https://console.cloud.google.com></a> and sign in with your Google Workspace account
2. If you've never used Google Cloud Platform before, agree to the terms

![](https://files.readme.io/5883324-gcp_terms.png "gcp_terms.png")

3. Click the dropdown in the upper left

![](https://files.readme.io/80a61f5-new_gcp_account__annotated.png "new_gcp_account__annotated.png")

4. Click the **New Project** button
5. Add a project name in the **Project name** field (for example, "Sublime Platform")
6. Click the **Create** button and wait a moment for the new project to be created
7. Click **Select Project** in the notification for your new project in the upper right

![](https://files.readme.io/6e7d1f2-new_project__annotated.png "new_project__annotated.png")

8. Type "admin sdk" into the search bar and select **Admin SDK API** in the search results

![](https://files.readme.io/3c19a8f-admin_api_search_results__annotated.png "admin_api_search_results__annotated.png")

9. Click the **Enable** button and wait for the page to reload when the Admin SDK API is enabled
10. Type "gmail" into the search bar and select **Gmail API** in the search results
11. Click the **Enable** button and wait for the page to reload when the Gmail API is enabled
12. Type "calendar" into the search bar and select **Google Calendar API** in the search results
13. Click the **Enable** button and wait for the page to reload when the Google Calendar API is enabled
14. Type "cloud pub/sub" into the search bar and select **Cloud Pub/Sub API** in the search results
15. Click the **Enable** button and wait for the page to reload when the Cloud Pub/Sub API is enabled
16. Type "alert center" into the search bar and select **Google Workspace Alert Center API** in the search results
17. Click the **Enable** button and wait for the page to reload when the Google Workspace Alert Center API is enabled
18. Type "oauth" into the search bar and select **OAuth consent screen** in the search results, and click Get Started.
19. Under **App information**, provide an app name (for example, "Sublime Platform")
20. In the **User support email** dropdown, select your email address or any other available email address, then click **Next**
21. Under **Audience**, select **Internal**, then click **Next**
22. Under **Contact Information** enter your email address, then click **Next**
23. Read and tick the box to agree to the terms
24. Click the **Create** button

***

## 2. Create a service account

1. In the Google Cloud Platform interface, type "service accounts" into the search bar and select **Service Accounts** in the search results
2. Click the **Create Service Account** button
3. Add a service account name (for example, "Sublime Platform") and optionally a service account description
4. Click the **Create and Continue** button
5. Under **Grant this service account access to project**, click the dropdown, search for "Pub/Sub Admin" and select the matching role.
6. Click the **Done** button. You can ignore the remaining service account setup options.
7. In the service accounts list, select the service account you just created
8. Near the bottom of the details view, click **Advanced settings**
9. Copy the **Client ID** that appears under **Domain-wide Delegation** and hold on to it for use later in this guide
10. Click the **Keys** tab in the horizontal tabs list
11. Click the **Add Key** dropdown
12. Select **Create new key**
13. Select the **JSON** key type if it's not selected by default
14. Click the **Create** button and hold on to the file that is saved to your computer. **This is the file you'll need when setting up a Google Workspace message source.**

***

## 3. Grant domain-wide delegation

1. Sign in to the Google Workspace admin interface at <https://admin.google.com>
2. In the lefthand sidebar, click **Security** > **Access and data control** > **API controls**
3. Scroll down and click **Manage Domain Wide Delegation** under **Domain wide delegation**
4. Click **Add new**
5. Paste the **Client ID** you copied when configuring the service account
6. Paste this value into the **OAuth scopes** field:

```
https://mail.google.com/,https://www.googleapis.com/auth/admin.directory.user.readonly,https://www.googleapis.com/auth/admin.directory.customer.readonly,https://www.googleapis.com/auth/admin.directory.domain.readonly,https://www.googleapis.com/auth/admin.directory.group.readonly,https://www.googleapis.com/auth/admin.directory.orgunit.readonly,https://www.googleapis.com/auth/admin.reports.audit.readonly,https://www.googleapis.com/auth/apps.alerts,https://www.googleapis.com/auth/calendar.events,https://www.googleapis.com/auth/calendar.calendarlist.readonly
```

7. Click the **Authorize** button

***

## 4. Review Google's "User-reported phishing" rule

These steps ensure Sublime will receive notifications when users report messages through Gmail's "Report phishing" feature, allowing you to [view these reports in Sublime](https://docs.sublime.security/docs/gmails-report-phishing-feature).

1. Sign in to the Google Workspace admin interface at <https://admin.google.com>
2. Click "Rules" in the sidebar on the left
3. Locate the system-defined **User-reported phishing** rule and confirm Status is **Active** and Alerts is **On**
4. Click the rule to open its details and confirm Alerts is On under Actions
5. If Alerts is not On:
   1. Mouse over the Actions section and click the edit icon that appears in the upper right
   2. Check the box next to Alert Center
   3. Click Continue, then Update Rule

***

## 5. Use your new service account key

When setting up a Google Workspace message source in the Sublime Dashboard, paste the contents of the service account key file you downloaded into the **Service Account Key JSON** field.