Skip to content

Connect Outlook

Before anyone on your team can connect their Outlook account, you need to register an application in the Azure Portal.

  1. Go to Azure Portal > Azure Active Directory > App registrations
  2. Click New registration
  3. Fill in:
    • Name: Bobby CRM
    • Supported account types: Accounts in any organizational directory and personal Microsoft accounts
    • Redirect URI: Select “Web” and enter:
      https://<your-crm-api-domain>/api/v1/email/accounts/outlook/callback
  4. Click Register
  5. Copy the Application (client) ID from the overview page
  1. Go to Certificates & secrets > Client secrets
  2. Click New client secret
  3. Add a description (e.g., “Bobby CRM”) and set an expiry
  4. Click Add
  5. Copy the Value immediately (it won’t be shown again)
  1. Go to API permissions > Add a permission > Microsoft Graph
  2. Select Delegated permissions and add:
    • Mail.Read
    • Mail.Send
    • Mail.ReadWrite
    • User.Read
    • offline_access
  3. Click Add permissions
  4. Click Grant admin consent (requires Azure AD admin)

Add these to your CRM’s environment configuration:

OUTLOOK_CLIENT_ID=<your_client_id>
OUTLOOK_CLIENT_SECRET=<your_client_secret>
EMAIL_ENCRYPTION_KEY=<generated_key>

If you haven’t already created an encryption key (e.g., from Gmail setup), generate one:

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 Outlook
  3. A Microsoft sign-in window opens — log in to your Outlook/Microsoft 365 account
  4. Review the permissions and click Accept
  5. You’ll be redirected back to Bobby CRM
  6. Your Outlook account now appears under Connected Accounts
  • Click Sync Now on your connected account
  • Bobby CRM fetches up to 100 messages per sync
  • Emails are automatically linked to matching contacts and companies
ProblemSolution
”AADSTS65001: The user or administrator has not consented”Ask your Azure AD admin to grant admin consent for the app permissions
Redirect URI mismatch errorVerify the redirect URI in Azure matches exactly — including trailing slashes
No emails appearing after syncCheck that contacts exist in the CRM with matching email addresses
”OAuth credentials not configured”Ask your admin to complete Part 1