ChatMessage.Read.All
Allows the app to read all one-to-one and group chats messages in Microsoft Teams, without a signed-in user.
Permission Details
Read all chat messages
Allows the app to read all one-to-one and group chats messages in Microsoft Teams, without a signed-in user.
b9bb2381-47a4-46cd-aafb-00cb12f68504
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
attachments |
chatMessageAttachment collection |
References to attached objects like files, tabs, meetings etc. |
body |
itemBody |
Plaintext/HTML representation of the content of the chat message. Representation is specified by the contentType inside the body. The content is always in HTML if the chat message contains a chatMessageMention. |
chatId |
stringNullable |
If the message was sent in a chat, represents the identity of the chat. |
channelIdentity |
channelIdentity |
If the message was sent in a channel, represents identity of the channel. |
createdDateTime |
dateTimeOffsetNullable |
Timestamp of when the chat message was created. |
deletedDateTime |
dateTimeOffsetNullable |
Read only. Timestamp at which the chat message was deleted, or null if not deleted. |
etag |
stringNullable |
Read-only. Version number of the chat message. |
eventDetail |
eventMessageDetail |
Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, adding new members. For event messages, the messageType property will be set to systemEventMessage. |
from |
chatMessageFromIdentitySet |
Details of the sender of the chat message. Can only be set during migration. |
id |
String |
Read-only. Unique ID of the message. IDs are unique within a chat/channel/reply-to-message, but might be duplicated in other chats/channels/reply-to-messages. |
importance |
string |
The importance of the chat message. The possible values are: normal, high, urgent. |
lastModifiedDateTime |
dateTimeOffsetNullable |
Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed. |
lastEditedDateTime |
dateTimeOffsetNullable |
Read only. Timestamp when edits to the chat message were made. Triggers an "Edited" flag in the Teams UI. If no edits are made the value is null. |
locale |
string |
Locale of the chat message set by the client. Always set to en-us. |
mentions |
chatMessageMention collection |
List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag. |
Showing 15 of 25 properties.
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"attachments": [
{
"@odata.type": "microsoft.graph.chatMessageAttachment"
}
],
"body": {
"@odata.type": "microsoft.graph.itemBody"
},
"channelIdentity": {
"@odata.type": "microsoft.graph.channelIdentity"
},
"chatId": "String",
"createdDateTime": "String (timestamp)",
"deletedDateTime": "String (timestamp)",
"etag": "String",
"eventDetail": {
"@odata.type": "microsoft.graph.eventMessageDetail"
},
"from": {
"@odata.type": "microsoft.graph.chatMessageFromIdentitySet"
},
"id": "String (identifier)",
"importance": "String",
"lastEditedDateTime": "String (timestamp)",
"lastModifiedDateTime": "String (timestamp)",
"locale": "String",
"mentions": [
{
"@odata.type": "microsoft.graph.chatMessageMention"
}
],
"messageHistory": [
{
"@odata.type": "microsoft.graph.chatMessageHistoryItem"
}
],
"messageType": "String",
"policyViolation": {
"@odata.type": "microsoft.graph.chatMessagePolicyViolation"
},
"reactions": [
{
"@odata.type": "microsoft.graph.chatMessageReaction"
}
],
"replyToId": "String (identifier)",
"subject": "String",
"summary": "String",
"webUrl": "String"
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
hostedContents |
chatMessageHostedContent collection |
Content in a message hosted by Microsoft Teams - for example, images or code snippets. |
replies |
chatMessage collection |
Replies for a specified message. Supports $expand for channel messages. |
attachments |
chatMessageAttachment collection |
References to attached objects like files, tabs, meetings etc. |
body |
itemBody |
Related body data exposed by this resource. |
importance |
chatMessageImportance |
Related importance data exposed by this resource. |
mentions |
chatMessageMention collection |
List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag. |
messageHistory |
chatMessageHistoryItem collection |
List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message. |
messageType |
chatMessageType |
Related messageType data exposed by this resource. |
reactions |
chatMessageReaction collection |
Reactions for this chat message (for example, Like). |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
| Methods |
|---|
GET
/chats/{chat-id}/pinnedMessages
|
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
| Methods |
|---|
GET
/chats/{chat-id}/pinnedMessages
|
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].PinnedMessages.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let pinnedMessages = await client.api('/chats/19:[email protected]/pinnedMessages')
.get();
Import-Module Microsoft.Graph.Teams
Get-MgChatPinnedMessage -ChatId $chatId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.chats.by_chat_id('chat-id').pinned_messages.get()
App Registration
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions and search for ChatMessage.Read.All
Grant Admin Consent
Application permissions always require admin consent.