> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/g/google-workspace.md).

# Google Workspace

Google Workspace is the Google suite for business. OctoXLabs reads users and, depending on the options, devices, Chrome browsers, domains and license assignments.

## Use cases

* Inventory ChromeOS and mobile devices managed by Google together with your other devices.
* Track license assignments per SKU.
* Check what one Google Workspace connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination                                     | Port         | Protocol     |
| ------------------- | ----------------------------------------------- | ------------ | ------------ |
| OctoXLabs connector | Google Workspace APIs and Google OAuth endpoint | Not verified | Not verified |

### Required permissions

| Scope or role                                    | Permission       | Needed for       |
| ------------------------------------------------ | ---------------- | ---------------- |
| `admin.directory.user.readonly`                  | Read             | Users (required) |
| `admin.directory.device.chromeos.readonly`       | Read             | ChromeOS devices |
| `admin.directory.device.mobile.readonly`         | Read             | Mobile devices   |
| `admin.directory.device.chromebrowsers.readonly` | Read             | Chrome browsers  |
| `admin.directory.domain.readonly`                | Read             | Domains          |
| `apps.licensing`                                 | Read assignments | Licenses         |

Each scope is prefixed with `https://www.googleapis.com/auth/`. Each part asks for its own scope, so a part whose scope is not authorized is skipped with a warning and the rest is still collected. The licensing scope has no read-only variant; the adapter only reads license assignments. The Workspace admin user needs admin privileges for the data that is collected.

## Create credentials in Google Workspace

{% stepper %}
{% step %}

### Create a service account and key

Create a service account and download a JSON key. The same key can be used for the Google Directory adapter.
{% endstep %}

{% step %}

### Authorize domain-wide delegation

In the Admin console go to **Security** > **Access and data control** > **API controls** > **Manage Domain Wide Delegation** > **Add new**. Enter the service account client ID.
{% endstep %}

{% step %}

### Add the OAuth scopes

Enter the scopes from the permissions table for the data you collect, each prefixed with `https://www.googleapis.com/auth/`.
{% endstep %}

{% step %}

### Choose an administrator

Pick a Workspace administrator email. The service account acts on behalf of this user.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                | Required | Type    | Default                                                                                                                                                                   | Description                                                                                                                                                                                   |
| ------------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Service Account Email    | Yes      | String  | None                                                                                                                                                                      | Email of the service account.                                                                                                                                                                 |
| Service Account Key File | Yes      | File    | None                                                                                                                                                                      | JSON key file of the service account.                                                                                                                                                         |
| Workspace Admin Email    | Yes      | String  | None                                                                                                                                                                      | Administrator that the service account acts for through domain-wide delegation.                                                                                                               |
| Customer Id              | No       | String  | my\_customer                                                                                                                                                              | Unique ID of the Workspace account. `my_customer` stands for the account of the admin user. When licenses are collected with `my_customer`, the real ID is read from the admin user's record. |
| Fetch ChromeOS Devices   | No       | Boolean | True                                                                                                                                                                      | Collect ChromeOS devices.                                                                                                                                                                     |
| Fetch Mobile Devices     | No       | Boolean | True                                                                                                                                                                      | Collect mobile devices managed by Google endpoint management, with the applications installed on Android devices.                                                                             |
| Fetch Chrome Browsers    | No       | Boolean | False                                                                                                                                                                     | Collect Chrome browsers managed with Chrome Enterprise Core, with their extensions.                                                                                                           |
| Fetch Domains            | No       | Boolean | False                                                                                                                                                                     | Collect domains and domain aliases.                                                                                                                                                           |
| Fetch Licenses           | No       | Boolean | False                                                                                                                                                                     | Collect license assignments, counted per SKU.                                                                                                                                                 |
| License Product Ids      | No       | List    | Google-Apps, 101068, 101047, 101034, 101031, 101037, 101038, 101054, Google-Vault, 101001, 101005, 101052, 101050, 101049, 101036, 101043, 101033, 101039, 101040, 101035 | Product IDs of the License Manager API to read. Remove the ones the account does not use.                                                                                                     |
| Proxy                    | No       | String  | None                                                                                                                                                                      | Proxy URL.                                                                                                                                                                                    |
| Timeout                  | No       | Integer | 30                                                                                                                                                                        | Time in seconds to wait for API responses.                                                                                                                                                    |

Required flags and types come from the frontend instructions and were not checked against connector code.

## Troubleshooting

| Error message | Cause                                               | Fix                                                     |
| ------------- | --------------------------------------------------- | ------------------------------------------------------- |
| Not verified  | Error texts could not be taken from connector code. | Run the connection test and check the parameters above. |

## Change history

{% hint style="info" %}
Available starting from version 6.9.0.
{% endhint %}
