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

# Google Workspace

> Connect Google Workspace to Orbb with a service account and domain-wide delegation for read-only, organization-wide access to Gmail metadata and Calendar events.

## Overview

This integration allows read-only access to your Google Workspace, enabling the Orbb app to fetch information across the entire organization with a single click. It is designed to only read data without the capability to write or modify. This ensures secure access while allowing the monitoring of every contextual relationship within the organization.

## Prerequisites

* A Google Workspace domain.
* A service account with a client ID.

> [!WARNING]
>
> Only users with **administrative** privileges can perform these actions. Ensure you have the necessary permissions before proceeding.

> [!NOTE]
>
> For further information regarding domain-wide delegation, visit [Control Google Workspace API access with domain-wide delegation.
> ](https://support.google.com/a/answer/162106).

## Step-by-Step Guide

### 1. Access API Controls

* Navigate to your domain’s [Admin console](http://admin.google.com/).
* Go to: **Main Menu -> Security -> Access and data control -> API controls.**

### 2. Manage Domain-Wide Delegation

* In the **Domain wide delegation** pane, select **Manage Domain Wide Delegation**.
* Click **Add new**.

### 3. Enter Service Account Details

* In the `Client ID` field, enter the client ID obtained from the service account creation.

* Paste Orbb's Client ID: `118229953076945640756`.

* In the `OAuth Scopes` field, enter the following scopes:
  ```text theme={"system"}
  https://www.googleapis.com/auth/gmail.metadata,
  https://www.googleapis.com/auth/admin.directory.user.readonly,
  https://www.googleapis.com/auth/calendar.readonly
  ```

* Click **Authorize**.

> [!NOTE]
>
> **OAuth Scopes Explanation**
>
> The following OAuth scopes are used in this configuration:
>
> * `gmail.metadata`: Access to email metadata (subject, sender, recipients, date) without reading message content.
> * `admin.directory.user.readonly`: This scope provides read-only access to the user's directory information in Google Workspace.
> * `calendar.readonly`: This scope grants read-only access to the user's calendar events.
>
> These scopes ensure that the application can only read data without the capability to modify it, maintaining data integrity and security.

After completing these steps, your service account will have domain-wide access and can impersonate any domain user within the specified scopes.

## Delegate to Gmail Application

Gmail, a cornerstone service of Google Workspace, is a widely used email service known for its robust functionality, user-friendly interface, and strong security features. It offers seamless integration with other Google services like Calendar, Drive, and Contacts, making it a preferred choice for personal and professional communication

### Step-by-Step Guide

1. Navigate to Apps > Google Workspace > Gmail > User Settings [Gmail App Settings](https://admin.google.com/ac/apps/gmail/usersettings).
2. Click on **Mail delegation.**
3. Check "Let users delegate access to their mailbox to other users in the domain"
4. Click **SAVE**.

![Mail Delegation Settings](https://storage.googleapis.com/intail-public/docs/Mail%20Delegation%20Settings.png)


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