Connect OpenClaw to Gmail

~10 min setup · Requires Google Cloud Console access

One of the most powerful things OpenClaw can do is manage your email. It can scan your inbox, tell you what actually needs attention, draft replies, and even send them (with your approval).

This guide walks through the Gmail integration from scratch.

What You'll Be Able to Do

Once connected, you can ask OpenClaw things like:

Example prompts
"Check my inbox for anything urgent"

"Summarize the last 10 emails from my team"

"Draft a reply to Sarah's email about the project timeline"

"Find all unread emails from the past week about invoices"

It's like having an assistant who reads your email for you and surfaces what matters.

Prerequisites

Step 1: Create a Google Cloud Project

1 Go to Google Cloud Console

Head to console.cloud.google.com and sign in with the Google account you want to connect.

2 Create a new project

Click the project dropdown (top left), then "New Project." Name it something like "OpenClaw Gmail" and create it.

3 Enable the Gmail API

In your new project, go to "APIs & Services" → "Library." Search for "Gmail API" and click Enable.

Step 2: Set Up OAuth Credentials

4 Configure OAuth consent screen

Go to "APIs & Services" → "OAuth consent screen." Choose "External" (unless you have Workspace, then "Internal"). Fill in the required fields—app name, support email, developer email. Save and continue through the scopes (you'll add them later).

5 Create OAuth client ID

Go to "Credentials" → "Create Credentials" → "OAuth client ID." Choose "Desktop app" as the application type. Name it "OpenClaw" and create.

6 Download credentials

Click the download button (JSON) on your new credential. Save this file—you'll need it for OpenClaw.

Keep this file secure. The credentials JSON gives access to your Gmail. Don't commit it to git or share it publicly.

Step 3: Connect to OpenClaw

Now tell OpenClaw to use these credentials. The easiest way:

Send to OpenClaw
"Set up Gmail integration"

OpenClaw will walk you through the rest—where to put the credentials file, running the OAuth flow, and testing the connection.

If you prefer manual setup, place the credentials JSON in your OpenClaw workspace and reference it in your config. Check the official docs for the exact config syntax.

Step 4: Authorize Access

The first time OpenClaw tries to access Gmail, it'll give you a URL to visit. This is the OAuth flow:

  1. Click the link OpenClaw provides
  2. Sign in with your Google account
  3. You'll see a warning about unverified app—click "Advanced" then "Go to OpenClaw (unsafe)"
  4. Grant the permissions requested
  5. Copy the authorization code back to OpenClaw

Why "unsafe"? Google shows this warning for apps that haven't gone through their verification process. Since this is your own private integration, it's fine. You're authorizing your own app to access your own email.

Test It

Once connected, try these:

Quick test
"What are my 5 most recent emails?"

If OpenClaw lists your recent emails, you're good. Now you can start building actual workflows.

Workflow Ideas

Morning Email Triage

"Check my inbox. Tell me which emails need a response today vs. which can wait. Ignore newsletters."

Auto-Draft Replies

"For each email from my manager this week, draft a brief reply. Don't send—just show me the drafts."

Weekly Summary

"Every Monday at 9am, summarize important emails I received last week and any I haven't responded to."

Invoice Tracking

"Find all emails with PDF attachments from vendors this month. List the amounts if visible."

Security Notes

Troubleshooting

"Access blocked" error

Make sure you added yourself as a test user in the OAuth consent screen (APIs & Services → OAuth consent screen → Test users).

"Invalid credentials" error

Re-download the credentials JSON and make sure OpenClaw is pointing to the correct file path.

Token expired

OAuth tokens expire. If OpenClaw stops working after a while, you may need to re-authorize. It should prompt you automatically.

Need help? Join the Discord community or check the official docs.