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

# Google Workspace

> Google Workspace APIs providing access to Google Drive, Docs, and Sheets.

Google Workspace APIs providing access to Google Drive, Docs, and Sheets. Best for workflows that need to manage files, read/write spreadsheets, or edit documents — storage and documents in one provider, unlike Notion (structured knowledge only). Gmail and Google Calendar are served separately by the Gmail and Google Calendar providers.

9 example endpoints available through Lava's AI Gateway. See the [Google Workspace API docs](https://developers.google.com/workspace) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://www.googleapis.com` is supported. Drive, Docs, and Sheets APIs. Multiple base URLs — use get\_provider\_docs for endpoint reference. The endpoints below are curated examples.</Info>

## Endpoints

### List Drive files

**GET** `https://www.googleapis.com/drive/v3/files` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://www.googleapis.com/drive/v3/files', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fwww.googleapis.com%2Fdrive%2Fv3%2Ffiles" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Get spreadsheet data

**GET** `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fsheets.googleapis.com%2Fv4%2Fspreadsheets%2F%7BspreadsheetId%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Get document content

**GET** `https://docs.googleapis.com/v1/documents/{documentId}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://docs.googleapis.com/v1/documents/{documentId}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdocs.googleapis.com%2Fv1%2Fdocuments%2F%7BdocumentId%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Create a folder or file metadata in Drive

**POST** `https://www.googleapis.com/drive/v3/files` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://www.googleapis.com/drive/v3/files', {
      body: {
    "name": "New Folder",
    "mimeType": "application/vnd.google-apps.folder"
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fwww.googleapis.com%2Fdrive%2Fv3%2Ffiles" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name":"New Folder","mimeType":"application/vnd.google-apps.folder"}'
    ```
  </Tab>
</Tabs>

### Update file metadata (rename, move, etc.)

**PATCH** `https://www.googleapis.com/drive/v3/files/{fileId}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://www.googleapis.com/drive/v3/files/{fileId}', { method: 'PATCH', body: {"name":"Renamed File"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Fwww.googleapis.com%2Fdrive%2Fv3%2Ffiles%2F%7BfileId%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name":"Renamed File"}'
    ```
  </Tab>
</Tabs>

### Permanently delete a file from Drive

**DELETE** `https://www.googleapis.com/drive/v3/files/{fileId}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://www.googleapis.com/drive/v3/files/{fileId}', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fwww.googleapis.com%2Fdrive%2Fv3%2Ffiles%2F%7BfileId%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

### Apply updates to a document (insert text, format, etc.)

**POST** `https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate', {
      body: {
    "requests": [
      {
        "insertText": {
          "location": {
            "index": 1
          },
          "text": "Hello, world!"
        }
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdocs.googleapis.com%2Fv1%2Fdocuments%2F%7BdocumentId%7D%3AbatchUpdate" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"requests":[{"insertText":{"location":{"index":1},"text":"Hello, world!"}}]}'
    ```
  </Tab>
</Tabs>

### Append rows to a spreadsheet

**POST** `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED', { body: {"values":[["Row 1 Col A","Row 1 Col B"]]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fsheets.googleapis.com%2Fv4%2Fspreadsheets%2F%7BspreadsheetId%7D%2Fvalues%2F%7Brange%7D%3Aappend%3FvalueInputOption%3DUSER_ENTERED" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"values":[["Row 1 Col A","Row 1 Col B"]]}'
    ```
  </Tab>
</Tabs>

### Update cell values in a spreadsheet

**PUT** `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED', { method: 'PUT', body: {"values":[["Updated value"]]} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Fsheets.googleapis.com%2Fv4%2Fspreadsheets%2F%7BspreadsheetId%7D%2Fvalues%2F%7Brange%7D%3FvalueInputOption%3DUSER_ENTERED" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"values":[["Updated value"]]}'
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
