Microsoft 365
Connect your Microsoft account to let agents access Outlook Mail, Outlook Calendar, Outlook Contacts, OneDrive, and Microsoft Teams.
Prerequisites
- A Microsoft 365 account (work, school, or personal)
- OAuth credentials configured in your AgentHiFive instance (see below)
OAuth Setup (Admin)
If you're self-hosting, you need to register an Azure AD application:
- Go to Azure Portal > App registrations > New registration
- Name:
AgentHiFive - Supported account types: choose based on your needs (single tenant, multi-tenant, or personal accounts)
- Redirect URI:
https://your-domain.com/v1/connections/callback(type: Web) - Go to Certificates & secrets > New client secret and copy the value
- Go to API permissions and add the Microsoft Graph permissions you need
- Copy credentials to your
.env:
MICROSOFT_CLIENT_ID=your-application-id
MICROSOFT_CLIENT_SECRET=your-client-secret
MICROSOFT_TENANT_ID=your-tenant-id
Connecting
- Go to Connections in the dashboard
- Select the Data & Productivity or Communication tab
- Click the Microsoft service you want (Outlook Mail, Calendar, or Teams)
- You'll be redirected to Microsoft's login page
- Sign in and consent to the requested permissions
- You'll be redirected back with the connection active
Multiple Connections
Microsoft services support multiple connections per workspace. Each connection has its own credentials and policies.
Available Services
| Service ID | Graph API Permissions | Capabilities |
|---|---|---|
microsoft-teams | Chat.Read, Chat.ReadWrite, ChatMessage.Send | Read/send chat messages, manage channels |
microsoft-outlook-mail | Mail.Read, Mail.Send | Read and send emails |
microsoft-outlook-calendar | Calendars.Read, Calendars.ReadWrite | Read and create events |
microsoft-outlook-contacts | Contacts.Read, Contacts.ReadWrite | Read and manage contacts |
microsoft-onedrive | Files.Read, Files.ReadWrite | Read, upload, and manage files |
Vault API Usage
Microsoft uses the Graph API. All endpoints use https://graph.microsoft.com/v1.0 as the base URL.
Teams
vault_execute({
service: "microsoft-teams",
connectionId: "your-connection-id", // required -- Microsoft supports multiple connections
method: "GET",
url: "https://graph.microsoft.com/v1.0/me/chats",
query: { "$top": "10" }
})
Outlook Contacts
vault_execute({
service: "microsoft-outlook-contacts",
connectionId: "your-connection-id",
method: "GET",
url: "https://graph.microsoft.com/v1.0/me/contacts",
query: { "$top": "25", "$select": "displayName,emailAddresses,businessPhones" }
})
OneDrive
vault_execute({
service: "microsoft-onedrive",
connectionId: "your-connection-id",
method: "GET",
url: "https://graph.microsoft.com/v1.0/me/drive/root/children",
query: { "$select": "name,size,lastModifiedDateTime", "$top": "25" }
})
OData Query Syntax
Microsoft Graph uses OData query parameters with $ prefix: $top, $select, $orderby, $filter. Pass these in the query parameter.