Pin a message in a channel in MS Teams using MS Graph API

Nikhil Reddy Kunta 0 Reputation points
2025-04-22T11:51:39.68+00:00

I've created a MS Teams app and as part of it's functionality, it has to pin the message (in both one-on-one chat and in a channel) on behalf of the user

I'm using below API to pin a message in a channel in MS Teams

https://graph.microsoft.com/v1.0/chats/<chatID>/pinnedMessages

Endpoint: - POST https://graph.microsoft.com/v1.0/chats/19:....@thread.tacv2/pinnedMessages

Body: 

{

"******@odata.bind": "https://graph.microsoft.com/v1.0/chats/19:....@thread.tacv2/messages/<message_id>"

}

Note: - 19:....@thread.tacv2 is the chatID of the channel

And I get a successful response as below 

201 Created

{

"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3.......%40thread.tacv2')/pinnedMessages/$entity",

"id": "<message_id>"

}

But when I go that particular channel, I don't see the message as the pinned message in the channel But when I try to get the list of pinned message in a channel using below API, it gives the response that the above message which I pinned. But I don't see it in the channel in MS Teams. And I'm facing this issue only while pinning the message in the channel using MS Graph API. I don't face the same issue with one-on-one chat with the bot I've created.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,591 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.