Connect Gmail to B6AI
Set up the Gmail integration end to end, from creating credentials in Gmail to verifying the live connection and using it in your bots.
Overview
The Gmail integration connects a Gmail or Google Workspace mailbox so bots and workflows can triage inbound email, draft and send replies, and apply labels for routing.
It turns a shared inbox (like support@yourco.com) into an automated first line that classifies, responds to, and organizes email.
What you can do with Gmail
Once connected, your bots and agents can use Gmail inside conversations and automations. Typical uses include:
- Read new inbound emails and classify them (for example by intent or priority).
- Send replies on behalf of the connected mailbox.
- Apply or remove labels to route messages or mark them handled.
- Create drafts for an agent to review before sending.
- Extract details from an email (order number, account id) to drive a flow.
How the integration works
You connect with one click, B6AI uses its own Google app, so there is nothing to create in Google Cloud and no Client ID/Secret to copy.
Clicking Connect sends you to Google to sign in to the mailbox and approve the Gmail permissions; Google returns a secure refresh token that B6AI stores encrypted at rest.
B6AI calls the Gmail API on your behalf, limited to exactly the scopes you approved.
Prerequisites
Make sure all of the following are in place before you start. Each one is required, skipping any will cause the connection to fail later.
- A Gmail or Google Workspace account for the mailbox you want to connect.
- The ability to sign in to that mailbox and approve access.
- The Enterprise Admin role in B6AI.
Generate your Gmail connection
B6AI authenticates with Gmail using your Gmail connection. Follow these steps exactly, each field you copy here is entered into B6AI later.
- Unlike a manual API setup, Gmail needs no Google Cloud project, OAuth client or Client ID/Secret from you, B6AI provides the Google app.
- You only need to be able to sign in to the mailbox you want to connect.
- The connection is created during Connect (next section), where you pick the mailbox and approve the Gmail permissions.
Required permissions & scopes
Grant only the scopes below. Each one maps to a specific B6AI capability; requesting fewer reduces risk and speeds up any review your Gmail administrator performs. The table explains exactly what each scope allows and why it is needed.
| Scope / permission | What it allows | Why B6AI needs it |
|---|---|---|
| gmail.readonly | Read messages and metadata | Triage and classify inbound email |
| gmail.send | Send email as the mailbox | Send replies from a conversation |
| gmail.modify | Modify message labels and state | Apply labels and mark messages handled |
| gmail.labels | Create and manage labels | Set up the routing labels your flows use |
| openid, email | Identify the authorized account | Confirm which mailbox you connected |
Connect Gmail in B6AI
Now enter your credentials in B6AI. Signed in as an Enterprise Admin, open Settings → Integrations, find the Gmail card and click Connect, then complete the form. Every field is explained below.
- In B6AI, open Settings → Integrations and click Connect on the Gmail card.
- Sign in to the Google mailbox and approve the Gmail permissions B6AI requests.
- You’re returned to B6AI and the card shows “Connected”, there is nothing to paste.
- When building a bot, use the Gmail action nodes to read, label, draft or send mail.
{
"provider": "gmail",
"mailbox": "support@yourco.com",
"status": "connected"
}Verify the connection
Confirm the integration is live before you rely on it in a bot.
- Confirm the Gmail card shows “Connected”.
- Run the Send test email action to an address you control.
- Confirm the email arrives and that any configured label was applied.
Troubleshooting
If the connection fails or an action does not work, match the symptom below to its cause and fix.
| Symptom / error | Likely cause | How to fix it |
|---|---|---|
| “Please reconnect” / invalid_grant | The Google authorization expired or was revoked | Click Connect again and re-approve access |
| access_denied | You declined a permission during consent | Reconnect and approve all requested Gmail permissions |
| 403 insufficientPermissions | The bot uses an action needing a scope you didn’t approve | Reconnect and approve the full set of Gmail permissions |
| Wrong mailbox connected | You signed in with a different Google account | Disconnect, then Connect again and pick the correct mailbox |
Limitations & rate limits
Keep these constraints in mind so your bots behave predictably at scale.
- Gmail API usage is subject to per-user rate limits and daily quotas.
- Sending volume must stay within Gmail/Workspace sending policy.
- B6AI accesses only the mailbox you authorized and only the scopes you approved.
Security best practices
- Grant only the scopes and permissions listed above, never request more “just in case”.
- Rotate your Gmail connection on a regular schedule, and immediately if you suspect exposure.
- Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
- Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
- Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
- Disconnect the integration the moment a credential leaks; then rotate it in Gmail before reconnecting.
Recommendations
- Test against a sandbox or non-production Gmail account before connecting live data.
- Document which bots and flows depend on this integration so changes are predictable.
- Set a recurring reminder to review scopes and rotate credentials.
- Enable only the capabilities you actually use today; you can widen scopes later.