Microsoft
Email & CalendarConnect a Microsoft 365 or Outlook.com account and read and send Outlook mail, manage Outlook Calendar events, work with OneDrive files and sync Outlook contacts.
Authentication details
Connecting accounts guideOAuth 2.0 (Microsoft)
Connect endpoints
GET /v1/connect/microsoft/admin-consentAdmin-consent link for a Microsoft tenantPOST /v1/connect/microsoft/orgStart a Microsoft 365 organization connection
Connect a person's Microsoft account once and use their Outlook mail, Outlook Calendar, OneDrive and Outlook contacts with your Zernio API key, through Microsoft Graph.
Quick reference
A connected account uses platform: "microsoft" and represents one mailbox. You choose which of the four areas it grants when you connect it.
| Property | Value |
|---|---|
| Platform value | microsoft |
| Areas | email (Outlook mail), calendar (Outlook Calendar), files (OneDrive), contacts (Outlook contacts) |
| Account types | Work or school accounts (Microsoft 365) and personal accounts (Outlook.com, Hotmail) |
| Auth | OAuth 2.0 with Microsoft sign-in, scopes required |
| Organizations | Some tenants need an administrator to approve Zernio once. See Admin consent. An organization connection lets an administrator grant every mailbox at once |
| List, search, read, send, reply, forward, move, trash, categories, drafts, scheduled send, tracking, send-as and signatures. 1,000 sends a day, doubling after 14 clean days | |
| Calendar | Events with Teams meetings, RSVP, free-busy and availability |
| Files | Every OneDrive file the user can reach |
| Contacts | Synced into /v1/contacts, read-only |
| Inbox | Inbound and sent mail appears as conversations, with message.received |
| Webhooks | message.received, email.*, calendar.event.*, file.*, contact.*, account.rate_limited |
| Social posting | No |
| List the accounts | GET /v1/accounts?platform=microsoft |
Before you start
- The person connecting needs a Microsoft 365 work or school account, or a personal Outlook.com account.
- Mailboxes on on-premises Exchange servers are not supported.
- Many organizations only let an administrator approve apps that read mail. Plan for admin consent when you sell to companies.
Connect
Call GET /v1/connect/microsoft with profileId and the areas you need in scopes, such as scopes=email,calendar, and send the user to the returned authUrl. See Connect.
To ask for the address first and route any mailbox, use the hosted email connect link from GET /v1/connect/email. Gmail and Microsoft addresses go to their sign-in, every other mailbox connects over IMAP.
Common errors
| Error | Cause | Fix |
|---|---|---|
400 invalid_field_value on connect | scopes is missing | Pass a subset of email, calendar, files, contacts. |
412 admin_consent_required | The organization requires an administrator to approve Zernio | Send an administrator the admin consent link. |
412 mailbox_not_available | The Microsoft 365 user has no Exchange Online mailbox (no Exchange license, inactive, soft-deleted or on-premises). Every mail and calendar request answers it, and GET /v1/accounts/{accountId}/health reports mailbox.reason: no_mailbox | Assign an Exchange license to the user, or connect a user that has a mailbox. Files are not affected. |
412 account_scope_missing | The account was connected without the area this call needs | Connect again with that area added to scopes. |
In this section
Connect
Connect a Microsoft 365 or Outlook.com account to a profile for any mix of Outlook mail, Outlook Calendar, OneDrive and Outlook contacts, and widen it later.
Admin consent
Get a Microsoft 365 administrator to approve Zernio once for the whole organization, so its users can connect their mailboxes.
Organization connection
Let a Microsoft 365 administrator grant Zernio access to the organization's mailboxes once, then add mailboxes through the API without each user signing in.
Read and search Outlook mail, send, reply and forward, schedule and track sends, work with drafts, categories, send-as addresses and signatures, and catch bounces.
Calendar
List Outlook calendars and events, create and update events with Microsoft Teams meetings, RSVP to invitations, and find free time across mailboxes.
Files
List, search, upload, download, share and organise OneDrive files, or use a OneDrive file as post media.
Contacts
Sync a Microsoft account's Outlook contacts into your Zernio contacts, merged by email address with the people you already know from other channels.
Webhooks
The webhook events a Microsoft account sends for new mail, calendar changes, OneDrive changes and contact syncs, and how Zernio keeps Graph subscriptions alive.
Limits & errors
Send caps, size limits and rate limits on Microsoft accounts, what the connection cannot do, and the errors every Outlook, Calendar and OneDrive call can return.
Related
Microsoft
58- GET
- GET
- PATCH
- GET
- POST
- GET
- GET
- DELETE
- GET
- PATCH
- DELETE
- POST
Contacts
9· Unified API, shared with other platforms- GET
- POST
- GET
- GET
- GET
- PATCH
- DELETE
- GET
- POST
Calendar
3· Unified API, shared with other platformsFiles
4· Unified API, shared with other platformsContacts
2· Unified API, shared with other platformsLimits & errors
Send caps, size limits and rate limits on Google accounts, what the connection cannot do, and the errors every Gmail, Calendar and Drive call can return.
Connect
Connect a Microsoft 365 or Outlook.com account to a profile for any mix of Outlook mail, Outlook Calendar, OneDrive and Outlook contacts, and widen it later.