Email Integration
OpenClaw + Gmail
Send, search, and manage emails in Gmail from your AI assistant.
Category
Setup Time
~5 minutes
What you can do
- Send emails
- Search inbox
- Read messages
- Manage labels
Setup Guide
Prerequisites
- OpenClaw running (see our deployment guide)
- A Google account (personal or Workspace)
- Access to Google Cloud Console
Step 1: Create a Google Cloud Project
- Go to console.cloud.google.com
- Click Select a project → New Project
- Name it "OpenClaw" and click Create
- Select your new project
Step 2: Enable Gmail API
- Go to APIs & Services → Library
- Search for "Gmail API"
- Click Enable
Step 3: Configure OAuth Consent Screen
- Go to APIs & Services → OAuth consent screen
- Choose External (or Internal for Workspace)
- Fill in required fields: - App name: OpenClaw - User support email: your email - Developer contact: your email
- Click Save and Continue
- Add scopes: -
- Click Save and Continue
- Add yourself as a test user
https://www.googleapis.com/auth/gmail.send
- https://www.googleapis.com/auth/gmail.readonly
- https://www.googleapis.com/auth/gmail.modify (optional, for drafts/labels)
Step 4: Create OAuth Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Choose Web application
- Add authorized redirect URI: -
- Click Create
- Copy Client ID and Client Secret
http://localhost:3000/oauth/callback (local)
- https://your-domain.com/oauth/callback (production)
Configuration
Add the Gmail channel to your OpenClaw config:
# In your openclaw config
channels:
gmail:
enabled: true
client_id: "YOUR_CLIENT_ID"
client_secret: "YOUR_CLIENT_SECRET"
redirect_uri: "https://your-domain.com/oauth/callback"
Or via environment variables in your docker-compose.yml:
environment:
- GMAIL_ENABLED=true
- GMAIL_CLIENT_ID=your_client_id
- GMAIL_CLIENT_SECRET=your_client_secret
- GMAIL_REDIRECT_URI=https://your-domain.com/oauth/callback
Step 5: Authorize Access
- Restart OpenClaw:
docker compose restart openclaw - Visit the OAuth URL in logs or OpenClaw UI
- Sign in with Google
- Grant the requested permissions
- You'll be redirected back with a success message
Verification
Try asking OpenClaw to work with Gmail:
"Send an email to john@example.com with subject 'Meeting notes'"
"Search my inbox for emails from 'boss@company.com'"
"Show unread emails from today"
"Draft an email to the team about the project update"
Check logs for API calls:
docker compose logs -f openclaw | grep -i gmail
Common Issues
Access denied: Make sure you've completed the OAuth flow. The token is stored securely after authorization.
Token expired: Google tokens expire after a period. OpenClaw automatically refreshes tokens using the refresh token. Re-authorize if refresh fails.
Quota exceeded: Gmail API has daily quotas (1 billion quota units/day for most scopes). This is very high for personal use.
App in testing: While your app is in testing mode, only added test users can authorize. Publish the app for broader access.
Frequently Asked Questions
Does OpenClaw work with Gmail?
Yes — OpenClaw integrates with Gmail via the official Gmail API with OAuth authentication. It can send emails, search your inbox, read messages, and manage labels. Setup takes about 5 minutes.
Is the Gmail integration free?
Yes. The Gmail integration is free and included with OpenClaw. Gmail's API is free for personal use. You only pay for hosting (~$7/mo) and AI API usage (~$3-10/mo).
How do I set up Gmail with OpenClaw?
Create a Google Cloud project, enable Gmail API, configure OAuth consent screen, create OAuth credentials, add them to your OpenClaw config, and authorize access.
Is my Gmail data secure?
Yes. OpenClaw uses OAuth 2.0 for secure authentication. Your credentials and tokens are stored encrypted. You can revoke access at any time from your Google account settings.
Can OpenClaw read all my emails?
Only if you grant the gmail.readonly or gmail.modify scope during authorization. You control what permissions to grant. You can limit to send-only access if preferred.
Ready to set up Gmail?
Follow our free guide to deploy OpenClaw and connect Gmail in minutes.
Official docs: https://docs.openclaw.ai/channels