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

# Gmail

> Connect Gmail to automatically import invoice emails and attachments into ClearSpend.

The **Gmail** integration (tagged **Track Spend**) scans your inbox for billing-related emails, downloads attachments, and turns them into documents ClearSpend parses for subscriptions, amounts, and renewal dates. Connect from **Integrations** on the **Gmail** card.

<Note>
  **Gmail vs Google Drive.** [Gmail](/connect/gmail) imports from your **inbox** (invoice emails and attachments). [Google Drive](/connect/google-drive) imports **PDF files** from a Drive folder you choose. Connect both if invoices arrive by email and by shared drive.
</Note>

## What you get

| Result                                            | Where to see it                                                                            |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| Invoice PDFs and attachments from matching emails | **[Documents](/features/documents)** — source shows as Gmail sync                          |
| Parsed vendors, amounts, and billing periods      | **[Subscriptions](/features/subscriptions)** and **[Dashboard](/features/dashboard)** KPIs |
| Apps mentioned only in invoice emails             | **[Apps](/features/apps)** — often within an hour or two of the first sync                 |

ClearSpend requests **read-only** Gmail access. It reads message metadata and downloads attachments for processing; it does not send email on your behalf.

## Who can connect

**Owners** and **Admins** can connect and disconnect Gmail. **Members** and **Viewers** cannot start a new OAuth connection. See [Roles and permissions](/reference/roles-permissions).

## Connect Gmail

<Steps>
  <Step title="Open Integrations">
    Navigate to **Integrations** in the sidebar.
  </Step>

  <Step title="Find Gmail">
    Locate the **Gmail** card under **Track Spend**.
  </Step>

  <Step title="Click Connect">
    Click **Connect**. You are redirected to Google's OAuth consent screen.
  </Step>

  <Step title="Choose the inbox">
    Sign in with the Google account whose inbox receives billing email (your own mailbox, a shared billing inbox, or a finance alias — whichever holds the invoices you want imported).
  </Step>

  <Step title="Approve read-only scopes">
    Approve the requested permissions. ClearSpend uses read-only Gmail scopes to list and download invoice attachments. You can revoke access later from your Google account or from **Integrations**.
  </Step>

  <Step title="Wait for the first sync">
    After authorization, ClearSpend redirects you back to **Integrations**. A first sync starts automatically. Most inboxes finish within a couple of minutes; large mailboxes with many historical invoices can take longer. The card shows **last sync** when a pass completes.
  </Step>
</Steps>

<video controls className="w-full rounded-lg" src="https://assets.clearspend.ai/content/videos/connect_gmail.mp4">
  Your browser does not support the video tag.
</video>

## How Gmail sync works

On each sync, ClearSpend:

1. **Searches your inbox** for emails that look like billing mail — typically messages with attachments whose subjects mention terms such as *invoice*, *receipt*, *statement*, *payment*, or *bill*.
2. **Skips already-processed messages** so the same attachment is not imported twice.
3. **Downloads attachments** (PDFs and other supported formats) and uploads them for parsing.
4. **Creates document rows** that flow into subscription matching and spend totals.

The first sync looks back roughly **180 days** unless a narrower window is configured for your workspace. Later syncs pick up new mail since the previous run.

<Tip>
  Use [Processing rules](/settings/processing-rules) if you need to exclude specific senders or subjects from auto-import across integrations.
</Tip>

## Link multiple inboxes

You can connect **more than one Gmail account** to the same workspace — useful when invoices are split across personal mailboxes, shared billing inboxes, or different Google accounts. Each connection appears as its own row when you expand the **Gmail** card on **Integrations**.

Repeat the connect steps for each account that receives SaaS billing email.

## Connected state

When Gmail is active, the card shows a green status indicator, how many accounts are linked, and the last sync time. Expand the card to see each linked inbox, sync status, and actions for that connection.

<video controls className="w-full rounded-lg" src="https://assets.clearspend.ai/content/videos/connected_integrations.mp4">
  Your browser does not support the video tag.
</video>

## Gmail vs other upload paths

| Method                                                                 | Best for                                                                                  |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| **Gmail integration** (this page)                                      | Ongoing, hands-free import from inboxes you control via OAuth                             |
| **[Email forwarding](/connect/data-sources#forward-an-invoice-email)** | Forwarding individual messages to your workspace's `@clearspend.cc` address without OAuth |
| **[Google Drive](/connect/google-drive)**                              | PDFs stored in a shared Drive folder rather than email                                    |
| **[Manual upload](/connect/data-sources#upload-a-document)**           | One-off files not in your inbox                                                           |

## Common questions

<AccordionGroup>
  <Accordion title="Why don't I see all my subscriptions yet?">
    Discovery happens in two waves. Integrations like Google Workspace surface apps within minutes. Vendors that only appear in invoice email are added as those messages are parsed — usually within an hour or two of connecting Gmail. If something is still missing after a day, [upload an invoice manually](/connect/data-sources#upload-a-document) to seed it.
  </Accordion>

  <Accordion title="Which emails are imported?">
    ClearSpend focuses on messages with **attachments** that match billing-related keywords in the subject. Emails without attachments, sent mail, and drafts are skipped.
  </Accordion>

  <Accordion title="Is my email data safe?">
    Yes. Access is read-only, tokens are encrypted, and you can disconnect from **Integrations** at any time.
  </Accordion>
</AccordionGroup>

## Disconnect

Return to **Integrations**, expand the **Gmail** card, and disconnect the account you no longer want synced. Documents already imported stay in your workspace.

## Related

* [Integrations overview](/connect/integrations)
* [Google Workspace](/connect/google-workspace)
* [Google Drive](/connect/google-drive)
* [Adding a data source](/connect/data-sources)
* [Documents](/features/documents)
* [Processing rules](/settings/processing-rules)
