Connect Email (Gmail)
This guide walks you through connecting a Gmail account to Pinchy so your agents can work with email — reading, searching, drafting, and sending messages.
The setup has two parts: creating an OAuth app in Google Cloud (one-time), then connecting the account in Pinchy.
Prerequisites
Section titled “Prerequisites”- Pinchy is running with HTTPS enabled (see Lock Pinchy to a Domain)
- You’re logged in as an admin in Pinchy
- A Google Cloud Console account (free — any Google account works)
Part 1: Create a Google Cloud OAuth app
Section titled “Part 1: Create a Google Cloud OAuth app”Google requires you to register your Pinchy instance as an OAuth application before users can sign in with Google. This is a one-time step per Pinchy installation.
1.1 Open Google Cloud Console and select a project
Section titled “1.1 Open Google Cloud Console and select a project”- Go to console.cloud.google.com
- In the top bar, click the project name (or Select a project if none is selected)
- Create a new project (e.g. “Pinchy”) or select an existing one
1.2 Configure the Auth Platform
Section titled “1.2 Configure the Auth Platform”Google Cloud uses the Auth Platform to manage OAuth consent screens and app identity. You need to set this up before creating credentials.
-
In the left sidebar, navigate to APIs & Services → OAuth consent screen
Google redirects you to Auth Platform → Overview. If you see “Google Auth Platform not yet configured”, click Get Started.
-
Under Branding, fill in:
- App name — enter
Pinchy(this name appears on the Google sign-in screen) - User support email — select your email address
- Click Save
- App name — enter
-
Under Audience, choose who can use this OAuth app:
Audience When to choose Notes Internal Your company uses Google Workspace (G Suite) Only people in your organization can connect — no Google review required. Recommended. External Personal Gmail accounts, or no Google Workspace Anyone with a Google account can connect. Read the note below before choosing this.
1.3 Add Gmail scopes
Section titled “1.3 Add Gmail scopes”Scopes define what data your OAuth app can access. You need to add the Gmail scopes that match the permissions you want to grant agents.
-
In the Auth Platform sidebar, click Data Access
-
Click Add or remove scopes
-
In the filter, search for
gmailand add these scopes:Scope Required for https://www.googleapis.com/auth/gmail.readonlyRead and search emails https://www.googleapis.com/auth/gmail.composeCreate drafts and send emails https://www.googleapis.com/auth/userinfo.emailIdentify the connected account -
Click Update and then Save
1.4 Add test users (External apps only)
Section titled “1.4 Add test users (External apps only)”If you chose External audience, Google restricts access to explicitly approved test users while your app is in Testing mode.
- In the Auth Platform sidebar, click Audience
- Under Test users, click Add users
- Enter the Gmail address(es) of the accounts you want to connect to Pinchy
- Click Save
1.5 Create OAuth credentials
Section titled “1.5 Create OAuth credentials”Now you create the actual Client ID and Client Secret that you’ll enter in Pinchy.
-
In the Auth Platform sidebar, click Clients, then Create client (alternatively: APIs & Services → Credentials → Create Credentials → OAuth client ID)
-
Under Application type, select Web application
-
Give it a name (e.g. “Pinchy”)
-
Under Authorized redirect URIs, click Add URI and paste the redirect URI shown in the Pinchy wizard (Settings → Integrations → Add Integration → Google, step 1)
-
Click Create
A dialog appears with your Client ID and Client Secret. Copy both values now — the Client Secret is only shown once. (If you lose it, you can create a new one in the credentials list.)
Part 2: Connect the account in Pinchy
Section titled “Part 2: Connect the account in Pinchy”-
Open the Add Integration wizard
In Pinchy, go to Settings → Integrations and click Add Integration, then select Google.

-
Enter your OAuth credentials
Paste the Client ID and Client Secret from Part 1 and click Save & Continue.
Pinchy encrypts these credentials and stores them on your server — they never leave your infrastructure.
-
Connect a Google account
Click Connect Google Account. Google’s sign-in screen opens — sign in with the Gmail account whose email the agent should access.
After signing in, grant the requested permissions. If your app is in Testing mode, you’ll see a warning screen first — click Continue to proceed.
-
Verify the connection
You’re redirected back to Pinchy. The integration list now shows the connected Gmail address with a green “Connected” status.
For subsequent Google connections (a second Gmail account), the OAuth credentials step is skipped — you go straight to “Connect Google Account”.
Part 3: Grant agent email permissions
Section titled “Part 3: Grant agent email permissions”A connection alone doesn’t give any agent access. You must explicitly grant permissions per agent.
-
Open the agent you want to connect to email
-
Click the gear icon to open Agent Settings
-
Select the Permissions tab
-
In the Email section, select the connected account and check the operations this agent may perform:
Permission What it enables Read messages List, read, and search emails Create drafts Create draft emails (saved but not sent) Send messages Send emails immediately — cannot be undone -
Click Save
Publishing an External app
Section titled “Publishing an External app”If you chose External audience and want to remove the 7-day token expiry and the “This app isn’t verified” warning, you can publish your app.
For apps that only use Gmail scopes, Google may require a security review before publishing. This process can take several weeks. An easier alternative for most Pinchy users is to switch to Internal audience (requires Google Workspace) — no review needed.
To publish an External app:
- Go to Auth Platform → Audience
- Under Publishing status, click Publish app
- Follow the prompts — if your app uses restricted scopes (Gmail is restricted), Google will require a verification process
Test it
Section titled “Test it”Open the agent’s chat and try a few queries:
- “Show me my latest unread emails”
- “Search for emails from max@example.com about invoices”
- “Draft a reply to the last email saying we’ll process it today”
- “How many unread emails do I have?”
Available tools
Section titled “Available tools”When email permissions are granted, the agent gets access to these tools:
| Tool | Permission required | Description |
|---|---|---|
email_list | Read | List emails from a folder (INBOX, SENT, DRAFTS). Supports filtering by read status. |
email_read | Read | Read the full content of a specific email by ID. |
email_search | Read | Search emails using Gmail search syntax (e.g. from:user@example.com subject:invoice newer_than:7d). |
email_draft | Draft | Create a draft email. Can also create reply drafts with replyTo. |
email_send | Send | Send an email immediately. Can also send replies with replyTo. |
Token refresh
Section titled “Token refresh”Google access tokens expire after about one hour. Pinchy automatically refreshes expired tokens in the background — no action required.
If a refresh fails (e.g. the Google account revoked access, or the refresh token expired after 7 days in Testing mode), remove the connection in Settings → Integrations and reconnect the Google account.
What’s next
Section titled “What’s next”- Integrations — how connections and permissions work
- Agent Permissions — the full allow-list model