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

# Google Workspace

> Connect Pawz to Gmail, Calendar, Drive, Sheets, and Docs — just click Connect with Google.

# Google Workspace

Connect Pawz to Gmail, Calendar, Drive, Sheets, and Docs. He can read your inbox, send emails, schedule meetings, browse files, and read/write spreadsheets — all hands-free.

## What Pawz Can Do With Google

Once connected, Pawz gets 10 Google tools:

**Email (Gmail)**

* Read your inbox, search for specific emails ("find all unread emails from Sarah")
* Read full email contents
* Send emails as you (to anyone, with CC, plain text or HTML)

**Calendar**

* See your upcoming schedule ("what meetings do I have this week?")
* Create events with attendees, location, and description

**Drive**

* Browse and search your Google Drive files
* Read the contents of Docs, Sheets, PDFs, and text files

**Sheets**

* Read spreadsheet data (shows as formatted tables)
* Add new rows to spreadsheets (great for logging, tracking, data entry)

**Any Google API**

* A generic tool that can hit any Google REST API endpoint for anything not covered above

***

## Setup

1. Go to **Skills** → **Google Workspace** → **Enable** it
2. Click **Connect with Google**
3. Your browser opens — sign in with your Google account and click **Allow**
4. The browser says "Pawz Connected!" — you can close it
5. Back in Pawz, you should see **"Connected as [you@gmail.com](mailto:you@gmail.com)"**

That's it. Try telling Pawz:

* *"Check my inbox"*
* *"What's on my calendar this week?"*
* *"Send an email to [hello@example.com](mailto:hello@example.com) saying hi"*
* *"What files are in my Google Drive?"*

<Callout type="info">
  You'll see a "This app isn't verified" warning from Google during sign-in. This is normal — click **Advanced** → **Go to Pawz (unsafe)** to continue.
</Callout>

***

## Gmail Search Tips

When asking Pawz to find specific emails, he uses Gmail's search syntax under the hood:

| What you say                             | What Pawz searches                |
| ---------------------------------------- | --------------------------------- |
| "Find unread emails"                     | `is:unread`                       |
| "Emails from Sarah"                      | `from:sarah@...`                  |
| "Emails about invoices"                  | `subject:invoice`                 |
| "Emails with attachments from last week" | `has:attachment after:2026/02/16` |
| "Starred emails"                         | `is:starred`                      |

***

## Disconnecting

Go to **Skills** → **Google Workspace** → **Disconnect**. You can also revoke Pawz's access from [myaccount.google.com/permissions](https://myaccount.google.com/permissions).

***

## Security

* Your refresh token is **encrypted** in Pawz's credential vault (AES-256-GCM) — not stored in plain text
* Access tokens live in memory only, never written to disk, and expire after 1 hour
* Pawz only requests the permissions it needs (Gmail, Calendar, Drive, Sheets, Docs)

***

## Self-Hosted Builds

If you're building Pawz from source, the bundled Google OAuth credentials aren't included. You have two options:

### Option A: Set Build-Time Credentials

Set these environment variables before building:

```bash theme={null}
export PAW_GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
export PAW_GOOGLE_CLIENT_SECRET="GOCSPX-your-secret"
cargo tauri build
```

To get these values, create an OAuth 2.0 Client ID in [Google Cloud Console](https://console.cloud.google.com/apis/credentials/oauthclient) → choose **Desktop app**. You'll also need to [enable the APIs](https://console.cloud.google.com/apis/library) (Gmail, Calendar, Drive, Sheets, Docs) and [set up an OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent).

### Option B: Paste Credentials in the UI

Without build-time credentials, Pawz will show Client ID and Client Secret fields in the Google Workspace skill settings. Paste your own OAuth credentials there, then click **Connect with Google**.

***

## Enterprise Setup (Service Account)

<Callout type="warn">
  This is for **Google Workspace admins** who want server-to-server auth with domain-wide delegation. Most users should use the OAuth flow above.
</Callout>

If you need Pawz to act as a dedicated robot user (e.g. `pawz@yourdomain.com`) without interactive login — use a service account:

1. [Create a Google Cloud project](https://console.cloud.google.com/projectcreate) and [enable the APIs](https://console.cloud.google.com/apis/library)
2. [Create a service account](https://console.cloud.google.com/iam-admin/serviceaccounts/create) → download the JSON key
3. [Set up domain-wide delegation](https://admin.google.com/ac/owl/domainwidedelegation) with the service account's Client ID and the required scopes
4. In Pawz: Skills → Google Workspace → open the **Enterprise — Service Account** section → paste the JSON key and delegated email

***

## Troubleshooting

**"Connect with Google" opens browser but nothing happens**
The consent flow has a 2-minute timeout. Make sure you complete sign-in and click Allow within that time. If it times out, just click Connect again.

**"Google OAuth failed: Token exchange failed"**
For self-hosted builds: double-check your Client ID and Secret. For official builds: try disconnecting and reconnecting.

**"Google API error (403): Insufficient Permission"**
One or more Google APIs may not be enabled for the project backing the OAuth credentials.

**"Access denied" or "This app isn't verified" warning**
Click **Advanced** → **Go to Pawz (unsafe)** to proceed. This is normal.

**Calendar times are wrong**
Tell Pawz to use natural language like "tomorrow at 2pm" — he'll format it correctly.
