MojarMojar
Connectors

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

ActionNode typeDescription
Send a channel messageTeams MessagePost 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 fieldDescription
Tenant IDYour Azure AD tenant (directory) ID. Found in Azure Active Directory > Overview.
Client IDThe application (client) ID of your Azure AD app registration.
Client SecretA 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

Open a workflow in the workflow editor and click + to add a node.
Select Teams Message from the node picker.
In the node configuration panel, choose your linked Microsoft Teams credential.

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 typetext (default) or html for HTML-formatted messages
  • Importance — optional: normal, high, or urgent
Save the workflow. When the workflow runs, the connector obtains a Graph API access token automatically and posts the message to the specified channel.

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.

On this page