# Microsoft

Connect 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.

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](/platforms/microsoft/admin-consent). An [organization connection](/platforms/microsoft/organization) lets an administrator grant every mailbox at once |
| Email | 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](/platforms/microsoft/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](/platforms/microsoft/connect).

To ask for the address first and route any mailbox, use the hosted [email connect link](/platforms/imap/connect) 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](/platforms/microsoft/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

<PlatformPages platform="microsoft" />

## Related

- [Start OAuth](/connect/get-connect-url)
- [Admin-consent link](/connect/start-microsoft-admin-consent)
- [List email threads](/email/list-email-threads)
- [List calendar events](/calendar/list-calendar-events)
- [Inbox webhooks](/webhooks/inbox)