CONNECT APP
Build with Microsoft Teams
Communication
- OAuth
MCP
Give your agent Microsoft Teams tools
Every Microsoft Teams action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Microsoft Teams account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "microsoft_teams",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Create Channel:
const result = await mcp.callTool({
name: "microsoft_teams-create-channel",
arguments: {
teamId: "Team",
displayName: "Display Name",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "microsoft_teams",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Create Channel:
result = await session.call_tool("microsoft_teams-create-channel", {
"teamId": "Team",
"displayName": "Display Name",
})API PROXY
Call the Microsoft Teams API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Microsoft Teams API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://graph.microsoft.com/v1.0/me",
})
// Any allowed Microsoft Teams endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://graph.microsoft.com/v1.0/me
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9ncmFwaC5taWNyb3NvZnQuY29tL3YxLjAvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Microsoft Teams actions from your backend
Connect a user's Microsoft Teams account once, then run Create Channel on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "microsoft_teams-create-channel",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
microsoft_teams: { authProvisionId: "apn_xxxxxxx" },
teamId: "Team",
displayName: "Display Name",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="microsoft_teams-create-channel",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"microsoft_teams": {"authProvisionId": "apn_xxxxxxx"},
"teamId": "Team",
"displayName": "Display Name",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "microsoft_teams-create-channel",
"configured_props": {
"microsoft_teams": { "authProvisionId": "apn_xxxxxxx" },
"teamId": "Team",
"displayName": "Display Name"
}
}'TOOLS
Microsoft Teams actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Create Channel
actionCreate a new channel in Microsoft Teams. See the docs hereWritev0.0.12 -
Get Chat Message
actionGet a specific message from a chat. See the documentationRead-onlyv0.0.1 -
Get Current User
actionReturns the authenticated Microsoft Teams user's ID, display name, email, and principal name via Microsoft Graph. Call this first when the user says 'my channels', 'my chats', or needs identity context. Use the returnedidto identify the sender in Send Channel Message or Send Chat Message results. See the documentation.Read-onlyv0.0.2 -
List Channel Messages
actionLists messages in a Microsoft Teams channel. See the documentationRead-onlyv0.0.1 -
List Channels
actionLists all channels in a Microsoft Team. See the docs hereRead-onlyv0.0.12 -
List Chats
actionLists all chat conversations for the authenticated user. See the documentationRead-onlyv0.0.1 -
List Messages in Chat
actionGet the list of messages in a chat. See the documentationRead-onlyv0.0.1 -
List Shifts
actionGet the list of shift instances for a team. See the documentationRead-onlyv0.0.9 -
List Teams
actionLists all teams the authenticated user has joined. See the documentationRead-onlyv0.0.1 -
Search Messages
actionSearch for email or chat messages. See the documentationRead-onlyv0.0.1 -
Send Channel Message
actionSend a message to a team's channel. Optionally include inline images viahostedContents. See the documentationWritev0.1.0 -
Send Chat Message
actionSend a message to a team's chat. Optionally include inline images viahostedContents. See the docs hereWritev0.0.13
EVENTS
Microsoft Teams triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New Channel
triggerEmit new event when a new channel is created within a team. See the documentationv0.0.15 -
New Channel Message
triggerEmit new event when a new message is posted in a channel. See the documentationv0.0.15 -
New Chat
triggerEmit new event when a new chat is created. See the documentationv0.0.15 -
New Chat Message
triggerEmit new event when a new message is received in a chat. See the documentationv0.0.15 -
New Team
triggerEmit new event when a new team is joined by the authenticated user. See the documentationv0.0.15 -
New Team Member
triggerEmit new event when a new member is added to a team. See the documentationv0.0.15
MULTI-APP
Use Microsoft Teams with other popular apps
Most products don't stop at one integration. Pair Microsoft Teams with the other apps your users rely on, and ship use cases that span both.
- App slug
- microsoft_teams
- Authentication
- OAuth
- Categories
- Communication
- Actions
- 12
- Triggers
- 6
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed Microsoft Teams OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- User.Read
- offline_access
- openid
- profile
- ChatMessage.Send
- Channel.ReadBasic.All
- ChannelMessage.Read.All
- ChannelMessage.Send
- Team.ReadBasic.All
- Schedule.Read.All
- Channel.Create
- Chat.ReadWrite