Chat.ReadWrite.All
Allows an app to read and write all chat messages in Microsoft Teams, without a signed-in user.
Permission Details
Read and write all chat messages
Allows an app to read and write all chat messages in Microsoft Teams, without a signed-in user.
294ce7c9-31ba-490a-ad7d-97a7d075e4ed
Read and write all chat messages
Allows an app to read and write all one-to-one and group chats in Microsoft Teams, without a signed-in user. Does not allow sending messages.
7e9a077b-3711-42b9-b7cb-5fa5f3f7fea7
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
chatType |
chatType |
Specifies the type of chat. The possible values are: group, oneOnOne, meeting, unknownFutureValue. |
createdDateTime |
dateTimeOffsetNullable |
Date and time at which the chat was created. Read-only. |
id |
String |
The chat's unique identifier. Read-only. |
isHiddenForAllMembers |
BooleanNullable |
Indicates whether the chat is hidden for all its members. Read-only. |
lastUpdatedDateTime |
dateTimeOffsetNullable |
Date and time at which the chat was renamed or the list of members was last changed. Read-only. |
onlineMeetingInfo |
teamworkOnlineMeetingInfo |
Represents details about an online meeting. If the chat isn't associated with an online meeting, the property is empty. Read-only. |
tenantId |
StringNullable |
The identifier of the tenant in which the chat was created. Read-only. |
topic |
StringNullable |
(Optional) Subject or topic for the chat. Only available for group chats. |
viewpoint |
chatViewpoint |
Represents caller-specific information about the chat, such as the last message read date and time. This property is populated only when the request is made in a delegated context. |
webUrl |
StringNullable |
The URL for the chat in Microsoft Teams. The URL should be treated as an opaque blob, and not parsed. Read-only. |
installedApps |
teamsAppInstallation collection |
A collection of all the apps in the chat. Nullable. |
lastMessagePreview |
object |
Preview of the last message sent in the chat. Null if no messages were sent in the chat. Currently, only the list chats operation supports this property. |
members |
conversationMember collection |
A collection of all the members in the chat. Nullable. |
messages |
chatMessage collection |
A collection of all the messages in the chat. Nullable. |
permissionGrants |
resourceSpecificPermissionGrant collection |
A collection of permissions granted to apps for the chat. |
Showing 15 of 17 properties.
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"createdDateTime": "dateTimeOffset",
"chatType": "string",
"id": "string (identifier)",
"isHiddenForAllMembers": "Boolean",
"lastUpdatedDateTime": "dateTimeOffset",
"onlineMeetingInfo": {
"@odata.type": "microsoft.graph.teamworkOnlineMeetingInfo"
},
"tenantId": "string",
"topic": "string",
"viewpoint": {
"@odata.type": "microsoft.graph.chatViewpoint"
},
"webUrl": "string",
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
installedApps |
teamsAppInstallation collection |
A collection of all the apps in the chat. Nullable. |
lastMessagePreview |
chatMessageInfo |
Preview of the last message sent in the chat. Null if no messages were sent in the chat. Currently, only the list chats operation supports this property. |
members |
conversationMember collection |
A collection of all the members in the chat. Nullable. |
messages |
chatMessage collection |
A collection of all the messages in the chat. Nullable. |
permissionGrants |
resourceSpecificPermissionGrant collection |
A collection of permissions granted to apps for the chat. |
pinnedMessages |
pinnedChatMessageInfo collection |
A collection of all the pinned messages in the chat. Nullable. |
tabs |
teamsTab collection |
A collection of all the tabs in the chat. Nullable. |
chatType |
chatType |
Related chatType data exposed by this resource. |
operations |
teamsAsyncOperation collection |
A collection of all the Teams async operations that ran or are running on the chat. Nullable. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Chats.Item.RemoveAllAccessForUser;
using Microsoft.Graph.Models;
var requestBody = new RemoveAllAccessForUserPostRequestBody
{
User = new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
Id = "f47ac10b-58cc-4372-a567-0e02b2c3d479",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "a1b2c3d4-e5f6-7890-1234-567890abcdef"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Chats["{chat-id}"].RemoveAllAccessForUser.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const removeAllAccessForUser = {
user: {
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
id: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
tenantId: 'a1b2c3d4-e5f6-7890-1234-567890abcdef'
}
};
await client.api('/chats/{chatsId}/removeAllAccessForUser')
.post(removeAllAccessForUser);
Import-Module Microsoft.Graph.Teams
$params = @{
user = @{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
id = "f47ac10b-58cc-4372-a567-0e02b2c3d479"
tenantId = "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}
}
Remove-MgChatAccessForUser -ChatId $chatId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.remove_all_access_for_user.remove_all_access_for_user_post_request_body import RemoveAllAccessForUserPostRequestBody
from msgraph.generated.models.teamwork_user_identity import TeamworkUserIdentity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemoveAllAccessForUserPostRequestBody(
user = TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
id = "f47ac10b-58cc-4372-a567-0e02b2c3d479",
additional_data = {
"tenant_id" : "a1b2c3d4-e5f6-7890-1234-567890abcdef",
}
),
)
await graph_client.chats.by_chat_id('chat-id').remove_all_access_for_user.post(request_body)
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 or delegated permissions and search for Chat.ReadWrite.All
Grant Admin Consent
Application permissions always require admin consent.