Skip to content

Connect Gmail

Before anyone on your team can connect their Gmail, you need to create OAuth credentials in Google Cloud Console.

  1. Go to Google Cloud Console
  2. Click the project dropdown at the top and click New Project
  3. Name it (e.g., “Bobby CRM”) and click Create
  4. Select the new project from the dropdown
  1. Go to APIs & Services > Library
  2. Search for “Gmail API”
  3. Click Gmail API and then Enable
  1. Go to APIs & Services > OAuth consent screen
  2. Select External user type and click Create
  3. Fill in the app information:
    • App name: Bobby CRM (or your company name)
    • User support email: your admin email
    • Developer contact: your admin email
  4. Click Save and Continue
  5. On the Scopes page, click Add or Remove Scopes and add:
    • https://www.googleapis.com/auth/gmail.readonly
    • https://www.googleapis.com/auth/gmail.send
    • https://www.googleapis.com/auth/gmail.modify
    • https://www.googleapis.com/auth/userinfo.email
  6. Click Save and Continue
  7. Add test users if your app is in testing mode (add the email addresses of team members who will connect)
  8. Click Save and Continue
  1. Go to APIs & Services > Credentials
  2. Click Create Credentials > OAuth 2.0 Client ID
  3. Application type: Web application
  4. Name: “Bobby CRM”
  5. Under Authorized redirect URIs, add:
    https://<your-crm-api-domain>/api/v1/email/accounts/gmail/callback
    For local development, also add:
    http://localhost:8000/api/v1/email/accounts/gmail/callback
  6. Click Create
  7. Copy the Client ID and Client Secret

Add these to your CRM’s environment configuration:

GMAIL_CLIENT_ID=<your_client_id>
GMAIL_CLIENT_SECRET=<your_client_secret>
EMAIL_ENCRYPTION_KEY=<generated_key>

To generate the encryption key, run:

Terminal window
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

Restart the CRM backend after updating the environment.


  1. Go to Settings > Email Settings
  2. Click Connect Gmail
  3. A Google sign-in window opens — log in to your Gmail account
  4. Review the permissions and click Allow
  5. You’ll be redirected back to Bobby CRM
  6. Your Gmail account now appears under Connected Accounts
  • Click Sync Now on your connected account to pull in emails immediately
  • Bobby CRM fetches up to 100 messages per sync
  • Emails are automatically linked to matching contacts and companies in your CRM
ProblemSolution
”Access blocked: This app’s request is invalid”Check that the redirect URI in Google Cloud Console matches exactly
”Error 403: access_denied”Make sure the OAuth consent screen is configured and your email is added as a test user
No emails appearing after syncVerify that you have contacts in the CRM with matching email addresses
”OAuth credentials not configured”Ask your admin to complete Part 1