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

# Google Drive

> Index documents from Google Drive folders and shared drives into a Vector using a service account.

<Badge color="green" shape="pill" icon="sparkles">New</Badge> <Badge color="blue" shape="pill" icon="vector-square">Vectors only</Badge>

# Overview

Google Drive is Google's cloud file storage. Datazone signs in with a **Google Cloud service account** and indexes the documents in the folders and shared drives you share with it into a [Vector](/reference/development/vectors). Access is read-only (`drive.readonly` scope).

<Note>
  Google Drive sources hold documents, not tables. They are used by **Vectors** only — they have no extracts and no schema to infer.
</Note>

## Prerequisites

Create a service account, enable the Google Drive API, and share the content you want to index with the service account. See [How to get the credentials](#how-to-get-the-credentials) below.

## Connection Parameters

Set on the source when you create it. Names match the API and CLI payload.

<ParamField path="name" type="string" required>
  **Name** — a unique identifier for your Google Drive source.
</ParamField>

<ParamField path="credentials_json" type="string" required>
  **Service Account Key JSON** — the full contents of the service account's JSON key file. Stored encrypted.
</ParamField>

## How to get the credentials

<Steps>
  <Step title="Create or pick a Google Cloud project">
    In the [Google Cloud console](https://console.cloud.google.com), select a project or create a new one.
  </Step>

  <Step title="Enable the Google Drive API">
    Go to **APIs & Services → Library**, search for **Google Drive API**, and click **Enable**.
  </Step>

  <Step title="Create a service account">
    Go to **IAM & Admin → Service Accounts → Create service account**. Give it a name such as `datazone-drive`. It needs no project roles.
  </Step>

  <Step title="Create a JSON key">
    Open the service account, go to **Keys → Add key → Create new key → JSON**. A `.json` file is downloaded. Paste its entire contents into **Service Account Key JSON** in Datazone.
  </Step>

  <Step title="Share your content with the service account">
    Copy the service account's email (it looks like `datazone-drive@my-project.iam.gserviceaccount.com`) and share with it, as **Viewer**:

    * a **folder or file** in My Drive: right-click → **Share**, or
    * a **shared drive**: **Manage members** → add the email.
  </Step>
</Steps>

<Warning>
  The key file grants access to everything shared with the service account. Treat it like a password, and don't commit it to a repository. If your organization blocks service account key creation (the `iam.disableServiceAccountKeyCreation` policy), ask a Google Cloud admin to allow it for your project.
</Warning>

## Using the source in a Vector

When you create a [Vector](/reference/development/vectors), choose a connected source as the data source, then pick a path. The vector stores them as `source` and `source_path`, and both must be set together.

The top level contains the shared drives the service account belongs to and the items shared with it. A path is the folder names joined by `/`:

| Path | Indexes |
| - | - |
| `Finance` | The shared drive or shared folder named `Finance` |
| `Finance/Policies` | The `Policies` folder and its subfolders |
| `Finance/Policies/handbook.pdf` | A single file |

The path picker in the Datazone UI lets you browse the folders instead of typing the path.

## Limitations

* Only content shared with the service account is visible. A folder that is not shared will give `not found or not shared with the service account`.
* Subfolders are indexed recursively.
* Supported file types: **PDF, CSV, DOCX, XLSX, XLS, MD, TXT**. Other files are skipped.
* **Google Docs** are exported to DOCX and **Google Sheets** to XLSX before indexing. Other Google-native files, such as Slides, are skipped.
* Names must match exactly. If two folders at the same level share a name, the first one found is used.

## Troubleshooting

| Error | Likely cause |
| - | - |
| `Invalid service account key JSON` | The pasted value is not the complete JSON key file. |
| `Google Drive error (403)` | The Google Drive API is not enabled in the key's project. |
| `Folder '…' not found or not shared with the service account` | The folder was not shared with the service account's email, or the name does not match. |


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