Microsoft Graph API

By Abhishek Kumar
5 min read
Connect to Microsoft 365, Windows 10, and more with the Microsoft Graph API. Access mail, calendars, documents, and devices, and automate tasks using this powerful, unified API. Explore robust integrations with RESTful APIs, OAuth 2.0, and Azure AD authentication

Table of Contents

Find out how you can use the Microsoft Graph API to connect to the data that drives productivity—mail, calendar, contacts, documents, directory, devices, and more.

API Overview

Microsoft Graph is a cloud-based platform that connects you to data and insights from Microsoft 365, Windows 10, and Enterprise Mobility + Security. It provides a unified endpoint to access data from multiple Microsoft services, including Exchange Online, SharePoint Online, OneDrive for Business, and Microsoft Teams. With Microsoft Graph, you can build applications that access user data, manage devices, and automate tasks across Microsoft services.

Microsoft Graph API overview: The Microsoft Graph API is a RESTful API that provides programmatic access to Microsoft Graph data. The API is documented using OpenAPI Specification (OAS), which provides a machine-readable description of the API's endpoints, parameters, and responses. The API supports a variety of authentication methods, including OAuth 2.0 and Azure Active Directory. Microsoft Graph also supports webhooks, which allow you to receive notifications when data changes. The API is subject to rate limits, which are designed to prevent excessive use of the service.

API Request Limits

Free

10,000 requests per day

Basic

100,000 requests per day

Standard

1,000,000 requests per day

Premium

2,000,000 requests per day

APIs

drive

Method: get

Description: Get all drive.

Endpoint: drives

Parameters: select

me

Method: get

Description: Get the signed-in user.

Endpoint: me

Parameters: select

drive

Method: post

Description: Create drive.

Endpoint: drives

Parameters: name

users

Method: get

Description: Get all users.

Endpoint: users

Parameters: select

me

Method: put

Description: Update the signed-in user.

Endpoint: me

Parameters: displayName

drive

Method: put

Description: Update drive.

Endpoint: drives/{id}

Parameters: id, name, description, additionalData

drive

Method: patch

Description: Update drive.

Endpoint: drives/{id}

Parameters: id, name, description, additionalData

drive

Method: delete

Description: Delete drive.

Endpoint: drives/{id}

Parameters: id

users

Method: post

Description: Create user.

Endpoint: users

Parameters: accountEnabled, displayName, mailNickname, passwordProfile, userPrincipalName

drive

Method: get

Description: Get drive by ID.

Endpoint: drives/{id}

Parameters: id, name, description, size

users

Method: get

Description: Get user by ID.

Endpoint: users/{id}

Parameters: id, displayName, mailNickname, userPrincipalName

drive

Method: get

Description: Get all root children of a drive.

Endpoint: drives/{id}/root/children

Parameters: id

me

Method: patch

Description: Update the signed-in user.

Endpoint: me

Parameters: displayName

users

Method: put

Description: Update user.

Endpoint: users/{id}

Parameters: id, displayName, mailNickname, userPrincipalName

users

Method: patch

Description: Update user.

Endpoint: users/{id}

Parameters: id, displayName, mailNickname, userPrincipalName

drive

Method: post

Description: Upload a file.

Endpoint: drives/{id}/root:/item/content

Parameters: id

drive

Method: delete

Description: Delete file.

Endpoint: drives/{drive-id}/items/{item-id}

Parameters: drive-id, item-id

users

Method: delete

Description: Delete user.

Endpoint: users/{id}

Parameters: id

drive

Method: get

Description: Get file by ID.

Endpoint: drives/{drive-id}/items/{item-id}

Parameters: drive-id, item-id

me

Method: get

Description: Get a list of all OneDrive files.

Endpoint: drive/root/children

Parameters: select

drive

Method: get

Description: Get all shared items of a drive.

Endpoint: sharedWithMe

Parameters: id, name, description, size

drive

Method: get

Description: Get all versions of a file.

Endpoint: drives/{drive-id}/items/{item-id}/versions

Parameters: drive-id, item-id

drive

Method: post

Description: Create folder.

Endpoint: drives/{id}/root/children

Parameters: id, name, file

users

Method: get

Description: Get a list of all users.

Endpoint: users?$top=1000

Parameters: select

calendars

Method: get

Description: Get all calendars.

Endpoint: me/calendars

Parameters: id, name, description

events

Method: get

Description: Get all events.

Endpoint: me/events

Parameters: id, subject, body, start, end

drive

Method: get

Description: List all drives.

Endpoint: drives

Parameters: id, name, description, size

sites

Method: get

Description: Get all sites.

Endpoint: sites

Parameters: id, name, description

teams

Method: get

Description: Get all teams.

Endpoint: me/teams

Parameters: id, displayName, description

drive

Method: post

Description: Create share link.

Endpoint: drives/{id}/root:/item/microsoft.graph.createLink

Parameters: id

groups

Method: get

Description: Get all groups.

Endpoint: groups

Parameters: id, displayName, description

drive

Method: get

Description: Get all shared items of a drive.

Endpoint: drives/{id}/sharedWithMe?$top=1000

Parameters: id, name, description, size

events

Method: post

Description: Create event.

Endpoint: me/events

Parameters: subject, body, start, end, attendees

mailFolders

Method: get

Description: Get all mail folders.

Endpoint: me/mailFolders

Parameters: id, displayName

drive

Method: get

Description: List all drives.

Endpoint: drives?$top=1000

Parameters: id, name, description, size

drive

Method: get

Description: Get all files and folders in a folder.

Endpoint: drives/{id}/children

Parameters: id

mailFolders

Method: post

Description: Create folder.

Endpoint: me/mailFolders

Parameters: displayName

FAQ

How do I authenticate to Microsoft Graph?

You can authenticate to Microsoft Graph using OAuth 2.0. The most common method is to use the Azure AD v2.0 endpoint, which allows you to authenticate users and applications. You can also use the Microsoft identity platform endpoint, which is designed for consumer applications.

What are the rate limits for Microsoft Graph?

The rate limits for Microsoft Graph are designed to ensure that the service is available to all users. The default rate limit is 100 requests per minute, but you can request a higher limit by contacting Microsoft support.

What is the sandbox account?

The sandbox account is a development environment that allows you to test your Microsoft Graph applications without affecting production data. The sandbox account is available to all Microsoft developers.

How do I get a developer account?

You can get a developer account by creating a Microsoft account and then registering your application with the Microsoft identity platform.

Last Update: September 09, 2024