Set up an Outlook app registration
Use an app registration when a workflow needs app-only mailbox access. No user signs in. This is useful for shared or service mailboxes and the On Email Received trigger.
Before you begin
Create a Microsoft Entra app registration. Create a client secret. Copy its Client ID, Tenant ID, and Client Secret.
For app-only access, configure Application permissions. Do not use delegated permissions.
Add Microsoft Graph permissions
In your Microsoft Entra app registration, go to API permissions → Add a permission → Microsoft Graph → Application permissions.
Add the permissions required by your workflow:
Mail.Send
Application
Send emails as any user.
Mail.Read
Application
Read emails for the Search Emails action.
Mail.ReadBasic.All
Application
Required for the On Email Received trigger.
Mail.ReadWrite
Application
Create drafts, add attachments, modify messages, and reply or forward.
MailboxSettings.Read
Application
Get the list of email categories.
Calendars.ReadWrite
Application
Read calendars and create events.
User.Read.All
Application
Read user profiles. Optional.
Grant admin consent for your tenant after adding permissions.
Create a mailbox boundary
By default, app-only permissions grant access to all tenant mailboxes. Complete this step and the next one to limit access.
In the Microsoft 365 Admin Center, go to Teams & groups → Shared mailboxes.
Create the shared mailbox for the workflow.
Go to Active teams & groups → Mail-enabled security.
Create a mail-enabled security group, such as
StackAI-Authorized-Mailboxes.Add the shared mailbox to that group.
Restrict mailbox access
An administrator must complete these steps in PowerShell.
Connect to Exchange Online.
Connect-ExchangeOnlineCreate the access policy. Replace the values with your app's client ID and security-group email.
New-ApplicationAccessPolicy -AppId "YOUR_CLIENT_ID" ` -PolicyScopeGroupId "stackai-access@yourdomain.com" ` -AccessRight RestrictAccess ` -Description "Allow Stack AI to access authorized mailboxes only."Wait 15 minutes. Then verify access.
Test-ApplicationAccessPolicy -Identity "yourmailbox@yourdomain.com" -AppId "YOUR_CLIENT_ID"
The command must return AccessCheckResult: Granted.
Connection fields and action reference
See Microsoft Outlook for the current connector fields and supported actions.
Was this helpful?

