Skip to content

Microsoft Teams Notifications ​

Scripts send Teams messages via the injected $notifications object, using named webhooks you configure in Admin Settings. Teams notifications support an optional title parameter that appears as a bold heading in the message card.

1. Create a Teams Incoming Webhook ​

New Workflows approach (2024+) ​

Microsoft is migrating away from Office 365 Connectors. If you don't see a Connectors option in your channel:

  1. In the channel, click ⋯ → Workflows
  2. Search for "Post to a channel when a webhook request is received"
  3. Follow the setup wizard and copy the webhook URL at the end

Classic Connectors (if still available) ​

  1. Navigate to the channel in Teams
  2. Click ⋯ → Connectors
  3. Search for Incoming Webhook and click Configure
  4. Give it a name (e.g. "ApiMeld") and click Create
  5. Copy the webhook URL — it looks like:
    https://yourorg.webhook.office.com/webhookb2/...

Both URL formats work with ApiMeld.

2. Add the webhook to ApiMeld ​

  1. Go to Admin → Settings → Notifications
  2. Under Teams Webhooks, click Add
  3. Enter a name (e.g. "IT Ops Team") and paste the webhook URL
  4. Click Save

The name you enter here is what you pass as webhookName in your scripts.

Sending from a script ​

LanguageOne-liner
PowerShell$notifications.SendTeams('IT Ops Team', 'Task complete')
PowerShell (with title)$notifications.SendTeams('IT Ops Team', 'Body text', 'Optional Title')
JavaScript / TypeScriptnotifications.sendTeams('IT Ops Team', 'Task complete')
Pythonnotifications.send_teams('IT Ops Team', 'Task complete')
Bashnotify_teams "IT Ops Team" "Task complete"
C#Notifications.SendTeams("IT Ops Team", "Task complete");

Larger example (JavaScript) ​

javascript
const res = await datasources.OrdersApi.GetOrders()
const count = res.data.length

if (count === 0) {
    notifications.sendTeams('IT Ops Team', 'No orders found — check the source system.', 'Sync Warning')
} else {
    notifications.sendTeams('IT Ops Team', `Synced ${count} orders successfully.`, 'Nightly Sync')
}

Parameters ​

ParameterDescription
webhookNameThe name of the webhook as saved in Admin → Settings → Notifications
messageMessage body text
title (optional)Bold heading displayed above the message

Testing the webhook ​

After saving, click Test next to the webhook in Admin → Settings → Notifications to send a test card to the Teams channel.

Multiple channels

Add multiple webhooks pointing to different channels — for example, post failures to #infrastructure-alerts and successes to #apimeld-log.