← Back to tutorials

Connect Google Workspace

Prerequisites (both methods)

1

Create Google Cloud OAuth Credentials

This step is done in your own browser — nothing to do on the MyClaw instance yet.

  1. Open Google Cloud Console → APIs & Services → Credentials.
  2. Click + CREATE CREDENTIALS → OAuth client ID → Application type: Desktop app.
  3. Click Create → Download JSON. Save the client_secret_xxx.json file — you'll need it next.
Open Google Cloud Console

You must also configure the OAuth consent screen and add yourself as a Test user under APIs & Services → OAuth consent screen. Without this, authorization will fail.

2

Enable Gmail API and Google Calendar API

Click each link below and hit Enable. Only takes a few seconds each.

Only need calendar? Just enable the Calendar API (and use --services calendar in later steps).

No commands needed. Do everything from your chat window (Telegram / WebChat).

B.1

Ask OpenClaw to install gog

OpenClaw
You
Install gog for me
OpenClaw
Installing... ✅ gog v0.11.0 installed!
B.2

Send the credentials file

OpenClaw
You
client_secret_xxx.json
Connect my Gmail and Calendar
OpenClaw
Got the credentials file, configuring... ✅ Credentials imported. What's your Gmail address?
B.3

Provide your email, get auth link

OpenClaw
You
your@gmail.com
OpenClaw
Please open this link in your browser to authorize: https://accounts.google.com/o/oauth2/auth?... After authorizing, the page will redirect to 127.0.0.1 and show an error — that's normal. Copy the full URL from your address bar and send it to me.
B.4

Paste the callback URL

OpenClaw
You
http://127.0.0.1:42845/oauth2/callback?state=xxx&code=xxx...
OpenClaw
✅ Gmail + Calendar connected! You can now just say: • "Check my recent emails" • "Create a meeting for tomorrow at 3 PM"

That's it — three messages and you're connected.

What you can do now

FeatureJust say
📧 Check email"Check my recent emails" / "Any emails from xxx?"
📧 Send email"Send an email to a@b.com about..."
📅 View calendar"What's on my schedule this week?"
📅 Create events"Schedule a meeting for Friday at 2 PM"
📧 Draft emails"Draft a reply to that email"

Troubleshooting

Q: "Access blocked" or "App not verified" during authorization

A: You didn't add yourself as a Test user on the OAuth consent screen. Go back to Step 1, open OAuth consent screen → Test users, and add your Gmail address.

Q: 403 accessNotConfigured error

A: The API isn't enabled. Go back to Step 2 and make sure both Gmail API and Calendar API show "Enabled".

Q: Callback URL expired

A: Just redo the authorization step — it's quick. Tell OpenClaw "re-authorize" and it'll give you a fresh link.

Q: no TTY available for keyring error in WebSSH

A: Prefix the command with GOG_KEYRING_PASSWORD="anypassword", e.g.:

GOG_KEYRING_PASSWORD="mypass123" gog auth add your@gmail.com ...