Microsoft Teams
Send messages to Microsoft Teams channels from your agent's workflows via the Microsoft Graph API.
The Microsoft Teams connector lets your agent post messages to a Teams channel using the Microsoft Graph API. Authentication uses the OAuth 2.0 client credentials flow — no user sign-in is required at runtime.
What you can do
| Action | Node type | Description |
|---|---|---|
| Send a channel message | Teams Message | Post a plain text or HTML message to a Teams channel. Optionally set message importance. |
All message fields support {{variable}} template syntax.
Before you start
You need three values from an Azure AD app registration:
| Credential field | Description |
|---|---|
| Tenant ID | Your Azure AD tenant (directory) ID. Found in Azure Active Directory > Overview. |
| Client ID | The application (client) ID of your Azure AD app registration. |
| Client Secret | A client secret generated for the app registration. |
The app registration must have the Microsoft Graph application permission ChannelMessage.Send granted with admin consent.
Connect Microsoft Teams
Register an app in Azure Active Directory.
Sign in to the Azure Portal and go to Azure Active Directory > App registrations > New registration. Give the app a name and register it. Copy the Application (client) ID and the Directory (tenant) ID.
Create a client secret.
Under Certificates & secrets > New client secret, create a secret. Copy the secret value immediately — it is only shown once.
Grant the required Graph API permissions.
Under API permissions > Add a permission > Microsoft Graph > Application permissions, add ChannelMessage.Send. Then click Grant admin consent for your tenant.
Find your Team ID and Channel ID.
In Microsoft Teams, right-click the team or channel and select Get link to channel. The IDs are embedded in the URL, or you can retrieve them via the Graph API endpoint https://graph.microsoft.com/v1.0/teams.
Enter the credentials in Mojar.
In your agent, open Integrations, find Microsoft Teams, and click its card. Paste your Tenant ID, Client ID, and Client Secret, give the connection a name, and click Connect.
Use it in a workflow
Fill in the fields:
- Team ID — the ID of the Teams team, e.g.
{{config.teamId}} - Channel ID — the ID of the channel to post to
- Message — the message body (supports
{{variable}}syntax) - Content type —
text(default) orhtmlfor HTML-formatted messages - Importance — optional:
normal,high, orurgent
The client credentials flow authenticates as the app, not as a user. Messages in Teams will appear as posted by the app's display name.