Unable to Post message to teams channel using graph API

Vaibhav-A Mankar 65 Reputation points
2023-07-28T09:43:14.25+00:00

We are trying to send message using graph API with below permission. But we are getting API requires one of 'Teamwork.Migrate.All'. Roles on the request 'User.Read.All, Chat.ReadWrite.All, Chat.Create'. We just want to send the message not the migration activity.

curl --location 'https://graph.microsoft.com/v1.0/chats/19:KkGoXOg2cZbMKOEU562AmZMqEVL9joUu7D2ywE2EJ6U1@thread.tacv2/messages' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxxxxx' \
--data '{
  "body": {

 "content": "Hello world"

  }
}'

Response:

{

"error": {

"code": "Forbidden",
"message": "Missing role permissions on the request. API requires one of 'Teamwork.Migrate.All'. Roles on the request 'User.Read.All, Chat.ReadWrite.All, Chat.Create'.",
"innerError": {
    "date": "2023-07-28T08:19:02",
    "request-id": "663b824c-cc65-40d3-90ce-77e3908ccb2f",
    "client-request-id": "663b824c-cc65-40d3-90ce-77e3908ccb2f"
}

}

}

Permission:

API / Permissions nameTypeDescriptionAdmin consent requiredStatusMicrosoft Graph (8)ChannelMessage.ReadWriteDelegatedRead and write user channel messagesYesGranted for Deutsche Bank AG DevChannelMessage.SendDelegatedSend channel messagesNoGranted for Deutsche Bank AG DevChat.CreateApplicationCreate chatsYesGranted for Deutsche Bank AG DevChat.ReadWriteDelegatedRead and write user chat messagesNoGranted for Deutsche Bank AG DevChat.ReadWrite.AllApplicationRead and write all chat messagesYesGranted for Deutsche Bank AG DevChatMessage.SendDelegatedSend user chat messagesNoGranted for Deutsche Bank AG DevUser.ReadDelegatedSign in and read user profileNoGranted for Deutsche Bank AG DevUser.Read.AllApplicationRead all users' full profilesYesGranted for Deutsche Bank AG Dev

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

Microsoft Security | Microsoft Graph

4 answers

Sort by: Most helpful
  1. Jasper Kopalli 0 Reputation points
    2025-11-14T11:38:37.38+00:00

    It is not working from postman
    it is working from graph developer

    Was this answer helpful?

    0 comments No comments

  2. Sayali-MSFT 6,396 Reputation points Microsoft External Staff Moderator
    2023-08-17T09:11:59.8066667+00:00

    @Vaibhav-A Mankar-Are you using Application permission or delegated permission? If you are using Application permission, then Application permissions are only supported for migration.

    Could you please try with the below Graph API-

    POST /teams/{team-id}/channels/{channel-id}/messages
    

    Reference doc-https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http#example-1-send-a-hello-world-message-in-a-channel

    Was this answer helpful?


  3. TylerH 66 Reputation points
    2023-08-15T19:03:20.4966667+00:00

    Another user is having the same problem: https://stackoverflow.com/questions/76908272/how-do-i-send-messages-to-the-posts-tab-of-a-channel-in-teams

    My remarks there:

    The only other options for doing this are ones the page lists as deprecated, which is frustrating: ChannelMessage.Send and Group.ReadWrite.All permissions. [...] I guess they have marked that permission as deprecated because they plan to charge money for real-time external message feed functionality eventually, but just haven't had time to implement that yet...

    Was this answer helpful?


  4. Vaibhav-A Mankar 65 Reputation points
    2023-08-07T10:36:12.04+00:00

    Any update on question?

    Was this answer helpful?

    0 comments No comments

Your answer

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