Skip to main content

Microsoft Graph

By integrating Microsoft Graph with ToolJet, you can interact with Microsoft 365 services such as Outlook Mail, Calendar, Users, Teams, OneDrive, SharePoint, and OneNote.

NOTE

Before following this guide, it is assumed that you have already completed the process of Using Marketplace plugins.

Connection​

To connect ToolJet with Microsoft Graph, you’ll need the following credentials:

  • Tenant
  • Access Token URL
  • OAuth type (ToolJet Cloud only)
  • Client ID
  • Client Secret

Follow this Microsoft guide to register an app and generate the required credentials.

Required API permissions

The data source requests the https://graph.microsoft.com/.default and offline_access scopes, so what a query can access is decided by the API permissions granted to your app registration in Azure, not by the ToolJet connection form. Add the Microsoft Graph delegated permissions for the entities you use, for example:

  • SharePoint: Sites.Read.All for read operations, and Sites.ReadWrite.All for operations that create, update, upload or delete.
  • OneNote: Notes.Read to read, Notes.Create to create notebooks, sections and pages, and Notes.ReadWrite to update page content or delete pages. Notes.Read.All and Notes.ReadWrite.All give access to all notebooks the signed-in user can access.
Microsoft Graph data source configuration

You can enable the Authentication required for all users toggle in the configuration panel. When enabled, each user will be redirected to the OAuth consent screen the first time a query from this data source is triggered in your application. This ensures that every user connects with their own Microsoft account securely.

note

After completing the OAuth flow, the query must be triggered again to fetch data from Microsoft Graph.

OAuth Type​

On ToolJet Cloud, the OAuth type dropdown sets which Microsoft app ToolJet uses for the OAuth flow:

OptionWhat it does
ToolJet appUses ToolJet's own Microsoft app. The Client ID and Client secret fields are hidden, so you don't need to register an app in Azure.
Custom appUses your own Azure app registration. Enter its Client ID and Client secret, and add the Redirect URI shown in the form to the app registration.

New data sources default to Custom app. On self-hosted ToolJet, the dropdown isn't shown and the data source always uses Custom app, so Client ID and Client secret are required.

Supported Entities​

Microsoft Graph Entity dropdown listing Outlook, Calendar, Users, Teams, One Drive, Share Point and One Note

Outlook​

Messages​

MethodEndpointDescription
GET/me/messagesList messages in the user's mailbox.
POST/me/messagesCreate a new draft message.
GET/me/messages/{message-id}Get a specific message by ID.
PATCH/me/messages/{message-id}Update a message.
DELETE/me/messages/{message-id}Delete a message.
POST/me/messages/{message-id}/forwardForward an existing message.
POST/me/messages/{message-id}/createForwardCreate a forward draft.
POST/me/messages/{message-id}/replyReply to a message.
POST/me/messages/{message-id}/createReplyCreate a reply draft.
POST/me/messages/{message-id}/replyAllReply all to a message.
POST/me/messages/{message-id}/createReplyAllCreate a reply-all draft.
POST/me/messages/{message-id}/sendSend a draft message.
POST/me/messages/{message-id}/moveMove a message.
POST/me/messages/{message-id}/copyCopy a message.
POST/me/sendMailSend mail without creating a draft.

Mail Folders​

MethodEndpointDescription
GET/me/mailFoldersList mail folders.
POST/me/mailFoldersCreate a mail folder.
GET/me/mailFolders/{mailFolder-id}Get specific mail folder.
PATCH/me/mailFolders/{mailFolder-id}Update a mail folder.
DELETE/me/mailFolders/{mailFolder-id}Delete a mail folder.
GET/me/mailFolders/{mailFolder-id}/messagesList messages inside a folder.
GET/me/mailFolders/Inbox/messages/deltaTrack changes to inbox messages.
GET/me/mailFolders/{mailFolder-id}/messages/deltaTrack changes to a folder's messages.
GET/me/mailFolders/deltaTrack changes to all folders.

Categories and Rooms​

MethodAPI EndpointDescription
GET/me/outlook/masterCategoriesList master categories
POST/me/outlook/masterCategoriesCreate a new category
GET/me/outlook/masterCategories/{outlookCategory-id}Get a specific category
PATCH/me/outlook/masterCategories/{outlookCategory-id}Update a category
DELETE/me/outlook/masterCategories/{outlookCategory-id}Delete a category
GET/me/findRoomsList available rooms
GET/me/findRooms(RoomList='{roomList-emailAddress}')Find rooms by room list
GET/me/findRoomListsList room lists

Calendar​

Default Calendar​

MethodAPI EndpointDescription
GET/me/calendarGet default calendar
PATCH/me/calendarUpdate default calendar
GET/me/calendar/eventsList events from default calendar
POST/me/calendar/eventsCreate an event in default calendar
GET/me/calendar/calendarPermissionsList calendar permissions
POST/me/calendar/calendarPermissionsGrant permissions to default calendar
GET/me/calendar/calendarPermissions/{permissionId}Get specific calendar permission
PATCH/me/calendar/calendarPermissions/{permissionId}Update calendar permission
DELETE/me/calendar/calendarPermissions/{permissionId}Delete calendar permission
POST/me/calendar/getScheduleGet free/busy schedule info

User Calendars and Groups​

MethodAPI EndpointDescription
GET/user/{userId}/calendarGet default calendar of a specific user
GET/me/calendarsList user calendars
POST/me/calendarsCreate a new calendar
GET/me/calendars/{calendarId}Get a specific calendar
PATCH/me/calendars/{calendarId}Update a calendar
DELETE/me/calendars/{calendarId}Delete a calendar
GET/me/calendars/{calendarId}/eventsList events in a specific calendar
POST/me/calendars/{calendarId}/eventsCreate event in a specific calendar
GET/me/calendarGroupsList calendar groups
POST/me/calendarGroupsCreate a calendar group
GET/me/calendarGroups/{groupId}/calendarsGet calendars in a group
POST/me/calendarGroups/{groupId}/calendarsAdd calendar to a group

Events​

MethodAPI EndpointDescription
GET/me/events/{eventId}Get an event by ID
PATCH/me/events/{eventId}Update an event
DELETE/me/events/{eventId}Delete an event
GET/me/events/{eventId}/instancesList instances of a recurring event
GET/me/events/{eventId}/attachmentsList attachments of an event
POST/me/events/{eventId}/attachmentsAdd attachments to an event
GET/me/calendarViewGet calendar view of events
POST/me/findMeetingTimesFind meeting times

Users​

User Management​

MethodAPI EndpointDescription
GET/usersList all users
POST/usersCreate a user
GET/users/{user-id}Get a specific user
PATCH/users/{user-id}Update a specific user
DELETE/users/{user-id}Delete a specific user

Profile​

MethodAPI EndpointDescription
GET/meGet profile of signed-in user
PATCH/meUpdate profile of signed-in user

Teams​

Teams and Chats​

MethodAPI EndpointDescription
GET/teamsList teams
POST/teamsCreate a team
GET/chatsList chats
POST/chatsCreate a chat
GET/me/joinedTeamsList teams the user has joined

Chat Operations​

MethodAPI EndpointDescription
GET/chats/{chat-id}Get a chat
PATCH/chats/{chat-id}Update a chat
DELETE/chats/{chat-id}Delete a chat
GET/chats/{chat-id}/membersList members in a chat
POST/chats/{chat-id}/membersAdd members to a chat
POST/chats/{chat-id}/members/addAdd members (alternate endpoint)
GET/chats/{chat-id}/members/{conversationMember-id}Get chat member details
PATCH/chats/{chat-id}/members/{conversationMember-id}Update chat member
DELETE/chats/{chat-id}/members/{conversationMember-id}Remove chat member
GET/chats/{chat-id}/messagesList messages in a chat
POST/chats/{chat-id}/messagesSend message in a chat
GET/chats/{chat-id}/messages/{chatMessage-id}Get a specific chat message
PATCH/chats/{chat-id}/messages/{chatMessage-id}Update a chat message
DELETE/chats/{chat-id}/messages/{chatMessage-id}Delete a chat message
GET/chats/getAllMessagesGet all messages across chats

Team Operation​

MethodAPI EndpointDescription
GET/teams/{team-id}Get a team
PATCH/teams/{team-id}Update a team
DELETE/teams/{team-id}Delete a team
POST/teams/{team-id}/archiveArchive a team
POST/teams/{team-id}/unarchiveUnarchive a team
GET/teams/{team-id}/membersList team members
POST/teams/{team-id}/membersAdd team members
POST/teams/{team-id}/members/addAdd members (alternate endpoint)

Channels and Messages​

MethodAPI EndpointDescription
GET/teams/{team-id}/allChannelsList all channels in a team
GET/teams/{team-id}/channelsList standard channels in a team
POST/teams/{team-id}/channelsCreate a channel in a team
GET/teams/{team-id}/channels/{channel-id}Get channel details
PATCH/teams/{team-id}/channels/{channel-id}Update a channel
DELETE/teams/{team-id}/channels/{channel-id}Delete a channel
GET/teams/{team-id}/channels/{channel-id}/membersList members in a channel
POST/teams/{team-id}/channels/{channel-id}/membersAdd members to a channel
GET/teams/{team-id}/channels/{channel-id}/messagesList messages in a channel
POST/teams/{team-id}/channels/{channel-id}/messagesSend message in a channel
GET/teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}Get a specific channel message
PATCH/teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}Update a channel message
DELETE/teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}Delete a channel message
GET/teams/{team-id}/allChannels/{channel-id}Get specific channel under all channels

OneDrive​

Root and Shared Content​

MethodAPI EndpointDescription
GET/me/driveGet the user's default drive
GET/me/drive/root/childrenList items in root folder
POST/me/drive/root/childrenCreate a new file or folder in root
GET/me/drive/recentList recent files
GET/me/drive/sharedWithMeList files shared with the user
GET/me/drive/root/search(q='{search-query}')Search files by query

Specific Drives and Items​

MethodAPI EndpointDescription
GET/drives/{drive-id}/root/childrenList items in a specific drive's root
GET/drives/{drive-id}/items/{item-id}/childrenList children of a folder
POST/drives/{drive-id}/items/{item-id}/childrenAdd item to folder
GET/drives/{drive-id}/items/{item-id}Get metadata for an item
PATCH/drives/{drive-id}/items/{item-id}Update metadata of an item
DELETE/drives/{drive-id}/items/{item-id}Delete an item
GET/drives/{drive-id}/items/{item-id}/contentDownload file content
PUT/drives/{drive-id}/items/{item-id}/contentUpload file content
POST/drives/{drive-id}/items/{item-id}/createLinkCreate sharing link
GET/drives/{drive-id}/items/{item-id}/permissionsGet item permissions

Download file content returns the file as base64 rather than as raw content:

{
"base64": "<base64-encoded file content>",
"mimeType": "<MIME type from the response, for example application/pdf>",
"size": <file size in bytes>
}

SharePoint​

Select Share Point in the Entity dropdown to work with SharePoint sites, lists, list items, document libraries (drives), files and folders through Microsoft Graph.

note

This entity is part of the Microsoft Graph plugin. ToolJet also has a separate SharePoint marketplace plugin with its own connection and operations.

Sites​

MethodAPI EndpointDescriptionParameters
GET/sitesList sitessearch, $filter, $select, $expand, $top, $skip
GET/sites/{site-id}Get sitesite-id (required), $select, $expand
GET/sites/{site-id}/analyticsGet site analyticssite-id (required)
GET/sites/{site-id}/pagesList site pagessite-id (required), $filter, $select, $orderby, $top, $skip

Lists and List Items​

MethodAPI EndpointDescriptionParameters
GET/sites/{site-id}/listsList listssite-id (required), $filter, $select, $expand, $top, $skip
POST/sites/{site-id}/listsCreate listsite-id (required). Body: displayName (required), description, list
GET/sites/{site-id}/lists/{list-id}Get listsite-id, list-id (required), $select, $expand
PATCH/sites/{site-id}/lists/{list-id}Update listsite-id, list-id (required). Body: displayName, description
DELETE/sites/{site-id}/lists/{list-id}Delete listsite-id, list-id (required)
GET/sites/{site-id}/lists/{list-id}/itemsList list itemssite-id, list-id (required), $filter, $select, $expand, $orderby, $top, $skip
POST/sites/{site-id}/lists/{list-id}/itemsCreate list itemsite-id, list-id (required). Body: fields (required)
GET/sites/{site-id}/lists/{list-id}/items/{item-id}Get list itemsite-id, list-id, item-id (required), $select, $expand
PATCH/sites/{site-id}/lists/{list-id}/items/{item-id}Update list itemsite-id, list-id, item-id (required). Body: fields (required)
DELETE/sites/{site-id}/lists/{list-id}/items/{item-id}Delete list itemsite-id, list-id, item-id (required)

Drives​

MethodAPI EndpointDescriptionParameters
GET/sites/root/driveGet root site drive$select
GET/sites/{site-id}/driveGet site drivesite-id (required), $select
GET/sites/{site-id}/drivesList site drivessite-id (required), $select, $top, $skip
GET/sites/{site-id}/drives/{drive-id}Get site drive by IDsite-id, drive-id (required), $select

Files and Folders​

MethodAPI EndpointDescriptionParameters
GET/drives/{drive-id}/items/{item-id}/childrenList folder contentsdrive-id, item-id (required), $select, $filter, $orderby, $top, $skip
GET/drives/{drive-id}/items/{item-id}Get file or folder metadatadrive-id, item-id (required), $select, $expand
DELETE/drives/{drive-id}/items/{item-id}Delete file or folderdrive-id, item-id (required)
PUT/drives/{drive-id}/items/{parent-item-id}:/{filename}:/contentUpload file to folderdrive-id, parent-item-id, filename (required). Body: fileContent (required), mimeType
GET/drives/{drive-id}/items/{item-id}/contentDownload filedrive-id, item-id (required)

Upload file to folder uploads a file into the folder parent-item-id with the name filename:

  • fileContent: The file content, base64-encoded. A data URL prefix such as data:application/pdf;base64, is removed automatically.
  • mimeType: The file's MIME type, for example application/pdf, image/png or text/plain. If left empty, application/octet-stream is used.

Download file returns the file as { "base64": "...", "mimeType": "...", "size": ... }, the same shape as the OneDrive download.

OneNote​

Select One Note in the Entity dropdown to work with the signed-in user's OneNote notebooks, section groups, sections, pages and page resources. All endpoints are under /me/onenote.

Notebooks and Section Groups​

MethodAPI EndpointDescriptionParameters
GET/me/onenote/notebooksList notebooksOData parameters
POST/me/onenote/notebooksCreate notebookBody: displayName (required)
GET/me/onenote/notebooks/{notebook-id}Get notebooknotebook-id (required), $select, $expand
GET/me/onenote/notebooks/{notebook-id}/sectionGroupsList notebook section groupsnotebook-id (required), OData parameters
GET/me/onenote/sectionGroupsList section groupsOData parameters

Sections​

MethodAPI EndpointDescriptionParameters
GET/me/onenote/notebooks/{notebook-id}/sectionsList notebook sectionsnotebook-id (required), OData parameters
POST/me/onenote/notebooks/{notebook-id}/sectionsCreate section in notebooknotebook-id (required). Body: displayName (required)
GET/me/onenote/sectionGroups/{sectionGroup-id}/sectionsList section group sectionssectionGroup-id (required), OData parameters
POST/me/onenote/sectionGroups/{sectionGroup-id}/sectionsCreate section in section groupsectionGroup-id (required). Body: displayName (required)
GET/me/onenote/sectionsList sectionsOData parameters
GET/me/onenote/sections/{section-id}Get sectionsection-id (required), $select, $expand

Pages and Resources​

MethodAPI EndpointDescriptionParameters
GET/me/onenote/sections/{section-id}/pagesList section pagessection-id (required), OData parameters, pagelevel
POST/me/onenote/sections/{section-id}/pagesCreate pagesection-id (required). Body: htmlContent (required)
GET/me/onenote/pagesList pagesOData parameters, pagelevel
GET/me/onenote/pages/{page-id}Get pagepage-id (required), $select, $expand
DELETE/me/onenote/pages/{page-id}Delete pagepage-id (required)
GET/me/onenote/pages/{page-id}/contentGet page contentpage-id (required), includeIDs, preAuthenticated
PATCH/me/onenote/pages/{page-id}/contentUpdate page contentpage-id (required). Body: commands (required)
GET/me/onenote/pages/{page-id}/parentNotebookGet page parent notebookpage-id (required), $select, $expand
GET/me/onenote/pages/{page-id}/parentSectionGet page parent sectionpage-id (required), $select, $expand
GET/me/onenote/resources/{resource-id}/contentGet resource contentresource-id (required)

OData parameters are $filter, $select, $expand, $orderby, $top, $skip, $count and $search.

A notebook displayName can't contain ? * \ / : < > | ' " # %, and a section displayName can't contain ? * \ / : < > | & # ' " % ~. Neither can start or end with a space.

Some OneNote operations don't use a plain JSON request or response:

  • Create page: Put the page's OneNote HTML in the htmlContent field. ToolJet sends it to Microsoft Graph as a text/html body. The HTML <title> becomes the page title. For example:

    <!DOCTYPE html><html><head><title>Sprint planning</title></head><body><p>Agenda</p><ul><li>Roadmap review</li></ul></body></html>
  • Get page content: Returns the page HTML as a string. Set includeIDs to true to get the data-id values you can use as targets in Update page content.

  • Update page content: Put a JSON array of patch commands in the commands field. Each command has target (required; a data-id, a generated ID, or body or title), action (required; append, insert, prepend, replace or delete), position (after or before) and content (OneNote HTML, not used by delete). If commands isn't an array, the query fails with OneNote page content updates expect "commands" to be a JSON array of patch commands. For example:

    [{ "target": "#para-id", "action": "insert", "position": "after", "content": "<p>Added by ToolJet</p>" }]
  • Get resource content: Downloads an image or file embedded in a page and returns it as { "base64": "...", "mimeType": "...", "size": ... }.

Example Queries​

Users​

Operation : GET/ me

This operation retrieves the profile details of the currently authenticated user.

Microsoft Graph example query

Operation : GET/ users

This operation retrieves a list of users from your Azure AD tenant.

Microsoft Graph example query