> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/integrations/integrations-google-drive/set-up-service-account.md).

# Set up service account

{% hint style="warning" %}
Before you set up a service account, you need to [create a Google admin account](/docontrol-user-guide/integrations/integrations-google-drive/create-google-admin-user.md).&#x20;
{% endhint %}

Create and link a service account in Google Cloud Platform (GCP) with the Google admin user you created in the previous step. Complete these steps in Google Cloud console:

1. [Create a new project in Google Cloud Platform (GCP)](#id-1.-create-a-new-project-in-google-cloud-platform-gcp)
2. [Enable Google Drive APIs](#id-2.-enable-google-drive-apis)
3. [Create a new service account](#id-3.-create-a-new-service-account)
4. [Grant access](#id-4.-grant-access)
5. [Copy client ID](#id-5.-copy-client-id)

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FBonibZYCiffte1jsAXYT%2FGoogle%20Wizard%20service%20account.png?alt=media&amp;token=20e058ab-5db0-4dc7-b743-549a3e7f7e06" alt=""><figcaption></figcaption></figure>

## 1. Create a new project in Google Cloud Platform (GCP)

We recommend creating a **new** project in Google Cloud Platform (GCP) with the Google admin user you created in the previous step.&#x20;

If you choose to use an existing project, skip to [Enable Google Drive APIs](#id-2.-enable-google-drive-apis).

1. Login to [Google Cloud Platform](https://console.cloud.google.com/cloud-resource-manager) and click **Create Project.**
2. In the **New Project** window, enter the project name.
3. In the **Organization** field, select your organization.
4. In the **Location** field, enter the parent organization or folder. This resource will be the hierarchical parent of the new project.
5. Click **Create.**
6. Continue to the next step: [Enable Google Drive APIs](#id-2.-enable-google-drive-api).

![](https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FbXwvg8c5aYCXQFrCO9kb%2Fskitch%20\(30\).png?alt=media\&token=c7033628-31f8-4a72-b9c3-75c8a6a14a27)

## 2. Enable Google Drive APIs

Assign the Google Drive APIs to your Google Cloud Platform (GCP) project.

1. In Google Cloud Platform, navigate to the [APIs and services dashboard](https://console.cloud.google.com/projectselector2/apis/dashboard?supportedpurview=project), and select the project for configuring the service account.
2. From the top menu, click **+ Enable APIs and services**. The API library opens.
3. In the search bar, search and select each API:
   * **Google Drive API**
   * **Admin SDK API**
   * **Drive Labels API**
4. Click **Enable** and verify that each API is enabled, as indicated with a green checkmark![](https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FJmvQd453ND4MjgOBcdRr%2Fimage.png?alt=media\&token=6176b8cd-6765-47f4-897f-6f77a48dff04)
5. Continue to the next step: [Create a new service account](#id-3.-create-a-new-service-account).

## 3. Create a new service account

In  Google Cloud Platform, create a service account for Google Workspace.

1. In Google Cloud Platform, navigate to [IAM and Admin > Service account](https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts?supportedpurview=project\&authuser=2).
2. Select the project you created in Google Cloud Platform (GCP).
3. From the top menu, click **+ Create service account**.&#x20;
4. Under **Service account details,** enter the name (required). An ID is autogenerated.&#x20;
5. Enter a description (optional) and click **Create**.&#x20;
6. Under **Grant this service account access to project**, click **Continue**. There is no need to select a role.&#x20;
7. Under **Grant users access to this service account (optional)**, click **Done.** There is no need to enter any fields.&#x20;
8. Continue to the next step: [Grant access](#id-4.-grant-access).

## 4. Grant access&#x20;

After creating a new service account, assign the relevant permissions to the service account:

1. In Google Cloud Platform, navigate to [IAM and Admin > Service account ](https://console.cloud.google.com/iam-admin/serviceaccounts)and select your project.
2. Click the service account you created.
3. From the top menu, click **Permissions >** **Grant access**.
4. In the **New principals** field, enter the **admin email** that will be assigned to the service account, and click **Save**. Make sure to enter the admin email that you created in the previous step.
5. Continue to the next step: [Copy client ID](#id-5.-copy-client-id).

## 5. Copy client ID

In  Google Cloud Platform, copy the client ID for the next step.

1. In Google Cloud Platform, navigate to [IAM and Admin > Service account ](https://console.cloud.google.com/iam-admin/serviceaccounts)and select your project.
2. Click the service account you created.
3. From the top menu, click the **Details** tab.
4. Select **Show advanced settings** > **Domain-wide delegation**, and copy the **Client ID.**
5. Keep the client ID to paste in the next step.
6. Continue to the next step: [Define scopes](/docontrol-user-guide/integrations/integrations-google-drive/define-scopes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/integrations/integrations-google-drive/set-up-service-account.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
