Table of contents
- General
- Power Automate samples
- Office 365 Users
- Find room resources in the tenant
- Count all users in tenant
- Order user response by displayName
- Filter for users with department XYZ
- Office 365 Groups
- Filter all groups by displayName
- Read all members of a group
- Read members of a group with expand on the manager property
- Read owners from a group
- Add owners to a group
- Count all members of a group
- Add users or groups to a group as members
- Update the privacy setting of the group
- Make a M365 group available to policies and rules in Purview or Defender
- Office 365 Outlook
- Check users availability
- Create event
- Update event
- Get event
- Get mails from a shared mailbox or as a delegate
- Reading the mail headers
- Reading attachments from an email
- Reading the contentBytes of attachments
- Reading attachments of an EML attachment
- Microsoft Teams
- Send a plain message in a chat
- Send an adaptive card in a chat
- Get chats with filters and members
- SharePoint Online
- Power Apps samples
- Read all members of a group
- Changelog
General
All actions that are send with these built-in actions are automatically delegated. This means, that the flow acts in your context and checks if you have permissions to read or write the data you requested. Consider the HTTP request actions as additional options, as you can do most things with the built in actions.
Here is an overview of the endpoints you can use:
Category | Endpoint Url | Links |
Users | https://graph.microsoft.com/v1.0/users
https://graph.microsoft.com/v1.0/me
2nd segment: messages, mailFolders, events, calendar, calendars, outlook, inferenceClassification | |
Groups | https://graph.microsoft.com/v1.0/groups | |
Teams | https://graph.microsoft.com/v.1.0/teams
https://graph.microsoft.com/v.1.0/me/chats
https://graph.microsoft.com/v.1.0/users
2nd segment: channels, chats, installedApps, messages, pinnedMessages | |
Outlook | https://graph.microsoft.com/v.1.0/me
https://graph.microsoft.com/v.1.0/users
2nd segment: messages,mailFolders,events,calendar,calendars,outlook,inferenceClassification |
Currently, not all oData query parameters are supported. If you need the full range of parameters, you have to use the HTTP premium connector and the Graph API.
Respect the limits for the Graph API and the respective service connector, for example Teams: https://learn.microsoft.com/en-us/graph/throttling-limits#microsoft-teams-service-limits or here https://learn.microsoft.com/en-us/connectors/teams
By default, all requests have a response limit of 100 items. If you want more, you can use top=999 to get up to 999 items. This is the max amount. Otherwise, you will have to process the odatanextlink to get more than 999 items.
Power Automate samples
For all requests where you use $orderby, $filter or $count, you have to to use a custom header (paste as is into the parameter)
ConsistencyLevel: eventualOffice 365 Users
Official source: https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http
Advanced filter query capabilities: https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http
Find room resources in the tenant
This is a beta endpoint. https://learn.microsoft.com/en-us/graph/api/user-findrooms?view=graph-rest-beta&tabs=http
Method: GET
Content-Type: application/json
Uri: https://graph.microsoft.com/beta/me/findRoomsCount all users in tenant
Method: GET
Content-Type: application/json
Custom Header 1: ConsistencyLevel: eventual
Uri: https://graph.microsoft.com/v1.0/users/$countOrder user response by displayName
Method: GET
Content-Type: application/json
Custom Header 1: ConsistencyLevel: eventual
Uri:https://graph.microsoft.com/v1.0/users?$orderby=displayNameFilter for users with department XYZ
Also works for jobTitle
Does not work for location or company.
Method: GET
Content-Type: application/json
Custom Header 1: ConsistencyLevel: eventual
Uri: https://graph.microsoft.com/v1.0/users?$select=displayName,companyName,department,mail,id,jobTitle&$filter=Department eq 'IT'Office 365 Groups
Filter all groups by displayName
Method: GET
Content-Type: application/json
Custom Header 1: ConsistencyLevel: eventual
Uri: https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'SearchString'Read all members of a group
Method: GET
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/Group-Id/members?$select=displayName,companyName,department,mail,id
//more than 100 members, max. 999
https://graph.microsoft.com/v1.0/groups/Group-Id/members?$select=displayName,companyName,department,mail,id
https://graph.microsoft.com/v1.0/groups/Group-Id/members?$select=displayName,companyName,department,mail,id&$top=999If the group has more than 999 members, you have to work with a do until loop and the odata.nextLink property in the response of the http request to gather all members of the group.
Read members of a group with expand on the manager property
Method: GET
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/GROUP-ID/members/microsoft.graph.user?$expand=manager($select=employeeId)&$select=displayName,mail,accountEnabled,department,surname,givenName,employeeId,companyName,onPremisesSamAccountName,jobTitle,managerRead owners from a group
Method: GET
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/{GROUP-ID}/ownersAdd owners to a group
Method: POST
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/8591e0ad-f4c6-45a7-9170-94503d34760a/owners/$ref
Body:
{
"@odata.id": "https://graph.microsoft.com/v1.0/users/ENTRA-USER-ID"
}Count all members of a group
Method: GET
Content-Type: application/json
Custom Header 1: ConsistencyLevel: eventual
Uri: https://graph.microsoft.com/v1.0/groups/group-id/members/$countAdd users or groups to a group as members
Official: https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http
Method: POST
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/GROUP-ID/members/$ref
Body (user):
{
"@odata.id": "https://graph.microsoft.com/v1.0/users/ENTRA-USER-ID"
}
Body (group):
{
"@odata.id": "https://graph.microsoft.com/v1.0/groups/GROUP-ID"
}Update the privacy setting of the group
Method: PATCH
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/GROUP-ID
Body {
"visibility": "Private"
}Make a M365 group available to policies and rules in Purview or Defender
Usually, M365 groups cannot be used to publish policies in Purview, Defender or Intune. By setting the securityEnabled flag, these groups will become available.
Method: PATCH
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/groups/GROUP-ID
Body {
"securityEnabled": true
}Office 365 Outlook
Check users availability
Create event
Update event
Link: https://learn.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0&tabs=http
Method: POST
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/me/events/eventId
Body:
{
"subject":"New subject",
"hideAttendees": true
}Get event
Just a note: If you plan on tracking responses for your events and if possible create the events in your default calendar. If you create events in a secondary calendar in your mailbox, the event responses are not tracked and the API will always return the status of βnoneβ instead of accepted or declined. You will however receive an email for the event responses. So you will have to work of those.
Method: GET
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/me/events/{event-Id}Get mails from a shared mailbox or as a delegate
GET
https://graph.microsoft.com/v1.0/users/SHARED-MAILBOX-ADDRESS/messages/MESSAGE-ID?Reading the mail headers
GET
https://graph.microsoft.com/v1.0/me/messages/MESSAGE-ID?$select=internetMessageHeadersReading attachments from an email
The Get mail or Get attachment actions for Office 365 Outlook will only return attachments of type βfileβ. This means βitemβ attachments, like emails (as eml or msg) or events are not returned. With the http request below all attachments type are returned.
GET
https://graph.microsoft.com/v1.0/users/USER-EMAIL/messages/MAIL-ID/attachmentsReading the contentBytes of attachments
- For files: use the contentBytes property
- For items use the request below. It will return the raw content of that item. It can be directly used (without any modifications necessary) to create a .eml file in SharePoint using the create file action.
GET
https://graph.microsoft.com/v1.0/users/USER-EMAIL/messages/MAIL-ID/attachments/Attachment-ID/$value
//Use this to create a file
body('Send a HTTP ... action name')Reading attachments of an EML attachment
GET
https://graph.microsoft.com/v1.0/users/USER-EMAIL/messages/MAIL-ID/attachments?$expand=microsoft.graph.itemattachment/itemMicrosoft Teams
Send a plain message in a chat
If you need to send a large number of messages in a short time, you should use this HTTP request as it has a throughput of 200 messages per second instead of 25 per 300 seconds with the built-in action (At least how I understand the documentation, though I have tested this with 500 messages).
You can use the create chat built-in action to create a new chat, which will give you the conversation-id.
Method: POST
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/me/chats/CONVERSATION-ID/messages
Body:
{
"body": {
"content": "Hello world"
}
}
Send an adaptive card in a chat
Adaptive cards can also be send via the graph API. If you have no images in your adaptive card, you can use the code below. If you do have images, you will have to place them as base64 into the hosted contents. You can use a compose action with the expression guid() to get a random GUID string. The number needs to be the same in the body/content and attachments/id.
I recommend using one compose action to set the adaptive card, then another compose action to escape the adaptive card JSON.
Get chats with filters and members
https://learn.microsoft.com/en-us/graph/api/chat-list?view=graph-rest-1.0&tabs=http
Method: GET
Content-Type: application/json
Uri: https://graph.microsoft.com/v1.0/me/chats
With Filter
https://graph.microsoft.com/v1.0/me/chats?$filter=chatType eq 'Group'
With members: https://graph.microsoft.com/v1.0/me/chats?$expand=members
With filter and members: https://graph.microsoft.com/v1.0/me/chats?$expand=members&$filter=chatType eq 'Group'SharePoint Online
I have a lot of other blogs where I write about these features. For example:
Power Apps samples
You can obviously use built-in connectors for the respective connectors, the HTTP requests allow you to change specific things like selecting columns for the response.
Read all members of a group
Power Apps currently does not really understand the response of HTTP requests. Therefore, you have to basically parse the answer. You first have to set the result to variable and from there collect it into a collection.
You can only read a maximum of 999 members per group.
Changelog
Date | Changes |
20.07.2025 | Added Find room resources in the tenant |
19.12.2025 | Added info about access to shared mailboxes
Added select for internet message headers |
07.04.2026 | Added reading and setting group owners |
08.04.2026 | Add users or groups to a group as members |
10.04.2026 | Update event outlook updated, corrected get event from mailbox |
22.04.2026 | Added Graph API request for listing chats with filters and members |
12.05.2026 | Added Reading attachments from an email
Added source and links for Office 365 Users |
13.05 | Added privacy and securityEnabled flags to update for Office 365 Groups Connector |
Thanks for reading! π