Share via

How to change Teams Group Chat image programmatically

Artem Shaturskyi 225 Reputation points
2026-02-04T16:01:55.5766667+00:00

Hello!
Is it possible to set or update a Teams group chat image programmatically (REST API, PowerShell, JScript)?

Microsoft Teams | Microsoft Teams for business | Chats | Group chats
0 comments No comments

2 answers

Sort by: Most helpful
  1. Killian-N 9,485 Reputation points Microsoft External Staff Moderator
    2026-02-04T19:22:28.28+00:00

    Hi @Artem Shaturskyi,

    Thank you for posting your question in the Microsoft Q&A forum.

    I completely understand why you’d like to automate this process, especially to maintain consistent branding and visual identity across chats.

    However, at this time, I wasn’t able to find any Microsoft‑supported or officially documented API that allows you to set or update a Teams group chat image programmatically. This includes Microsoft Graph REST APIs, PowerShell, and JavaScript. While Microsoft Graph does document photo APIs for contacts, users, Microsoft 365 groups, and teams, there is currently no equivalent support for Teams chat threads or group chats.

    If your objective is to programmatically manage a “container’s” image, there are a couple of supported alternatives you may want to consider:

    1/ Updating a Team’s photo (if a Team can be used instead of a group chat):

    Microsoft provides PowerShell cmdlets such as Set-MgTeamPhotoContent, which allow you to update a Team’s photo with a maximum size of 4 MB.

    Reference: Set-MgTeamPhotoContent.

    2/ Updating a Microsoft 365 Group photo, which can also influence the connected Team experience where applicable:

    Microsoft Graph’s Update profilePhoto API explicitly supports updating photos for groups, teams, users, and contacts, again with a 4 MB size limit, using either PATCH or PUT depending on the resource.

    Reference: Update profilePhoto.

    That said, for actual Teams group chat images, the currently supported approach is via the end‑user experience in the Teams desktop or web client. Microsoft documents this process in: Personalize your group chat image in Microsoft Teams.

    Although Microsoft Graph does provide chat APIs for creating and managing chats, members, and messages, the documented capabilities focus on areas such as chat creation, renaming chats, and posting messages, rather than managing chat avatars. You can review the current scope of these APIs here: Leverage new Microsoft Teams chat APIs to enable new scenarios.

    Therefore, if your scenario requires a fully programmatically managed icon, using a Team or a Microsoft 365 Group‑backed workspace may be a better fit, as those containers are supported through Microsoft Graph and PowerShell.

    I hope this helps you move forward smoothly.

    Thank you so much for your patience and understanding throughout this process. If you have any questions or need further support, please don’t hesitate to reach out at any time.  

    I look forward to continuing the conversation.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Q&A Assist
    2026-02-04T16:02:06.08+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Yes, it is possible to change or update a Teams group chat image programmatically using PowerShell or the Microsoft Graph API. Here are the methods you can use:

    PowerShell

    You can use the Set-TeamPicture cmdlet from the MicrosoftTeams PowerShell module to update the team picture. The syntax is as follows:

    Set-TeamPicture -GroupId <String> -ImagePath <String>
    

    This command will update the team picture, but note that changes may not be reflected immediately in the Teams application.

    Microsoft Graph API

    You can also use the Microsoft Graph API to update the photo for a specified group chat. The relevant cmdlet is Set-MgTeamPhotoContent, which allows you to update the photo for a team or group chat. The size of the photo you can upload is limited to 4 MB, and you can use either PATCH or PUT for this operation.

    Example

    Here’s a basic example using PowerShell to update a team photo:

    Import-Module Microsoft.Graph.Teams
    $params = Binary data for the image
    Set-MgTeamPhotoContent -TeamId $teamId -BodyParameter $params
    

    This example updates the photo of a team using the specified image data.


    References:

    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.