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

# Sync Gmail with your Hedwig workspace

> Connect Gmail to automatically match incoming emails to your clients, projects, and invoices — with AI summaries and automatic attachment storage.

When you connect Gmail, Hedwig turns your inbox into a smart layer on top of your workspace. Incoming emails containing invoices, contracts, or project-related messages are automatically recognized, matched to the right client or project, and summarized so you always know what needs your attention — without having to dig through threads manually.

## What Gmail sync does

Once connected, Hedwig monitors your inbox for emails that contain financial documents or business-relevant attachments. Specifically:

* **Client and project matching** — Hedwig matches incoming email threads to existing clients and projects in your workspace based on sender email addresses and domain. Threads from known clients are linked automatically.
* **AI thread summaries** — Each synced thread gets a one-to-two sentence summary generated by Hedwig's AI assistant, focused on what action (if any) is required from you.
* **Attachment detection and storage** — PDF and image attachments that look like invoices or contracts are automatically stored in your workspace. Hedwig uses AI vision to extract key fields: invoice number, issuer, amount, currency, issue date, and due date.
* **Document type detection** — Hedwig identifies whether an email or attachment contains an invoice, contract, receipt, or proposal, and tags it accordingly so you can filter your inbox by type.

<Note>
  Hedwig only reads emails — it never sends emails on your behalf. The Gmail connection is read-only, and your email content is used solely to match and summarize threads within your workspace.
</Note>

## What gets synced

Hedwig syncs inbox threads that match **at least one** of the following criteria:

* The email has a PDF, Word, or similar document attachment with a filename containing words like "invoice", "contract", "agreement", or "proposal"
* The subject line or email snippet indicates a payment request, contract, or financial document

Threads classified as unrelated to invoices or contracts (receipts, newsletters, general correspondence) are not stored. Your personal emails stay private.

## How to connect Gmail

<Steps>
  <Step title="Open Settings">
    In Hedwig, navigate to **Settings** from the main menu or sidebar.
  </Step>

  <Step title="Go to Workspace integrations">
    Scroll down to the **Workspace integrations** section. You will see Gmail listed with a "Not connected" status.
  </Step>

  <Step title="Connect Gmail">
    Click **Connect** next to Gmail. You will be redirected to Google's sign-in page.
  </Step>

  <Step title="Authorize Hedwig">
    Sign in with the Google account you want to connect and grant Hedwig read-only access to your Gmail. You will be returned to Hedwig automatically once authorization is complete.
  </Step>

  <Step title="Wait for initial sync">
    Hedwig immediately begins syncing your inbox in the background. Your first batch of matched threads will appear in the Magic Inbox within a few minutes.
  </Step>
</Steps>

<Tip>
  Connect the Google account that receives payment-related emails from your clients. If you use a separate work email, connect that account for the best matching results.
</Tip>

## Reviewing synced threads

After sync, matched threads appear in the **Magic Inbox** inside your workspace. Each thread shows:

* The sender name and email
* The AI-generated summary
* Any detected invoice amount, currency, and due date
* The matched client or project (if one was found)
* A tag for document type (invoice, contract, receipt, proposal)

If a thread is matched to the wrong client or project, you can correct it directly from the inbox. You can also mark threads as **matched** (confirmed) or **ignored** to keep your inbox clean.

## Manually refreshing

Hedwig syncs automatically in the background. If you want to force a refresh immediately — for example, after receiving a new invoice — go to **Settings → Workspace integrations**, then click **Refresh**.

## How to disconnect Gmail

<Steps>
  <Step title="Open Settings">
    Navigate to **Settings** in your Hedwig workspace.
  </Step>

  <Step title="Find the Gmail integration">
    Scroll to **Workspace integrations** and find the Gmail row.
  </Step>

  <Step title="Disconnect">
    Click **Disconnect**. Hedwig will immediately revoke its access to your Gmail account. Previously synced thread data remains in your workspace until you delete it.
  </Step>
</Steps>

<Warning>
  Disconnecting Gmail stops all future email syncing. Threads already matched to clients and projects will remain in your workspace, but Hedwig will not read any new emails until you reconnect.
</Warning>
