| name | microsoft-365 |
| description | Microsoft Graph API for Microsoft 365, including OneDrive, SharePoint, Teams channels, and Teams chats. Use when user mentions "Microsoft 365", "OneDrive", "SharePoint", "Teams", or "Microsoft Graph". |
Troubleshooting
If requests fail, run zero doctor check-connector --env-name MICROSOFT_365_TOKEN or zero doctor check-connector --url https://graph.microsoft.com/v1.0/me --method GET
How to Use
Base URL: https://graph.microsoft.com
All calls use Authorization: Bearer $MICROSOFT_365_TOKEN. MICROSOFT_GRAPH_TOKEN is also bound to the same OAuth access token for compatibility.
Because Microsoft Graph is shared by multiple Zero connectors, include X-VM0-Connector-Intent: microsoft-365 on Graph API calls. This is a VM0 proxy routing hint only; it is not authentication or permission.
User
Get Current User
curl -s "https://graph.microsoft.com/v1.0/me" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '{id, displayName, userPrincipalName, mail}'
OneDrive
List Root Drive Items
curl -s "https://graph.microsoft.com/v1.0/me/drive/root/children" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, name, folder, file, size, webUrl}'
Get Item Metadata
curl -s "https://graph.microsoft.com/v1.0/me/drive/items/<item-id>" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '{id, name, size, file, folder, webUrl}'
Download File
curl -L "https://graph.microsoft.com/v1.0/me/drive/items/<item-id>/content" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" \
-o /tmp/onedrive-download.bin
Upload Small File
This works for files up to 250 MB.
curl -s -X PUT "https://graph.microsoft.com/v1.0/me/drive/root:/Uploads/report.txt:/content" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" \
--header "Content-Type: text/plain" \
--data-binary @/tmp/report.txt | jq '{id, name, size, webUrl}'
Create Folder
curl -s -X POST "https://graph.microsoft.com/v1.0/me/drive/root/children" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" \
--header "Content-Type: application/json" \
-d '{"name":"Project Files","folder":{},"@microsoft.graph.conflictBehavior":"rename"}' | jq '{id, name, webUrl}'
Search Files
curl -s "https://graph.microsoft.com/v1.0/me/drive/root/search(q='report')" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, name, webUrl}'
SharePoint
List Sites
curl -s "https://graph.microsoft.com/v1.0/sites?search=*" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, name, displayName, webUrl}'
Get Site by Hostname and Path
curl -s "https://graph.microsoft.com/v1.0/sites/<tenant>.sharepoint.com:/sites/<site-name>" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '{id, name, displayName, webUrl}'
List Site Drives
curl -s "https://graph.microsoft.com/v1.0/sites/<site-id>/drives" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, name, driveType, webUrl}'
List SharePoint Drive Items
curl -s "https://graph.microsoft.com/v1.0/drives/<drive-id>/root/children" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, name, folder, file, webUrl}'
List Site Lists
curl -s "https://graph.microsoft.com/v1.0/sites/<site-id>/lists" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, name, displayName, webUrl}'
Teams
List Joined Teams
curl -s "https://graph.microsoft.com/v1.0/me/joinedTeams" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, displayName, description}'
List Team Channels
curl -s "https://graph.microsoft.com/v1.0/teams/<team-id>/channels" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, displayName, description, membershipType}'
List Channel Messages
curl -s "https://graph.microsoft.com/v1.0/teams/<team-id>/channels/<channel-id>/messages" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, from, createdDateTime, body}'
Send Channel Message
Write to /tmp/teams_message.json:
{
"body": {
"content": "Hello from Zero"
}
}
curl -s -X POST "https://graph.microsoft.com/v1.0/teams/<team-id>/channels/<channel-id>/messages" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" \
--header "Content-Type: application/json" \
-d @/tmp/teams_message.json | jq '{id, createdDateTime, webUrl}'
List Chats
curl -s "https://graph.microsoft.com/v1.0/chats" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" | jq '.value[] | {id, topic, chatType}'
Send Chat Message
curl -s -X POST "https://graph.microsoft.com/v1.0/chats/<chat-id>/messages" \
--header "Authorization: Bearer $MICROSOFT_365_TOKEN" \
--header "X-VM0-Connector-Intent: microsoft-365" \
--header "Content-Type: application/json" \
-d '{"body":{"content":"Hello from Zero"}}' | jq '{id, createdDateTime}'