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

# Google Drive

> My Drive and shared drive import and export

`provider: "gdrive"` · Import and export · Requires enablement

The Google Drive connector links a folder in My Drive or a shared drive to a vault, in either direction.

<Info>
  Google Drive requires enablement for your organization before it will authorize. Until then, `POST /connectors/v1/connections` returns `403 connector_scope_not_enabled`. Contact support to request access.

  Check the `providers` array from `GET /connectors/v1/connections` before showing a Drive option in your UI.
</Info>

## Browsing

Browse with no parameters to list My Drive and any shared drives the connected user can reach, then descend by folder.

```bash title="cURL" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl "https://api.case.dev/connectors/v1/connections/conn_abc123/browse" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
```

```json title="Response" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
{
  "items": [
    { "id": "root", "name": "My Drive", "kind": "my_drive", "browse_ref": { "kind": "container", "container_id": "root" } },
    { "id": "0AAbCdEf", "name": "Litigation", "kind": "shared_drive", "browse_ref": { "kind": "container", "container_id": "0AAbCdEf" } }
  ]
}
```

Drive folder ids are globally unique, so a link's identity rests on `folder_id` alone. `container_id` is present only for shared drives; absent or `root` means My Drive.

## Importing a folder

```bash title="cURL" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl -X POST https://api.case.dev/connectors/v1/transfer \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "direction": "import",
    "connection_id": "conn_abc123",
    "remote": {
      "container_id": "0AAbCdEf",
      "folder_id": "1XyZabc",
      "path": "Clients/Acme"
    },
    "vault_id": "vault_abc123"
  }'
```

Everything under the selected folder is imported recursively.

## Change detection

Drive has a native change feed, so incremental runs are cheap.

On a backfill, the connector captures a change token **before** it walks the folder, so edits made during a long walk land in the next run rather than falling into a gap. Large folders checkpoint as they go and resume without restarting from the root.

If a stored change token ages out, Drive reports `410` and the connector re-backfills automatically. The ledger deduplicates unchanged files by content version, so a re-backfill does not re-import anything.

## Content identity

Version identity is the cheapest signal that changes only when content changes—a checksum for ordinary files, and version plus modification time for Google-native documents. A rename or a move therefore updates metadata **without re-downloading the file**.

## Export

Drive supports `direction: "export"` and `direction: "both"`. With `both`, exports default to a `CaseMark Output` subfolder under the import root, and that subfolder is excluded from the import side so exported files are never re-imported.

Export never deletes anything in Drive.

## Rate budget

Drive allows 12,000 requests per minute with four concurrent transfers. In practice you are far more likely to be bounded by vault ingestion throughput than by Drive.

A large folder does not start every ingestion at once: imports commit through a bounded preparation window and then queue into the shared ingestion dispatcher.

## Reconnection

Google refresh tokens are long-lived, so reconnection is rare once a user has consented.

## Capabilities at a glance

|                  |                                             |
| ---------------- | ------------------------------------------- |
| Containers       | My Drive, shared drives                     |
| Browse depth     | Container → folder                          |
| Change detection | Native delta                                |
| Export           | Yes                                         |
| Collections      | Not applicable                              |
| Scope tier       | `drive`                                     |
| Rate budget      | 12,000 requests/min, 4 concurrent transfers |
| Webhooks         | Not used for sync                           |

## Next steps

<CardGroup>
  <Card title="Import & Export" href="/connectors/transfers">
    Link mechanics, policies, and progress
  </Card>

  <Card title="Errors & Recovery" href="/connectors/errors">
    Reauthorization, access loss, and throttling
  </Card>

  <Card title="All providers" href="/connectors/providers">
    Compare against the other supported providers
  </Card>
</CardGroup>
