Edit

Share via


targetedChatMessage resource type

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Represents a targeted message in Microsoft Teams that is visible only to a specified recipient. Unlike regular messages that are visible to all participants in a group chat or channel, targeted messages provide privacy for bot interactions and app-to-user communications that require user-specific information.

Targeted messages are used in scenarios such as:

  • Bot authentication requests in group contexts, where credentials should only be visible to the requesting user.
  • Chat summaries for new members, visible only to the joining member.
  • Proactive and reactive bot messages that contain sensitive or user-specific information.

Inherits from chatMessage.

Methods

Method Return type Description
Get all targeted messages targetedChatMessage collection Get all targeted messages sent to a specific user in group chats and channels.
Get all retained targeted messages targetedChatMessage collection Get all retained targeted messages sent to a specific user in group chats and channels.
Delete targeted message for channel None Delete a specific targeted message from a channel context.
Delete targeted message for chat None Delete a specific targeted message from a chat context.

Properties

Property Type Description
attachments chatMessageAttachment collection References to attached objects like files, tabs, meetings, or other items. Inherited from chatMessage.
body itemBody The content of the message. Inherited from chatMessage.
channelIdentity channelIdentity The channel and team information if the targeted message was sent in a channel context. Contains the channelId and teamId properties. Inherited from chatMessage.
chatId String The unique identifier of the chat if the targeted message was sent in a group chat context. Inherited from chatMessage.
createdDateTime DateTimeOffset The date and time when the message was created. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014, is 2014-01-01T00:00:00Z. Inherited from chatMessage.
deletedDateTime DateTimeOffset The date and time when the message was deleted. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014, is 2014-01-01T00:00:00Z. Only applicable for retained messages. Inherited from chatMessage.
etag String Version number of the message. Inherited from chatMessage.
eventDetail eventMessageDetail Details about the event if this message represents a system event. Inherited from chatMessage.
from chatMessageFromIdentitySet Details about the sender of the targeted message. Inherited from chatMessage.
id String Unique identifier of the message. The message ID is only unique within the context of a single conversation (chat or channel) for a specific user. Inherited from chatMessage.
importance chatMessageImportance The importance of the message. The possible values are: normal, high, urgent. Inherited from chatMessage.
lastEditedDateTime DateTimeOffset Date and time when the message was last edited. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014, is 2014-01-01T00:00:00Z. Inherited from chatMessage.
lastModifiedDateTime DateTimeOffset Date and time when the message or any of its properties was last modified. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014, is 2014-01-01T00:00:00Z. Inherited from chatMessage.
locale String The locale of the message as set by the client, formatted as en-us. Inherited from chatMessage.
mentions chatMessageMention collection List of entities mentioned in the message. Inherited from chatMessage.
messageHistory chatMessageHistoryItem collection History of edits applied to the message. Inherited from chatMessage.
messageType chatMessageType The type of message. The possible values are: message, chatEvent, typing, unknownFutureValue, systemEventMessage. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: systemEventMessage. Inherited from chatMessage.
onBehalfOf chatMessageFromIdentitySet Information about the user on whose behalf the message was sent. Inherited from chatMessage.
policyViolation chatMessagePolicyViolation Information about policy violations applied to the message by data loss prevention (DLP) applications. Inherited from chatMessage.
reactions chatMessageReaction collection The reactions applied to the message (for example, like, heart, laugh). Inherited from chatMessage.
recipient identity The intended recipient of the targeted message.
replyToId String The ID of the parent message or root message of the thread. Inherited from chatMessage.
subject String The subject of the message. Inherited from chatMessage.
summary String Summary text of the message that can be used for notifications or summary views. Inherited from chatMessage.
webUrl String The link to the message in Microsoft Teams. Inherited from chatMessage.

Relationships

Relationship Type Description
hostedContents chatMessageHostedContent collection Content hosted in the message, such as images or code snippets. Inherited from chatMessage.
replies chatMessage collection Replies to the message. Currently not supported for targeted messages. Inherited from chatMessage.

JSON representation

The following JSON representation shows the resource type.

{
  "@odata.type": "#microsoft.graph.targetedChatMessage",
  "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",
  "onBehalfOf": {"@odata.type": "microsoft.graph.chatMessageFromIdentitySet"},
  "policyViolation": {"@odata.type": "microsoft.graph.chatMessagePolicyViolation"},
  "reactions": [{"@odata.type": "microsoft.graph.chatMessageReaction"}],
  "recipient": {"@odata.type": "microsoft.graph.identity"},
  "replyToId": "String",
  "subject": "String",
  "summary": "String",
  "webUrl": "String"
}