Overview

Microsoft Graph functions as a programmatic gateway to data and intelligence within the Microsoft cloud ecosystem, encompassing Microsoft 365, Windows 365, and Azure Active Directory. Launched in 2015, it consolidates multiple APIs into a single endpoint, simplifying the development of applications that interact with a broad spectrum of Microsoft services. The API allows developers to build custom business applications, automate workflows within the Microsoft ecosystem, and access user and organizational data securely.

Developers use Microsoft Graph to perform operations such as managing user profiles, accessing Outlook mail and calendar events, interacting with OneDrive files, and retrieving data from Microsoft Teams. Its RESTful design supports standard HTTP methods (GET, POST, PATCH, DELETE) for resource manipulation. Authentication for Microsoft Graph relies on Azure Active Directory (Azure AD), requiring applications to obtain consent from users or administrators before accessing protected resources. This integration with Azure AD enables granular control over permissions and adherence to organizational security policies.

The API is designed for a wide range of use cases, from enhancing productivity tools to developing complex enterprise resource planning (ERP) integrations. For instance, an application might use Microsoft Graph to synchronize user data across systems, create automated workflows for document approvals in SharePoint, or build custom dashboards that display aggregated data from various Microsoft 365 services. The availability of SDKs across multiple programming languages, including .NET, Java, JavaScript, and Python, aims to streamline the development process for different environments, as detailed in the Microsoft Graph SDK overview. While the API provides extensive capabilities, initial setup involving Azure AD authentication and permission configuration can introduce a learning curve for new users.

Key features

  • Unified API Endpoint: Provides a single RESTful endpoint for accessing data across Microsoft 365, Windows 365, and Azure Active Directory, reducing integration complexity.
  • Data Access for Microsoft 365: Enables programmatic access to user mail, calendar, contacts, files (OneDrive, SharePoint), and Microsoft Teams data.
  • User and Group Management: Allows applications to read and manage user profiles, groups, and organizational relationships within Azure Active Directory.
  • Security and Compliance: Integrates with Microsoft's security features and supports compliance standards such as GDPR, HIPAA, SOC 2 Type II, and ISO 27001, enhancing data protection.
  • Extensibility: Supports custom data extensions for adding application-specific properties to resources like users or messages.
  • Webhooks and Change Notifications: Provides mechanisms for applications to subscribe to changes in Microsoft Graph resources, enabling real-time updates and reactive workflows.
  • SDKs and Tools: Offers software development kits (SDKs) for .NET, Java, JavaScript, Python, Go, PHP, PowerShell, and Ruby, alongside a Graph Explorer tool for testing API calls, as documented in the Graph Explorer documentation.

Pricing

Access to the Microsoft Graph API is generally included as part of standard Microsoft 365 subscriptions, without direct per-API-call charges. However, some advanced features or high-volume data usage scenarios may incur costs based on the underlying Microsoft cloud services being accessed (e.g., Azure Storage, Azure AD premium features). Specific pricing details for these scenarios are typically tied to the respective Microsoft cloud service pricing models.

Microsoft Graph API Access (As of May 2026)
Access Tier Description Associated Costs
Standard Access Included with most Microsoft 365 commercial subscriptions (e.g., Business Basic, Standard, Premium, E3, E5). No direct API charges; covered by Microsoft 365 subscription.
Advanced Features / High Volume Access to premium Azure AD features (e.g., conditional access, identity protection) or very high data throughput. Costs may apply based on Azure Active Directory pricing or other underlying Azure service usage.
Developer / Testing Free developer tenancy for testing and development purposes. No cost for development and testing within reasonable limits.

For detailed information on potential costs related to specific Microsoft cloud services integrated with Graph, refer to the Microsoft Graph pricing page and linked Azure service pricing.

Common integrations

  • Microsoft Teams: Automate team creation, manage channels, post messages, and access chat data, as outlined in the Microsoft Graph Teams API overview.
  • Outlook (Mail, Calendar, Contacts): Build custom email clients, schedule meetings, manage contact lists, and send automated notifications.
  • OneDrive and SharePoint: Integrate with file storage, manage documents, create folders, and handle file permissions programmatically.
  • Azure Active Directory: Manage users, groups, roles, and device registrations, and implement identity-driven security features.
  • Microsoft Intune: Access device management data for mobile and desktop devices, enabling custom IT administration tools.
  • Power BI: Pull data from various Microsoft 365 services into custom dashboards and reports for business intelligence.
  • Microsoft Viva: Extend Viva Connections, Insights, and Topics by integrating custom applications and data sources.

Alternatives

  • Google Workspace APIs: Offers a suite of APIs for integrating with Google's productivity tools like Gmail, Calendar, Drive, and Docs, serving as a direct competitor for many productivity integration use cases.
  • Slack API: Provides extensive capabilities for integrating with the Slack communication platform, including message posting, channel management, and user interaction.
  • Zoom API: Enables developers to integrate video conferencing features, manage meetings, users, and webinars within custom applications.

Getting started

To begin using Microsoft Graph with Python, you typically need to register an application in Azure Active Directory, obtain an access token, and then make HTTP requests to the Graph API. The following example demonstrates how to fetch the current user's profile using the requests library in Python, after acquiring an access token.

import requests
import json

# Replace with your actual access token obtained from Azure AD
# For production, use secure methods to acquire and manage tokens.
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN_HERE"

headers = {
    'Authorization': f'Bearer {ACCESS_TOKEN}',
    'Content-Type': 'application/json'
}

# Microsoft Graph API endpoint for the current user's profile
GRAPH_API_URL = "https://graph.microsoft.com/v1.0/me"

try:
    response = requests.get(GRAPH_API_URL, headers=headers)
    response.raise_for_status()  # Raise an HTTPError for bad responses (4xx or 5xx)

    user_profile = response.json()
    print("Successfully fetched user profile:")
    print(json.dumps(user_profile, indent=2))

except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err}")
    if response.status_code == 401:
        print("Unauthorized. Check your access token and permissions.")
    print(response.json())
except requests.exceptions.ConnectionError as conn_err:
    print(f"Connection error occurred: {conn_err}")
except requests.exceptions.Timeout as timeout_err:
    print(f"Timeout error occurred: {timeout_err}")
except requests.exceptions.RequestException as req_err:
    print(f"An unexpected error occurred: {req_err}")

Before running this code, you must register an application in the Azure portal, configure appropriate API permissions (e.g., User.Read for this example), and implement an OAuth 2.0 flow to acquire a valid ACCESS_TOKEN. More detailed setup instructions regarding Microsoft Graph authentication are available in the official documentation.