Microsoft Teams Integration
The Microsoft Teams integration lets agents send messages, reply in threads, manage channels, and list teams — directly from a conversation. Use it for alert routing, escalation flows, or any workflow where the agent needs to reach a team via Teams.
Authentication
Microsoft Teams uses an OAuth2 access token from the Microsoft Graph API.
Required Graph API permissions (Application or Delegated):
ChannelMessage.Send— send messages to channelsChat.ReadWrite— send and read chat messagesChannel.Create— create channelsTeam.ReadBasic.All— list teamsChannelSettings.ReadWrite.All— read channel settings
To get a token:
- Register an app in Azure Portal → Azure Active Directory → App registrations
- Add the required Microsoft Graph API permissions
- Generate a client credentials token or use a delegated token from a user sign-in flow
- Copy the access token
| Field | Description |
|---|---|
| Access Token | Bearer token for the Microsoft Graph API (https://graph.microsoft.com) |
Installing
- Go to your project → Integrations → Browse
- Find Microsoft Teams and click Install
- Paste your Access Token
- Select the actions you want to enable
- Click Install
Actions
send_channel_message — Send Channel Message
Posts a message to a Teams channel.
Tool reference: {{tool:microsoft_teams_send_channel_message}}
| Parameter | Required | Description |
|---|---|---|
team_id | Yes | Teams group/team ID |
channel_id | Yes | Channel ID within the team |
content | Yes | Message text |
content_type | No | text (default) or html for rich formatting |
Returns: message_id, created_at
reply_to_message — Reply to Message
Replies to an existing message in a channel thread.
Tool reference: {{tool:microsoft_teams_reply_to_message}}
| Parameter | Required | Description |
|---|---|---|
team_id | Yes | Team ID |
channel_id | Yes | Channel ID |
message_id | Yes | ID of the message to reply to |
content | Yes | Reply text |
content_type | No | text or html |
send_chat_message — Send Chat Message
Sends a message to a 1:1 or group chat.
Tool reference: {{tool:microsoft_teams_send_chat_message}}
| Parameter | Required | Description |
|---|---|---|
chat_id | Yes | Chat ID (retrieve from Microsoft Graph) |
content | Yes | Message content |
create_channel — Create Channel
Creates a new channel in a team.
Tool reference: {{tool:microsoft_teams_create_channel}}
| Parameter | Required | Description |
|---|---|---|
team_id | Yes | Team to create the channel in |
channel_name | Yes | Channel display name |
description | No | Channel description |
membership_type | No | standard (default) or private |
Returns: channel_id, channel_name
list_teams — List Teams
Returns all teams the integration account has access to.
Tool reference: {{tool:microsoft_teams_list_teams}}
No parameters required.
Returns: Array of team_id, name, description
list_channels — List Channels
Returns all channels in a team.
Tool reference: {{tool:microsoft_teams_list_channels}}
| Parameter | Required | Description |
|---|---|---|
team_id | Yes | Team ID |
Returns: Array of channel_id, name, membership_type
update_message — Update Message
Edits a previously sent channel message.
Tool reference: {{tool:microsoft_teams_update_message}}
| Parameter | Required | Description |
|---|---|---|
team_id | Yes | Team ID |
channel_id | Yes | Channel ID |
message_id | Yes | Message to update |
content | Yes | New message content |
Using Teams in an agent
Escalation to Teams
When a customer issue cannot be resolved automatically, or the user requests a human agent:
1. Collect a summary of the issue.
2. Use {{tool:microsoft_teams_send_channel_message}} to post to the support escalations channel:
- team_id: <your team ID>
- channel_id: <support channel ID>
- content: "🔔 Escalation needed\n**User:** [name]\n**Issue:** [summary]\n**Conversation started:** [time]"
3. Tell the user: "I've notified the support team and someone will follow up shortly."
Finding your team and channel IDs
Use {{tool:microsoft_teams_list_teams}} to find your team IDs, then {{tool:microsoft_teams_list_channels}} with a team ID to find channel IDs. Copy these into your agent's system prompt as constants.
Troubleshooting
401 Unauthorized
The access token has expired. Microsoft Graph tokens expire after 1 hour. Regenerate and reinstall.
403 Forbidden
The app registration is missing the required Graph API permissions, or admin consent hasn't been granted. Go to Azure Portal → App registrations → API permissions → Grant admin consent.
404 Team or channel not found
The team_id or channel_id is incorrect. Use list_teams and list_channels to find the correct IDs.
Messages not appearing in channel
The app may not be a member of the team. For application permissions, the app needs to be granted access to the team by a Teams admin.