Integrations / Microsoft Teams
Microsoft Teams
Read and send Microsoft Teams chat and channel messages through Microsoft Graph. Work and school accounts only.
8 actions
OAuth 2
5 read3 write
Calls graph.microsoft.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "teams" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
Chat.ReadBasic | List your Teams chats |
Chat.Read | Read messages in your Teams chats |
ChatMessage.Send | Send messages in your Teams chats |
Team.ReadBasic.All | List the teams you belong to |
Channel.ReadBasic.All | List channels in your teams |
ChannelMessage.Read.All | Read messages in channels of your teams |
ChannelMessage.Send | Send messages in channels of your teams |
User.Read | Identify which Microsoft account you connected |
offline_access | Stay connected without asking you to sign in again |
Actions
List channel messagesreadteams.list_channel_messagesRead recent top-level messages in a team channel. Needs admin approval of the ChannelMessage.Read.All permission.
Needs scope: ChannelMessage.Read.All
| Input | Type | Description | |
|---|---|---|---|
team_id | string | Required | Team ID from list_joined_teams |
channel_id | string | Required | Channel ID from list_channels |
top | integer | Optional | Number of items to return (maximum 50) |
await setu.execute({
userId: "user_1",
action: "teams.list_channel_messages",
input: {
"team_id": "<team_id>",
"channel_id": "<channel_id>"
},
});List channelsreadteams.list_channelsList the channels of a team with their IDs and names. Needs admin approval of the Channel.ReadBasic.All permission in most organizations.
Needs scope: Channel.ReadBasic.All
| Input | Type | Description | |
|---|---|---|---|
team_id | string | Required | Team ID from list_joined_teams |
await setu.execute({
userId: "user_1",
action: "teams.list_channels",
input: {
"team_id": "<team_id>"
},
});List chat messagesreadteams.list_chat_messagesRead recent messages in one Teams chat, newest first, with sender, time and text.
Needs scope: Chat.Read
| Input | Type | Description | |
|---|---|---|---|
chat_id | string | Required | Chat ID from list_chats |
top | integer | Optional | Number of items to return (maximum 50) |
await setu.execute({
userId: "user_1",
action: "teams.list_chat_messages",
input: {
"chat_id": "<chat_id>"
},
});List chatsreadteams.list_chatsList the user's Teams chats (one-on-one, group and meeting chats) with their IDs, topics and types.
Needs scope: Chat.ReadBasic
| Input | Type | Description | |
|---|---|---|---|
top | integer | Optional | Number of items to return (maximum 50) |
await setu.execute({
userId: "user_1",
action: "teams.list_chats",
input: {},
});List joined teamsreadteams.list_joined_teamsList the Microsoft Teams the user belongs to, with their IDs. Needs admin approval of the Team.ReadBasic.All permission in most organizations.
Needs scope: Team.ReadBasic.All
No input.
await setu.execute({
userId: "user_1",
action: "teams.list_joined_teams",
input: {},
});Reply to channel messagewriteteams.reply_to_channel_messageReply in the thread of an existing channel message as the signed-in user.
Needs scope: ChannelMessage.Send
| Input | Type | Description | |
|---|---|---|---|
team_id | string | Required | Team ID from list_joined_teams |
channel_id | string | Required | Channel ID from list_channels |
message_id | string | Required | ID of the message being replied to, from list_channel_messages |
content | string | Required | Message text |
content_type | string | Optional | Format of content (default text) |
await setu.execute({
userId: "user_1",
action: "teams.reply_to_channel_message",
input: {
"team_id": "<team_id>",
"channel_id": "<channel_id>",
"message_id": "<message_id>",
"content": "<content>"
},
});Send channel messagewriteteams.send_channel_messagePost a new top-level message in a team channel as the signed-in user.
Needs scope: ChannelMessage.Send
| Input | Type | Description | |
|---|---|---|---|
team_id | string | Required | Team ID from list_joined_teams |
channel_id | string | Required | Channel ID from list_channels |
content | string | Required | Message text |
content_type | string | Optional | Format of content (default text) |
await setu.execute({
userId: "user_1",
action: "teams.send_channel_message",
input: {
"team_id": "<team_id>",
"channel_id": "<channel_id>",
"content": "<content>"
},
});Send chat messagewriteteams.send_chat_messagePost a message into an existing Teams chat as the signed-in user.
Needs scope: ChatMessage.Send
| Input | Type | Description | |
|---|---|---|---|
chat_id | string | Required | Chat ID from list_chats |
content | string | Required | Message text |
content_type | string | Optional | Format of content (default text) |
await setu.execute({
userId: "user_1",
action: "teams.send_chat_message",
input: {
"chat_id": "<chat_id>",
"content": "<content>"
},
});