Sapilon becomes publicly available on 1 December 2026: 42 days to go. The core goes open source the same day →

Outlook Mail integration

In short

Read, search, reply to and send email from a Microsoft 365 mailbox. Connect it on the Integrations page; your app then calls Outlook Mail through Sapilon without ever holding a Microsoft credential.

Lets your app read and search the connected Microsoft 365 or Outlook.com mailbox, reply to messages, save drafts and send email as that account.

Connecting

On the Integrations page choose Connect on Outlook Mail, sign in to Microsoft and allow access. Under Advanced you can use your own Microsoft OAuth app instead of Sapilon’s.

  • Your app can read every message in this mailbox. Connect a shared or service mailbox for anything long-lived.
  • Many Microsoft 365 organisations only let an admin approve new apps: if you see “Need admin approval”, ask your Microsoft 365 admin to consent once for the whole organisation.
  • Sapilon’s Microsoft app is being registered. Until it is, Advanced → Bring your own OAuth app (an Entra app registration) connects today.

What your app can do

Only these requests are available; anything else is refused.

  • GET|POST /me/messages
  • GET|PATCH /me/messages/*
  • POST /me/messages/*/reply
  • POST /me/messages/*/send
  • POST /me/sendMail
  • GET /me/mailFolders
  • GET /me/mailFolders/*/messages

How the agent uses it

Use integrations.request('outlook-mail', …); paths are relative to https://graph.microsoft.com/v1.0.

  • GET /me/messages — newest first. Example: { method: 'GET', path: '/me/messages', query: { $search: '"invoice"', $top: '10', $select: 'subject,from,receivedDateTime,bodyPreview' } }.
  • POST /me/messages — a draft; POST /me/messages/{id}/send sends it.
  • GET|PATCH /me/messages/{id} — read, or mark read with body: { isRead: true }.
  • POST /me/messages/{id}/reply — body: { comment: 'Thanks, received.' }.
  • POST /me/sendMail — Example: { method: 'POST', path: '/me/sendMail', body: { message: { subject: 'Hi', body: { contentType: 'Text', content: 'Hello' }, toRecipients: [{ emailAddress: { address: 'sara@acme.com' } }] } } }. Answers 202 with no body.
  • GET /me/mailFolders, GET /me/mailFolders/{id}/messages (well-known ids: inbox, sentitems).

Deleting is not allowed.

More from Microsoft: https://learn.microsoft.com/graph/api/resources/mail-api-overview

Last updated .

Was this page helpful?