Set up a custom Outlook OAuth connector
Create a custom OAuth connector when authentication must run through your Microsoft Entra app. This applies to single-tenant and on-premises deployments. It also applies when you must restrict the requested scopes.
You'll register an app in Microsoft Entra ID, grant delegated Microsoft Graph permissions, create a client secret, and add those credentials to StackAI.
Register an app in Microsoft Entra ID
Sign in to the Microsoft Entra admin center or Azure portal.
Go to Identity → Applications → App registrations.
Select New registration.
Complete the form:
Name: Use a descriptive name, such as
StackAI Outlook OAuth2 Connector.Supported account types: Select Single tenant.
Redirect URI: Select Web. Enter
https://www.stackai.com/auth.
Select Register.
On the app's Overview page, copy these values:
Application (client) ID: Use this as the Client ID in StackAI.
Directory (tenant) ID: Use this as the Tenant ID in StackAI.
Add Microsoft Graph API permissions
A custom OAuth2 connector uses delegated Microsoft Graph permissions. The app acts on behalf of the signed-in user.
User.Read
Delegated
Read the signed-in user's profile for health checks via /me.
Mail.Read
Delegated
Read emails for the Search Emails action.
Mail.ReadWrite
Delegated
Create drafts, add attachments, modify messages, and reply or forward.
Mail.Send
Delegated
Send emails as the signed-in user.
MailboxSettings.Read
Delegated
Get the list of email categories.
Calendars.ReadWrite
Delegated
Read calendars and create events.
offline_access
Delegated
Obtain refresh tokens.
openid
Delegated
OpenID Connect sign-in.
profile
Delegated
Read basic profile information.
email
Delegated
Read the user's email address.
Mail.Read.Shared
Delegated
Read email in shared mailboxes and mailboxes delegated to the signed-in user
Mail.ReadWrite.Shared
Delegated
Create drafts, modify, reply to and forward messages in shared or delegated mailboxes
Mail.Send.Shared
Delegated
Send email from a shared or delegated mailbox
Calendars.ReadWrite.Shared
Delegated
Read and create events in calendars shared with or delegated to the signed-in user
In the app registration, go to API permissions → Add a permission.
Select Microsoft Graph.
Select Delegated permissions.
Select each required permission from the table.
Select Add permissions.
Grant admin consent
Pre-authorize high-privilege permissions for your tenant. This avoids individual consent prompts and tenant policy blocks.
In the app registration, go to API permissions.
Select Grant admin consent for _your tenant name_.
Confirm the dialog.
Each permission should show Granted for _tenant_ in the Status column.
Connection fields and action reference
See Microsoft Outlook for the current connector fields and supported actions.
Last updated
Was this helpful?

