---
title: "Record the mirror root folder and changes page token. In browser mode this also creates the connection."
method: PUT
path: "/drive/connection"
tags: ["Google Drive"]
---

# Record the mirror root folder and changes page token. In browser mode this also creates the connection.

`PUT /drive/connection`

## Request

- Base URL: `https://www.livediagram.app/api`
- URL: `https://www.livediagram.app/api/drive/connection`
- Auth: HTTP bearer

## Request body

- object
  - `rootFolderId` string, nullable
  - `pageToken` string

## Response `200`

Success.

- object
  - `connection` DriveConnection, required
    - `connectedAt` number, required
    - `hasRefreshToken` boolean, required
    - `pageToken` string, nullable, required
    - `pageTokenSavedAt` number, nullable, required
    - `pendingAccountSwitch` object, nullable, required
      - `expiresAt` number, required
    - `rootFolderId` string, nullable, required
    - `status` 'connected' | 'needs_reconnect', required

## Other responses

- `400`: Error.
- `401`: Error.
- `404`: Error.
- `429`: Rate limited. Back off and retry.
- `503`: Error.

---

[API](https://skmtc.dev/livediagram/apis/livediagram-api.md) · [All operations](https://skmtc.dev/livediagram/apis/livediagram-api/llms.txt) · [OpenAPI document](https://skmtc.dev/livediagram/apis/livediagram-api/revisions/f286d27acfd2?raw)
