Microsoft Teams

Download 33
Last updated Nov 20, 2026

ms-teams-chat-messages

Retrieves the one-on-one and group chat messages of the specified users using Microsoft Graph API.

Syntax

ms-teams-chat-messages [profile=STRING] user=STRING [duration=STRING] [from=DATETIME] [to=DATETIME] [limit=INT] [include-system=BOOL]

Options

user=STRING
Required. User principal name or object ID. Separate multiple users with commas (,). e.g. hong@example.com,user@example.com
profile=STRING
Optional. Microsoft Teams Graph API connect profile name. Every registered Microsoft Teams Graph API connect profile is queried when omitted.
duration=STRING
Optional. Query only recent messages. e.g. 10m, 1h, 1d
from=DATETIME
Optional. Start of the query range. One day before the end by default.
to=DATETIME
Optional. End of the query range. The current time by default.
limit=INT
Optional. Maximum number of messages to retrieve per user. Specify a positive integer.
include-system=BOOL
Optional. Include system event messages such as membership changes. (default: f)

Output fields

FieldTypeNameDescription
_timedateTimeTime the message was created
profilestringConnect profileMicrosoft Teams Graph API connect profile name. e.g. ms_teams_graph
userstringQueried userUser whose chat messages were queried. e.g. hong@example.com
msg_idstringMessage IDMessage ID
chat_idstringChat IDID of the chat the message belongs to. Shared by every message of the same chat
updateddateUpdatedTime the message was last modified. The query range filters on this value
msg_typestringMessage typemessage, chatEvent, typing, systemEventMessage
from_user_idstringSender IDObject ID of the sender. null when the sender is not set
from_user_namestringSender nameDisplay name of the sender. e.g. Hong Gildong
msgstringMessageMessage body with HTML markup removed. e.g. Sharing the meeting notes
content_typestringContent typeContent type of the original body. html or text
importancestringImportancenormal, high, urgent