View as Markdown
Microsoft Teams icon

Microsoft Teams ACTION

Send Direct Message

Send a one-on-one message to a user, even if you have never chatted with them before. Reuses the existing one-on-one chat when there is one, otherwise creates it. To post to an existing group chat, use Send Chat Message instead. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Microsoft Teams account once, then configure and run Send Direct Message from your backend or agent.

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-send-direct-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_teams: { authProvisionId: "apn_xxxxxxx" },
    user: "User",
    message: "Message",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Send Direct Message inputs
Property Type Description
user User string
The recipient's user principal name (usually their work email, e.g. alex@contoso.com) or Microsoft Entra user ID (e.g. 82af01c5-f7cc-4a2e-a728-3a5df21afd9d, the Object ID under Users in the Microsoft Entra admin center)
Required
message Message string
Message to be sent
Required
contentType Content Type string
Text message or HTML message
Optional
isGuest Recipient Is Guest boolean
Set to true when the recipient is a guest user in your organization, which Microsoft Graph requires to join with the guest role. Leave false for members of your organization. Identify guests by user ID or their #EXT# user principal name, not their email address. Users in other organizations are not supported.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
microsoft_teams-send-direct-message
Version
0.0.1
App
Microsoft Teams
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes