Deep link to Teams chat

You can create a deep link to a Teams chat, such as to start a new chat, browse to a channel conversation, and to a file in a channel.

In this article, you’ll learn to create a deep link:

You can navigate to or create private chats between users with the Microsoft Teams JavaScript client library (TeamsJS) by specifying the set of participants. If a chat doesn’t exist with the specified participants, the user is navigated to an empty new chat.

When a user creates a new chat using a deep link, Teams creates the new chat in the draft state until the user sends the first message. You can also provide the name of the chat if it doesn’t already exist, along with text that should be inserted into the user's compose box. You can think of this as a shortcut for the user taking the manual action of navigating to or creating the chat, and then typing out the message.

As a use-case example, if you’re retrieving a Microsoft 365 user profile information from your bot as a card, this deep link can allow the app user to easily chat with that person.

You can configure deep links to start a new chat in one of the following two ways:

While use of the typed APIs is recommended, you can alternatively use the following format for a manually created deep link that you can use in a bot, connector, or message extension card. To use this deep link with your bot, specify this as the URL target in your card's button or tap action through the openUrl action type.<tenantId>&users=<user1>,<user2>,...&topicName=<chat name>&message=<precanned text>

The query parameters are:

  • users: A comma-separated list of user IDs representing the participants of the chat. The user that performs the action is always included as a participant. Currently, the User ID parameter supports the Microsoft Azure Active Directory (Azure AD) UserPrincipalName, such as an email address only.
  • topicName: An optional parameter for chat's display name if a chat has three or more users. If this field isn't specified, the chat's display name is based on the names of the participants.
  • message: An optional field for the message text that you want to insert into the current app user's compose box while the chat is in the draft state.


The following example demonstrates how to open a chat message to a group of participants with an initial message. You can target the deep link to an existing or a new chat. If a chat already exists, the deep link opens in that chat.

if(chat.isSupported()) {
    const chatPromise = chat.openGroupChat({ users: ["",""], topic: "Prep For Meeting Tomorrow", message: "Hi folks kicking off chat about our meeting tomorrow"});
      then((result) => {/*Successful operation*/}).
      catch((error) => {/*Unsuccessful operation*/});
else { /* handle case where capability isn't supported */ }

You can use the following deep link format to go to a particular conversation within channel thread:<channelId>/<parentMessageId>?tenantId=<tenantId>&groupId=<groupId>&parentMessageId=<parentMessageId>&teamName=<teamName>&channelName=<channelName>&createdTime=<createdTime>

The query parameters are:

  • channelId: Channel ID of the conversation. For example, 19:3997a8734ee5432bb9cdedb7c432ae7d@thread.tacv2.
  • tenantId: Tenant ID, such as 0d9b645f-597b-41f0-a2a3-ef103fbd91bb.
  • groupId: Group ID of the file. For example, 3606f714-ec2e-41b3-9ad1-6afb331bd35d.
  • parentMessageId: Parent message ID of the conversation.
  • teamName: Name of the team.
  • channelName: Name of the team's channel.


You can see channelId and groupId in the URL from the channel.


Use the following deep link format to navigate a user to a message in a personal or group chat in Teams:{chatId}/{messageId}?tenantId=<tenantId>?context={"contextType":"chat"}


The query parameters are:

  • chatId: ChatID of the conversation. The supported format for chatId is 19:xxx. For example, 19:253f5895-9a62-4362-8d38-43f0205c702c_f1b94dcf-0aa3-4989-bcdf-ef4a5ed00f86@unq.gbl.spaces. Apps can read a chat ID through app context in Teams, incoming payload to bot, or through Microsoft Graph APIs.


    For one-on-one chats with bot, the incoming payload to bot contains the conversation ID in a:xxx format.

  • messageId: Unique message ID of each message in a chat. When a bot posts a message in chat, the messageId is returned. You can also get the messageId through Microsoft Graph APIs. For example, 1563480968434.
  • context: Specify the contextType as chat.


Use the following deep link format can be used in a bot, connector, or message extension card for configuring a deep link to connect to a file in a channel:<fileId>?tenantId=<tenantId>&fileType=<fileType>&objectURL=<objectURL>&baseUrl=<baseURL>&serviceName=<Name>&threadId=<threadId>&groupId=<groupId>

The query parameters are:

  • fileId: Unique file ID from Sharepoint Online, also known as sourcedoc. For example, 1FA202A5-3762-4F10-B550-C04F81F6ACBD.
  • tenantId: Tenant ID, such as 0d9b645f-597b-41f0-a2a3-ef103fbd91bb.
  • fileType: Supported file type, such as .docx, .pptx, .xlsx, and .pdf.
  • objectUrl: Object URL of the file. The format is https://{tenantName}{TeamName}/SharedDocuments/{ChannelName}/FileName.ext. For example,
  • baseUrl: Base URL of the file. The format is https://{tenantName}{TeamName}. For example,
  • serviceName: Name of the service, app ID. For example, teams.
  • threadId: The threadID is the team ID of the team where the file is stored. It's optional and can't be set for files stored in a user's OneDrive folder. threadId -
  • groupId: Group ID of the file. For example, ae063b79-5315-4ddb-ba70-27328ba6c31e.


You can see threadId and groupId in the URL from the channel.

The following example format illustrates the deep link to files:

Serialization of this object

fileId: "5E0154FC-F2B4-4DA5-8CDA-F096E72C0A80",
tenantId: "0d9b645f-597b-41f0-a2a3-ef103fbd91bb",
filetype: = "pptx",
objectUrl: " Documents/FC7- Bot and Action Infra/Kaizala Actions in Adaptive Cards - Deck.pptx",
baseUrl: "",
serviceName: "teams",
threadId: = "",
groupId: "ae063b79-5315-4ddb-ba70-27328ba6c31e"

Code Sample

Sample name Description .NET Node.js
Deep link consuming Subentity ID This sample shows how to use deep-link from bot chat to tab consuming Subentity ID. It also shows deeplinks for navigate to app, navigate to chat, open profile dialog and open scheduling dialog. View View