Connect & Sync Outlook 365 Mailboxes via API
Build powerful email features into your app using the Outlook Email API. Read, send, sync and react to Outlook and Microsoft 365 emails through a single REST interface backed by Microsoft Graph, without maintaining OAuth flows yourself.
const response = await fetch(
`https://${DSN}/api/v1/emails`,
{
headers: {
'X-API-KEY': apiKey,
'account_id': outlookAccountId
}
}
);
const emails = await response.json();
// emails.items, array of Outlook messages
// works for Outlook, Gmail & IMAPWhat is the Outlook Email API?
The Outlook Email API is a RESTful interface that gives developers programmatic access to Outlook and Microsoft 365 mailbox data. Built on top of Microsoft Graph, it lets your application read, send, organise and sync emails in any Outlook or Exchange Online account - using OAuth 2.0 for secure, user-delegated authentication. Developers integrate the Outlook Email API to build email clients, CRM sync engines, ATS tools, and outreach automation without exposing user credentials.
Why Integrate the Outlook Email API into Your App?
Integrating the Outlook Email API into your application gives your users direct access to their Microsoft 365 mailbox inside your product, with no tab-switching and no manual copy-paste. Here are the four core capabilities that teams unlock most often.
Microsoft Outlook API for Your CRM Solution
Sync Outlook conversations into sales pipelines and customer records
Sync Outlook Email for Applicant Tracking Systems
Microsoft Graph API for recruitment platforms and HR software
Sync the Outlook API for Outreach Tools
Power multi-channel sales engagement platforms with Microsoft Graph
Integrating the Outlook Email API into your outreach software gives sales teams a single source of truth for every prospect interaction. Conversations stay in sync, follow-ups fire automatically, and engagement data feeds straight into your dashboards.
Setting up Microsoft OAuth for the Outlook Email API
Microsoft OAuth DocsBy default, your integration uses Unipile's OAuth credentials. To get a full white-label experience when end users connect their Outlook or Microsoft 365 mailbox, register your own app in Microsoft Entra ID. Follow the 7 steps below to create the registration, configure permissions, and connect it to the Outlook Email API in your Unipile workspace.
Create a Microsoft Entra ID account
If you do not already have one, create a free Microsoft Entra ID account (formerly Azure Active Directory). This is the admin portal where you register the OAuth application that powers your Outlook Email API integration.
Register a new app in the Azure portal
Log in to portal.azure.com, open Microsoft Entra ID, and click New registration.
- Name your app: this name appears on the Microsoft OAuth consent screen shown to your end users.
- Supported account types: select "Accounts in any organizational directory (Any Microsoft Entra ID, Multitenant) and personal Microsoft accounts" so you can connect both business Microsoft 365 and personal Outlook mailboxes.


Add redirect URIs
Open the Authentication panel and click Add URI under the Web section. Add 2 redirect URIs using your Unipile DSN (available in the Unipile Dashboard, top right corner):
https://{{YOUR_DSN_less_port}}/api/v1/hosted/microsoft_auth_request_callback/port{{YOUR_PORT}}
Configure Microsoft Graph permissions
Go to API permissions > Add a permission > Microsoft Graph, then add the following Delegated permissions for the Outlook Email API:
For Calendar features, also add Calendars.ReadWrite, Calendars.Read, Calendars.Read.Shared and Calendars.ReadWrite.Shared, then enable them in your Unipile Dashboard scopes settings.



Create a client secret
Open Certificates & secrets, click New client secret. Give the secret a description and set an expiration of 730 days (24 months), then click "Add".



Connect your app to the Unipile Dashboard
Open the Unipile Dashboard and navigate to Settings > Microsoft OAuth.
- Copy-paste the Application (Client) ID from the Azure Overview page.
- Paste the secret value from the Certificates & secrets page.
- Click Save.

Test the connection
From the Unipile Dashboard, trigger a new Microsoft account link to verify that your custom OAuth credentials work end-to-end. You should see your app name and branding inside the Microsoft consent prompt instead of Unipile defaults.

8
Become a verified publisher
Recommended for production - removes the "unverified" warning on the consent screen
With publisher verification, a blue checkmark appears in the OAuth consent prompt. Without it, business Microsoft 365 accounts may see an "unverified publisher" warning that hurts your sign-up conversion.
Step 1: join the Microsoft Partner Network
- Sign up at partner.microsoft.com and choose the Microsoft AI Cloud Partner Program.
- If you need a work account, create a new tenant first.
Step 2: verify your domain
Create a file named microsoft-identity-association.json and host it at:
Step 3: link your Partner Global Account (PGA) ID
- Find your PGA ID via Partner Center.
- In the Azure Portal, go to App registrations > Your app > Branding & properties, enter the PGA ID and save.
For full details, see the Microsoft Publisher Verification documentation.
9
Handle "Administrator approval required"
When end users see a consent block from their Microsoft 365 admin
If an end user sees "Administrator approval required" when connecting their Outlook mailbox, the required consent has not been granted at the tenant level. Two paths to resolve it:
Method 1: admin consent request inside Microsoft Entra
A Microsoft 365 administrator reviews and approves the pending admin consent request. See the Microsoft documentation on reviewing admin consent requests.
Method 2: OAuth login as admin with tenant-wide consent
- The admin starts the OAuth login flow from your app.
- During Microsoft authorization, the admin must tick "Consent on behalf of your organization".
- This grants consent for every user in the tenant and prevents the prompt for any future Outlook Email API connection.
Full details in the Microsoft consent troubleshooting guide.
Boost Productivity with Outlook Email API Features
Boost your users' productivity by leveraging Outlook Email API features, enabling seamless email management, automated workflows, and real-time synchronisation so they can focus on what truly matters.
POST /api/v1/emails { "account_id": "acc_outlook_...", "to": [{"identifier": "lead@acme.com"}], "subject": "Quick intro", "body": "Hi {{first_name}}..." }
// New email event delivered to your endpoint { "event": "mail.received", "account_id": "acc_outlook_...", "email_id": "em_8FdK2...", "from": "sarah@acme.com", "timestamp": "2026-05-18T09:42:11Z" }
Compare Outlook with Gmail and IMAP
| Feature |
|
|
|
|---|---|---|---|
| Account Connection | |||
| Hosted Auth | |||
| Custom Auth | |||
| OAuth | |||
| Credentials | |||
| Send / Receive | |||
| Send / Reply Email | |||
| List Emails | |||
| Create Email Draft | |||
| Organize | |||
| Delete Email | |||
| Move Email | |||
| List Folders | |||
| Get Folder | |||
| Webhooks | |||
| New Email | |||
| Open & click tracking | |||
Build your Outlook Email API integration today
Free trial included - no credit card required. Link your first Outlook account in under 5 minutes.
Outlook Email API Code Samples: Node.js, Python & cURL
The examples below call Unipile's unified Outlook Email API endpoint. One API key, one base URL - works for Outlook, Gmail, and IMAP without changing your code. Replace YOUR_DSN and YOUR_API_KEY with the values from your Unipile Dashboard.
// Read emails from a linked Outlook account via Unipile Outlook Email API
const axios = require('axios');
const DSN = 'api1.unipile.com:13211';
const API_KEY = 'YOUR_API_KEY';
const ACC_ID = 'OUTLOOK_ACCOUNT_ID'; // from POST /accounts after OAuth
async function listOutlookEmails() {
const res = await axios.get(
`https://\${DSN}/api/v1/emails`,
{
headers: {
'X-API-KEY': API_KEY,
'account_id': ACC_ID
}
}
);
console.log(res.data.items); // array of Outlook messages
}
// Send an email via Outlook Email API
async function sendOutlookEmail() {
await axios.post(
`https://\${DSN}/api/v1/emails`,
{
account_id: ACC_ID,
to: [{ display_name: 'Alice', identifier: 'alice@contoso.com' }],
subject: 'Hello from Outlook Email API',
body: 'Sent via Unipile Outlook Email API.
'
},
{ headers: { 'X-API-KEY': API_KEY } }
);
}# Read and send emails via Unipile Outlook Email API
import requests
DSN = "api1.unipile.com:13211"
API_KEY = "YOUR_API_KEY"
ACC_ID = "OUTLOOK_ACCOUNT_ID"
HEADERS = {
"X-API-KEY": API_KEY,
"account_id": ACC_ID,
}
# List Outlook emails
def list_emails():
r = requests.get(
f"https://{DSN}/api/v1/emails",
headers=HEADERS
)
r.raise_for_status()
return r.json()["items"]
# Send via Outlook Email API
def send_email(to_addr, subject, body):
r = requests.post(
f"https://{DSN}/api/v1/emails",
headers={"X-API-KEY": API_KEY},
json={
"account_id": ACC_ID,
"to": [{"identifier": to_addr}],
"subject": subject,
"body": body
}
)
r.raise_for_status()
return r.json()# List emails from linked Outlook account
curl -s -X GET \
"https://api1.unipile.com:13211/api/v1/emails" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "account_id: OUTLOOK_ACCOUNT_ID" \
| jq '.items[] | {id, subject, from, date}'
# Send email via Outlook Email API
curl -s -X POST \
"https://api1.unipile.com:13211/api/v1/emails" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "OUTLOOK_ACCOUNT_ID",
"to": [{"identifier": "alice@contoso.com"}],
"subject": "Hello from Outlook Email API",
"body": "Sent via Unipile.
"
}'Native Microsoft Graph vs Unified Outlook Email API (Unipile)
Discover the clear advantages of leveraging Unipile's streamlined Outlook Email API integration compared to building directly on Microsoft Graph. Use Hosted Auth to bolster security through enhanced credential management, ensure smooth integration with Outlook and other email platforms, and reduce the overhead of maintaining OAuth flows.
| Dimension | Native Microsoft Graph API | Unipile Outlook Email API |
|---|---|---|
| Integration scope | Outlook / Exchange Online only | Outlook + Gmail + IMAP, same code |
| OAuth flow setup | Azure App Registration + token management per tenant | One Hosted Auth link, white-label OAuth page, zero token code |
| Token refresh | Your code must refresh every 60 min (access token lifetime) | Unipile handles refresh automatically for all linked accounts |
| Webhook renewal | Subscriptions expire at 4,230 min, you must renew before expiry | Unipile renews Graph subscriptions automatically |
| Throttling handling | Must implement 429 retry logic and exponential backoff manually | Built-in retry and rate limit management |
| Time to first email | 2-5 days (Azure setup + OAuth + token logic + error handling) | Under 2 hours (follow this guide) |
| Exchange Online retirement | Must migrate from EWS to Graph before October 2026 deadline | Unipile already uses Graph, migration is transparent |
| Support | Microsoft documentation + forums | Live technical support + on-demand founder call |
One Link Hosted Auth vs Full OAuth Flow
Unipile's Hosted Auth automates detection of email providers and handles authentication. This significantly lowers the complexity of the initial setup, accelerating development timelines and reducing maintenance. OAuth Email API guide
Consistent Updates and Maintenance
Stay ahead with regular updates and diligent maintenance. The Unipile Outlook Email API is continuously enhanced to track Microsoft Graph changes and deliver peak performance, so your integration works even when Microsoft updates its API. MS Graph integration guide
Our support team guides you through each phase of the Outlook Email API integration, from initiation to post-implementation, at no extra cost. Email API for developers
Common Pitfalls When Building with the Outlook Email API
The Microsoft Outlook API is powerful but has several non-obvious constraints that can break your integration in production. Here are the 6 most common pitfalls - and how to avoid them.
Security & Compliance for Outlook Email API Integrations
Ensure the security of your data with advanced security protocols. The Unipile Outlook Email API guarantees that your emails and sensitive information remain protected - with SOC 2 Type II certification and full GDPR compliance.
Frequently Asked Questions
Answers to the most common questions about the Outlook Email API, Microsoft Outlook API, and Outlook 365 API integration with Unipile.
graph.microsoft.com/v1.0/me/messages, authenticated with an Azure AD OAuth 2.0 bearer token. Unipile wraps this into a simple, provider-agnostic interface that also works for Gmail and IMAP.Mail.ReadWrite, Mail.Send and Mail.Read delegated permissions, (3) implement the authorization code flow to get an access token. With Unipile, you skip all of this. Use Hosted Auth to generate a one-link OAuth page for your users. See the full OAuth Email API guide and the Microsoft Graph OAuth guide.You may also like
Retrieve Emails with Unipile API
Managing and retrieving emails programmatically is a critical skill. Whether for business automation, customer support, or marketing purposes, understanding how to use an Email API to retrieve emails can streamline operations and improve efficiency. This guide will walk you through the essentials...
How to Get Email API for Your Software
Explore the advantages of integrating an API, as it presents a gateway to unlocking numerous benefits in seamlessly incorporating multiple email services into your application.What is an Email API?An Email API (Application Programming Interface) is a service that allows developers to integrate...
Google OAuth Verification & Gmail API Credentials (2026)
Gmail API Unverified App Warning The "This app isn't verified" warning, the 100-user cap & exemptions Before your app passes Google OAuth app verification, every user who tries to authorize it sees a warning screen. Google also enforces a hard 100-user limit on unverified external apps. Here is...


