Skip to content

Open-source status page, incident response and uptime monitoring

feat: add native ms teams notifications (#2146)

Thibault Le Ouay2d5a94deacec
diff --git a/apps/dashboard/src/components/forms/notifications/form-ms-teams.tsx b/apps/dashboard/src/components/forms/notifications/form-ms-teams.tsx
new file mode 100644
index 000000000..edce21c8a
--- /dev/null
+++ b/apps/dashboard/src/components/forms/notifications/form-ms-teams.tsx
@@ -0,0 +1,220 @@
+"use client";
+
+import { CheckboxTree } from "@/components/ui/checkbox-tree";
+import {
+ FormControl,
+ FormDescription,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from "@openstatus/ui/components/ui/form";
+
+import {
+ FormCardContent,
+ FormCardSeparator,
+} from "@/components/forms/form-card";
+import { useTRPC } from "@/lib/trpc/client";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { Button } from "@openstatus/ui/components/ui/button";
+import { Form } from "@openstatus/ui/components/ui/form";
+import { Input } from "@openstatus/ui/components/ui/input";
+import { cn } from "@openstatus/ui/lib/utils";
+import { safeUrlSchema } from "@openstatus/utils";
+import { useMutation } from "@tanstack/react-query";
+import { isTRPCClientError } from "@trpc/client";
+import React, { useTransition } from "react";
+import { useForm } from "react-hook-form";
+import { toast } from "sonner";
+import { z } from "zod";
+import { useFormSheetDirty } from "../form-sheet";
+
+const schema = z.object({
+ name: z.string(),
+ provider: z.literal("ms-teams"),
+ data: z.object({
+ webhookUrl: safeUrlSchema,
+ }),
+ monitors: z.array(z.number()),
+});
+
+type FormValues = z.infer<typeof schema>;
+
+export function FormMsTeams({
+ defaultValues,
+ onSubmit,
+ className,
+ monitors,
+ ...props
+}: Omit<React.ComponentProps<"form">, "onSubmit"> & {
+ defaultValues?: FormValues;
+ onSubmit: (values: FormValues) => Promise<void>;
+ monitors: { id: number; name: string }[];
+}) {
+ const form = useForm<FormValues>({
+ resolver: zodResolver(schema),
+ defaultValues: defaultValues ?? {
+ name: "",
+ provider: "ms-teams",
+ data: { webhookUrl: "" },
+ monitors: [],
+ },
+ });
+ const [isPending, startTransition] = useTransition();
+ const { setIsDirty } = useFormSheetDirty();
+
+ const trpc = useTRPC();
+
+ const sendTestMutation = useMutation(
+ trpc.notification.sendTest.mutationOptions(),
+ );
+
+ const formIsDirty = form.formState.isDirty;
+ React.useEffect(() => {
+ setIsDirty(formIsDirty);
+ }, [formIsDirty, setIsDirty]);
+
+ function submitAction(values: FormValues) {
+ if (isPending) return;
+
+ startTransition(async () => {
+ try {
+ const promise = onSubmit(values);
+ toast.promise(promise, {
+ loading: "Saving...",
+ success: "Saved",
+ error: (error) => {
+ if (isTRPCClientError(error)) {
+ return error.message;
+ }
+ return "Failed to save";
+ },
+ });
+ await promise;
+ } catch (error) {
+ console.error(error);
+ }
+ });
+ }
+
+ function testAction() {
+ if (isPending) return;
+
+ startTransition(async () => {
+ try {
+ const provider = form.getValues("provider");
+ const data = form.getValues("data");
+ const promise = sendTestMutation.mutateAsync({
+ provider,
+ data: {
+ "ms-teams": data,
+ },
+ });
+ toast.promise(promise, {
+ loading: "Sending test...",
+ success: "Test sent",
+ error: (error) => {
+ if (error instanceof Error) {
+ return error.message;
+ }
+ return "Failed to send test";
+ },
+ });
+ await promise;
+ } catch (error) {
+ console.error(error);
+ }
+ });
+ }
+
+ return (
+ <Form {...form}>
+ <form
+ className={cn("grid gap-4", className)}
+ onSubmit={form.handleSubmit(submitAction)}
+ {...props}
+ >
+ <FormCardContent className="grid gap-4">
+ <FormField
+ control={form.control}
+ name="name"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Name</FormLabel>
+ <FormControl>
+ <Input placeholder="My Notifier" {...field} />
+ </FormControl>
+ <FormMessage />
+ <FormDescription>
+ Enter a descriptive name for your notifier.
+ </FormDescription>
+ </FormItem>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="data.webhookUrl"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Microsoft Teams Workflow URL</FormLabel>
+ <FormControl>
+ <Input
+ placeholder="https://prod-00.westeurope.logic.azure.com:443/workflows/..."
+ {...field}
+ />
+ </FormControl>
+ <FormMessage />
+ <FormDescription>
+ Create a "Post to a channel when a webhook request is
+ received" workflow in Teams, then paste the URL here.
+ </FormDescription>
+ </FormItem>
+ )}
+ />
+ <div>
+ <Button
+ variant="outline"
+ size="sm"
+ type="button"
+ onClick={testAction}
+ >
+ Send Test
+ </Button>
+ </div>
+ </FormCardContent>
+ <FormCardSeparator />
+ <FormCardContent>
+ <FormField
+ control={form.control}
+ name="monitors"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Monitors</FormLabel>
+ <FormDescription>
+ Select the monitors you want to notify.
+ </FormDescription>
+ <FormControl>
+ <CheckboxTree
+ items={[
+ {
+ id: -1,
+ label: "Select all",
+ children: monitors.map((m) => ({
+ id: m.id,
+ label: m.name,
+ })),
+ },
+ ]}
+ value={field.value ?? []}
+ onValueChange={field.onChange}
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </FormCardContent>
+ </form>
+ </Form>
+ );
+}
diff --git a/apps/dashboard/src/components/forms/notifications/form.tsx b/apps/dashboard/src/components/forms/notifications/form.tsx
index c80275a98..dbe198b3f 100644
--- a/apps/dashboard/src/components/forms/notifications/form.tsx
+++ b/apps/dashboard/src/components/forms/notifications/form.tsx
@@ -23,6 +23,7 @@ const schema = z.object({
name: z.string(),
provider: z.enum([
"slack",
+ "ms-teams",
"discord",
"email",
"sms",
diff --git a/apps/dashboard/src/data/notifications.client.ts b/apps/dashboard/src/data/notifications.client.ts
index 171cc35aa..bbccee1fe 100644
--- a/apps/dashboard/src/data/notifications.client.ts
+++ b/apps/dashboard/src/data/notifications.client.ts
@@ -2,6 +2,7 @@ import { FormDiscord } from "@/components/forms/notifications/form-discord";
import { FormEmail } from "@/components/forms/notifications/form-email";
import { FormGoogleChat } from "@/components/forms/notifications/form-google-chat";
import { FormGrafanaOncall } from "@/components/forms/notifications/form-grafana-oncall";
+import { FormMsTeams } from "@/components/forms/notifications/form-ms-teams";
import { FormNtfy } from "@/components/forms/notifications/form-ntfy";
import { FormOpsGenie } from "@/components/forms/notifications/form-opsgenie";
import { FormPagerDuty } from "@/components/forms/notifications/form-pagerduty";
@@ -14,6 +15,7 @@ import {
DiscordIcon,
GoogleIcon,
GrafanaIcon,
+ MicrosoftTeamsIcon,
TelegramIcon,
WhatsappIcon,
} from "@openstatus/icons";
@@ -63,6 +65,11 @@ export const config = {
label: "Slack",
form: FormSlack,
},
+ "ms-teams": {
+ icon: MicrosoftTeamsIcon,
+ label: "Microsoft Teams",
+ form: FormMsTeams,
+ },
discord: {
icon: DiscordIcon,
label: "Discord",
diff --git a/apps/server/Dockerfile b/apps/server/Dockerfile
index 41a0cf175..16a3cc0f2 100644
--- a/apps/server/Dockerfile
+++ b/apps/server/Dockerfile
@@ -22,6 +22,7 @@ RUN \
--mount=type=bind,target=packages/notifications/email/package.json,source=packages/notifications/email/package.json \
--mount=type=bind,target=packages/notifications/grafana-oncall/package.json,source=packages/notifications/grafana-oncall/package.json \
--mount=type=bind,target=packages/notifications/google-chat/package.json,source=packages/notifications/google-chat/package.json \
+ --mount=type=bind,target=packages/notifications/ms-teams/package.json,source=packages/notifications/ms-teams/package.json \
--mount=type=bind,target=packages/notifications/ntfy/package.json,source=packages/notifications/ntfy/package.json \
--mount=type=bind,target=packages/notifications/opsgenie/package.json,source=packages/notifications/opsgenie/package.json \
--mount=type=bind,target=packages/notifications/pagerduty/package.json,source=packages/notifications/pagerduty/package.json \
diff --git a/apps/server/dofigen.lock b/apps/server/dofigen.lock
index fe07d09cb..1d9f8fe5b 100644
--- a/apps/server/dofigen.lock
+++ b/apps/server/dofigen.lock
@@ -15,8 +15,8 @@ effective: |
path: oven/bun
digest: sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a
label:
- org.opencontainers.image.stage: build
org.opencontainers.image.base.name: docker.io/oven/bun:1.3.6
+ org.opencontainers.image.stage: build
org.opencontainers.image.base.digest: sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a
workdir: /app/apps/server
env:
@@ -36,9 +36,9 @@ effective: |
path: oven/bun
digest: sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a
label:
- org.opencontainers.image.stage: install
org.opencontainers.image.base.name: docker.io/oven/bun:1.3.6
org.opencontainers.image.base.digest: sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a
+ org.opencontainers.image.stage: install
workdir: /app/
run:
- bun install --production --frozen-lockfile --verbose
@@ -69,6 +69,8 @@ effective: |
source: packages/notifications/grafana-oncall/package.json
- target: packages/notifications/google-chat/package.json
source: packages/notifications/google-chat/package.json
+ - target: packages/notifications/ms-teams/package.json
+ source: packages/notifications/ms-teams/package.json
- target: packages/notifications/ntfy/package.json
source: packages/notifications/ntfy/package.json
- target: packages/notifications/opsgenie/package.json
@@ -115,14 +117,14 @@ effective: |
path: debian
digest: sha256:1a4701c321b1d28b1ff5f0230e766791e4b79b1d4c6c7a70064f4b297b1a330f
label:
+ org.opencontainers.image.base.name: docker.io/debian:bullseye-slim
+ org.opencontainers.image.title: OpenStatus Server
org.opencontainers.image.vendor: OpenStatus
- org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus
org.opencontainers.image.base.digest: sha256:1a4701c321b1d28b1ff5f0230e766791e4b79b1d4c6c7a70064f4b297b1a330f
- org.opencontainers.image.authors: OpenStatus Team
org.opencontainers.image.description: REST API server with Hono framework for OpenStatus
- org.opencontainers.image.base.name: docker.io/debian:bullseye-slim
- org.opencontainers.image.title: OpenStatus Server
+ org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus
io.dofigen.version: 2.6.0
+ org.opencontainers.image.authors: OpenStatus Team
user:
user: '1000'
group: '1000'
@@ -159,7 +161,7 @@ images:
digest: sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a
resources:
dofigen.yml:
- hash: 1759a213e33b260058574d435c45eadd2a9c2b2468f09644d06b78765abc076a
+ hash: c9490c75001074e3e201504aa5b4251e3e96ba6648b5512dfbaf497e56a57cbc
content: |
# Files to exclude from Docker context
ignore:
@@ -193,6 +195,7 @@ resources:
- packages/notifications/email/package.json
- packages/notifications/grafana-oncall/package.json
- packages/notifications/google-chat/package.json
+ - packages/notifications/ms-teams/package.json
- packages/notifications/ntfy/package.json
- packages/notifications/opsgenie/package.json
- packages/notifications/pagerduty/package.json
diff --git a/apps/server/dofigen.yml b/apps/server/dofigen.yml
index bcde71728..f59580492 100644
--- a/apps/server/dofigen.yml
+++ b/apps/server/dofigen.yml
@@ -30,6 +30,7 @@ builders:
- packages/notifications/email/package.json
- packages/notifications/grafana-oncall/package.json
- packages/notifications/google-chat/package.json
+ - packages/notifications/ms-teams/package.json
- packages/notifications/ntfy/package.json
- packages/notifications/opsgenie/package.json
- packages/notifications/pagerduty/package.json
diff --git a/apps/server/package.json b/apps/server/package.json
index da35f20da..581eab525 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -32,6 +32,7 @@
"@openstatus/notification-discord": "workspace:*",
"@openstatus/notification-google-chat": "workspace:*",
"@openstatus/notification-grafana-oncall": "workspace:*",
+ "@openstatus/notification-ms-teams": "workspace:*",
"@openstatus/notification-ntfy": "workspace:*",
"@openstatus/notification-opsgenie": "workspace:*",
"@openstatus/notification-pagerduty": "workspace:*",
diff --git a/apps/server/src/routes/rpc/handlers/notification/converters.ts b/apps/server/src/routes/rpc/handlers/notification/converters.ts
index 9ffe3872a..13abc84d3 100644
--- a/apps/server/src/routes/rpc/handlers/notification/converters.ts
+++ b/apps/server/src/routes/rpc/handlers/notification/converters.ts
@@ -35,6 +35,7 @@ export function dbProviderToProto(
email: NotificationProvider.EMAIL,
"google-chat": NotificationProvider.GOOGLE_CHAT,
"grafana-oncall": NotificationProvider.GRAFANA_ONCALL,
+ "ms-teams": NotificationProvider.MS_TEAMS,
ntfy: NotificationProvider.NTFY,
pagerduty: NotificationProvider.PAGERDUTY,
opsgenie: NotificationProvider.OPSGENIE,
@@ -58,6 +59,7 @@ export function getExpectedDataCase(
[NotificationProvider.EMAIL]: "email",
[NotificationProvider.GOOGLE_CHAT]: "googleChat",
[NotificationProvider.GRAFANA_ONCALL]: "grafanaOncall",
+ [NotificationProvider.MS_TEAMS]: "msTeams",
[NotificationProvider.NTFY]: "ntfy",
[NotificationProvider.PAGERDUTY]: "pagerduty",
[NotificationProvider.OPSGENIE]: "opsgenie",
@@ -114,6 +116,7 @@ export function protoProviderToDb(
[NotificationProvider.EMAIL]: "email",
[NotificationProvider.GOOGLE_CHAT]: "google-chat",
[NotificationProvider.GRAFANA_ONCALL]: "grafana-oncall",
+ [NotificationProvider.MS_TEAMS]: "ms-teams",
[NotificationProvider.NTFY]: "ntfy",
[NotificationProvider.PAGERDUTY]: "pagerduty",
[NotificationProvider.OPSGENIE]: "opsgenie",
@@ -193,6 +196,17 @@ export function dbDataToProto(
};
}
break;
+ case "ms-teams":
+ if (data["ms-teams"]) {
+ protoData.data = {
+ case: "msTeams",
+ value: {
+ $typeName: "openstatus.notification.v1.MsTeamsData",
+ webhookUrl: data["ms-teams"].webhookUrl,
+ },
+ };
+ }
+ break;
case "ntfy":
if (data.ntfy) {
protoData.data = {
@@ -329,6 +343,10 @@ export function protoDataToDb(
return JSON.stringify({
"grafana-oncall": { webhookUrl: data.data.value.webhookUrl },
});
+ case "msTeams":
+ return JSON.stringify({
+ "ms-teams": { webhookUrl: data.data.value.webhookUrl },
+ });
case "ntfy":
return JSON.stringify({
ntfy: {
diff --git a/apps/server/src/routes/rpc/handlers/notification/limits.ts b/apps/server/src/routes/rpc/handlers/notification/limits.ts
index f243a143c..b8e052267 100644
--- a/apps/server/src/routes/rpc/handlers/notification/limits.ts
+++ b/apps/server/src/routes/rpc/handlers/notification/limits.ts
@@ -53,6 +53,8 @@ function providerToDisplayName(provider: NotificationProvider): string {
return "Google Chat";
case NotificationProvider.GRAFANA_ONCALL:
return "Grafana OnCall";
+ case NotificationProvider.MS_TEAMS:
+ return "Microsoft Teams";
case NotificationProvider.NTFY:
return "Ntfy";
case NotificationProvider.PAGERDUTY:
diff --git a/apps/server/src/routes/rpc/handlers/notification/test-providers.ts b/apps/server/src/routes/rpc/handlers/notification/test-providers.ts
index e179424ce..76dc24ffd 100644
--- a/apps/server/src/routes/rpc/handlers/notification/test-providers.ts
+++ b/apps/server/src/routes/rpc/handlers/notification/test-providers.ts
@@ -2,6 +2,7 @@ import { sendTest as sendWhatsAppTest } from "@openstatus/notification-bird-what
import { sendTestDiscordMessage } from "@openstatus/notification-discord";
import { sendTest as sendGoogleChatTest } from "@openstatus/notification-google-chat";
import { sendTest as sendGrafanaTest } from "@openstatus/notification-grafana-oncall";
+import { sendTest as sendMsTeamsTest } from "@openstatus/notification-ms-teams";
import { sendTest as sendNtfyTest } from "@openstatus/notification-ntfy";
import { sendTest as sendOpsgenieTest } from "@openstatus/notification-opsgenie";
import { sendTest as sendPagerDutyTest } from "@openstatus/notification-pagerduty";
@@ -73,6 +74,16 @@ export async function sendTestNotification(
return { success: true };
}
+ case NotificationProvider.MS_TEAMS: {
+ if (data.data.case !== "msTeams") {
+ throw invalidNotificationDataError(
+ "Expected ms_teams data for Microsoft Teams provider",
+ );
+ }
+ await sendMsTeamsTest({ webhookUrl: data.data.value.webhookUrl });
+ return { success: true };
+ }
+
case NotificationProvider.DISCORD: {
if (data.data.case !== "discord") {
throw invalidNotificationDataError(
diff --git a/apps/server/static/openapi-v1.json b/apps/server/static/openapi-v1.json
index 2df066609..214148569 100644
--- a/apps/server/static/openapi-v1.json
+++ b/apps/server/static/openapi-v1.json
@@ -967,6 +967,7 @@
"email",
"google-chat",
"grafana-oncall",
+ "ms-teams",
"ntfy",
"pagerduty",
"opsgenie",
@@ -1017,6 +1018,22 @@
},
"required": ["grafana-oncall"]
},
+ {
+ "type": "object",
+ "properties": {
+ "ms-teams": {
+ "type": "object",
+ "properties": {
+ "webhookUrl": {
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "required": ["webhookUrl"]
+ }
+ },
+ "required": ["ms-teams"]
+ },
{
"type": "object",
"properties": {
@@ -7483,6 +7500,22 @@
},
"required": ["grafana-oncall"]
},
+ {
+ "type": "object",
+ "properties": {
+ "ms-teams": {
+ "type": "object",
+ "properties": {
+ "webhookUrl": {
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "required": ["webhookUrl"]
+ }
+ },
+ "required": ["ms-teams"]
+ },
{
"type": "object",
"properties": {
diff --git a/apps/server/static/openapi.yaml b/apps/server/static/openapi.yaml
index ebddda9eb..7214ec429 100644
--- a/apps/server/static/openapi.yaml
+++ b/apps/server/static/openapi.yaml
@@ -1877,6 +1877,19 @@ components:
title: ListNotificationsResponse
additionalProperties: false
description: ListNotificationsResponse is the response containing notification channels.
+ openstatus.notification.v1.MsTeamsData:
+ type: object
+ properties:
+ webhookUrl:
+ type: string
+ examples:
+ - https://prod-00.westeurope.logic.azure.com:443/workflows/abc/triggers/manual/paths/invoke
+ title: webhook_url
+ format: uri
+ description: Microsoft Teams webhook URL (Power Automate Workflows).
+ title: MsTeamsData
+ additionalProperties: false
+ description: MsTeamsData contains configuration for Microsoft Teams notifications.
openstatus.notification.v1.Notification:
type: object
properties:
@@ -1952,6 +1965,15 @@ components:
title: grafana_oncall
required:
- grafanaOncall
+ - type: object
+ properties:
+ msTeams:
+ title: ms_teams
+ description: Microsoft Teams configuration.
+ $ref: '#/components/schemas/openstatus.notification.v1.MsTeamsData'
+ title: ms_teams
+ required:
+ - msTeams
- type: object
properties:
ntfy:
@@ -2044,6 +2066,7 @@ components:
- NOTIFICATION_PROVIDER_TELEGRAM
- NOTIFICATION_PROVIDER_WEBHOOK
- NOTIFICATION_PROVIDER_WHATSAPP
+ - NOTIFICATION_PROVIDER_MS_TEAMS
description: NotificationProvider represents the supported notification channel types.
openstatus.notification.v1.NotificationSummary:
type: object
diff --git a/apps/web/public/assets/changelog/microsoft-teams.png b/apps/web/public/assets/changelog/microsoft-teams.png
new file mode 100644
index 000000000..d958ebff4
Binary files /dev/null and b/apps/web/public/assets/changelog/microsoft-teams.png differ
diff --git a/apps/web/src/content/pages/changelog/microsoft-teams-notifications.mdx b/apps/web/src/content/pages/changelog/microsoft-teams-notifications.mdx
new file mode 100644
index 000000000..ad4e838eb
--- /dev/null
+++ b/apps/web/src/content/pages/changelog/microsoft-teams-notifications.mdx
@@ -0,0 +1,10 @@
+---
+title: "Microsoft Teams Notifications"
+description: "openstatus now supports Microsoft Teams notifications. Receive uptime monitoring alerts as rich Adaptive Cards directly in your Teams channels."
+image: "/assets/changelog/microsoft-teams.png"
+publishedAt: "2026-05-11"
+author: "openstatus"
+category: "notifications"
+---
+
+You can now receive your uptime notifications in Microsoft Teams as rich Adaptive Cards. Set it up via a Power Automate workflow in your channel.
diff --git a/apps/workflows/package.json b/apps/workflows/package.json
index 2a5b86084..271500aa8 100644
--- a/apps/workflows/package.json
+++ b/apps/workflows/package.json
@@ -19,6 +19,7 @@
"@openstatus/notification-emails": "workspace:*",
"@openstatus/notification-google-chat": "workspace:*",
"@openstatus/notification-grafana-oncall": "workspace:*",
+ "@openstatus/notification-ms-teams": "workspace:*",
"@openstatus/notification-ntfy": "workspace:*",
"@openstatus/notification-opsgenie": "workspace:*",
"@openstatus/notification-pagerduty": "workspace:*",
diff --git a/apps/workflows/src/checker/alerting.test.ts b/apps/workflows/src/checker/alerting.test.ts
index 884e6a145..26dc758dc 100644
--- a/apps/workflows/src/checker/alerting.test.ts
+++ b/apps/workflows/src/checker/alerting.test.ts
@@ -61,6 +61,11 @@ mock.module("./utils", () => ({
sendRecovery: mock(),
sendDegraded: mock(),
},
+ "ms-teams": {
+ sendAlert: mock(),
+ sendRecovery: mock(),
+ sendDegraded: mock(),
+ },
whatsapp: { sendAlert: mock(), sendRecovery: mock(), sendDegraded: mock() },
},
}));
diff --git a/apps/workflows/src/checker/utils.ts b/apps/workflows/src/checker/utils.ts
index 09d6c794b..0e33dfe52 100644
--- a/apps/workflows/src/checker/utils.ts
+++ b/apps/workflows/src/checker/utils.ts
@@ -25,6 +25,11 @@ import {
sendDegraded as sendGrafanaOncallDegraded,
sendRecovery as sendGrafanaOncallRecovery,
} from "@openstatus/notification-grafana-oncall";
+import {
+ sendAlert as sendMsTeamsAlert,
+ sendDegraded as sendMsTeamsDegraded,
+ sendRecovery as sendMsTeamsRecovery,
+} from "@openstatus/notification-ms-teams";
import {
sendAlert as sendNtfyAlert,
sendDegraded as sendNtfyDegraded,
@@ -90,6 +95,11 @@ export const providerToFunction: Record<NotificationProvider, Notif> = {
sendRecovery: sendGrafanaOncallRecovery,
sendDegraded: sendGrafanaOncallDegraded,
},
+ "ms-teams": {
+ sendAlert: sendMsTeamsAlert,
+ sendRecovery: sendMsTeamsRecovery,
+ sendDegraded: sendMsTeamsDegraded,
+ },
ntfy: {
sendAlert: sendNtfyAlert,
sendRecovery: sendNtfyRecovery,
diff --git a/packages/api/package.json b/packages/api/package.json
index 02447c5f6..233863f2d 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -18,6 +18,7 @@
"@openstatus/notification-discord": "workspace:*",
"@openstatus/notification-google-chat": "workspace:*",
"@openstatus/notification-grafana-oncall": "workspace:*",
+ "@openstatus/notification-ms-teams": "workspace:*",
"@openstatus/notification-ntfy": "workspace:*",
"@openstatus/notification-opsgenie": "workspace:*",
"@openstatus/notification-pagerduty": "workspace:*",
diff --git a/packages/api/src/router/notification.ts b/packages/api/src/router/notification.ts
index 5d22e0ff2..e097ac05f 100644
--- a/packages/api/src/router/notification.ts
+++ b/packages/api/src/router/notification.ts
@@ -5,6 +5,7 @@ import {
discordDataSchema,
googleChatDataSchema,
grafanaOncallDataSchema,
+ msTeamsDataSchema,
notificationProvider,
ntfyDataSchema,
opsgenieDataSchema,
@@ -29,6 +30,7 @@ import { sendTest as sendWhatsAppTest } from "@openstatus/notification-bird-what
import { sendTestDiscordMessage as sendDiscordTest } from "@openstatus/notification-discord";
import { sendTest as sendGoogleChatTest } from "@openstatus/notification-google-chat";
import { sendTest as sendGrafanaTest } from "@openstatus/notification-grafana-oncall";
+import { sendTest as sendMsTeamsTest } from "@openstatus/notification-ms-teams";
import { sendTest as sendNtfyTest } from "@openstatus/notification-ntfy";
import { sendTest as sendOpsGenieTest } from "@openstatus/notification-opsgenie";
import {
@@ -195,6 +197,20 @@ export const notificationRouter = createTRPCRouter({
await sendGrafanaTest(_data.data["grafana-oncall"]);
return;
}
+ if (opts.input.provider === "ms-teams") {
+ const _data = msTeamsDataSchema.safeParse(opts.input.data);
+ if (!_data.success) {
+ throw new TRPCError({
+ code: "BAD_REQUEST",
+ message: SchemaError.fromZod(_data.error, opts.input).message,
+ });
+ }
+
+ await sendMsTeamsTest({
+ webhookUrl: _data.data["ms-teams"].webhookUrl,
+ });
+ return;
+ }
if (opts.input.provider === "discord") {
const _data = discordDataSchema.safeParse(opts.input.data);
if (!_data.success) {
diff --git a/packages/db/src/schema/notifications/constants.ts b/packages/db/src/schema/notifications/constants.ts
index 8ba9adbff..fe5f64a91 100644
--- a/packages/db/src/schema/notifications/constants.ts
+++ b/packages/db/src/schema/notifications/constants.ts
@@ -3,6 +3,7 @@ export const notificationProvider = [
"email",
"google-chat",
"grafana-oncall",
+ "ms-teams",
"ntfy",
"pagerduty",
"opsgenie",
diff --git a/packages/db/src/schema/notifications/validation.ts b/packages/db/src/schema/notifications/validation.ts
index e051e46b3..063384b0f 100644
--- a/packages/db/src/schema/notifications/validation.ts
+++ b/packages/db/src/schema/notifications/validation.ts
@@ -74,6 +74,12 @@ export const grafanaOncallDataSchema = z.object({
}),
});
+export const msTeamsDataSchema = z.object({
+ "ms-teams": z.object({
+ webhookUrl: safeUrlSchema,
+ }),
+});
+
export const whatsappDataSchema = z.object({
whatsapp: phoneSchema,
});
@@ -82,6 +88,7 @@ export const NotificationDataSchema = z.union([
discordDataSchema,
emailDataSchema,
grafanaOncallDataSchema,
+ msTeamsDataSchema,
ntfyDataSchema,
opsgenieDataSchema,
pagerdutyDataSchema,
@@ -120,6 +127,12 @@ export const InsertNotificationWithDataSchema = z.discriminatedUnion(
data: grafanaOncallDataSchema,
}).shape,
),
+ insertNotificationSchema.extend(
+ z.object({
+ provider: z.literal("ms-teams"),
+ data: msTeamsDataSchema,
+ }).shape,
+ ),
insertNotificationSchema.extend(
z.object({
provider: z.literal("ntfy"),
diff --git a/packages/icons/src/index.tsx b/packages/icons/src/index.tsx
index c23fa28a9..8138a4204 100644
--- a/packages/icons/src/index.tsx
+++ b/packages/icons/src/index.tsx
@@ -11,6 +11,7 @@ export * from "./koyeb";
export * from "./telegram";
export * from "./whatsapp";
export * from "./markdown";
+export * from "./ms-teams";
export * from "./statuspage";
export * from "./betterstack";
export * from "./instatus";
diff --git a/packages/icons/src/ms-teams.tsx b/packages/icons/src/ms-teams.tsx
new file mode 100644
index 000000000..a07c7f483
--- /dev/null
+++ b/packages/icons/src/ms-teams.tsx
@@ -0,0 +1,19 @@
+export function MicrosoftTeamsIcon(props: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ role="img"
+ viewBox="0 0 16 16"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ {...props}
+ >
+ <title>Microsoft Teams</title>
+ <path d="M10.768 4.112A2.114 2.114 0 018.65 6.226a2.114 2.114 0 01-2.116-2.112C6.535 2.946 7.482 2 8.65 2s2.117.946 2.117 2.112zM13.21 6.225c.808 0 1.464-.655 1.464-1.462 0-.808-.655-1.463-1.465-1.463a1.464 1.464 0 100 2.925zM14.381 6.875c.342 0 .619.276.619.617v3.288a2.272 2.272 0 01-2.274 2.27h-.01c-.346 0-.673-.077-.966-.214A3.673 3.673 0 018.488 15a3.669 3.669 0 01-3.581-3.75h1.475V6.875h8z" />
+ <path
+ fillRule="evenodd"
+ d="M7.566 4.925h-5.97A.596.596 0 001 5.521v5.958c0 .33.267.596.597.596h5.969c.33 0 .597-.267.597-.596V5.521a.596.596 0 00-.597-.596zM4.959 7.193h1.193v-.63H3.011v.63h1.188v3.243h.76V7.193z"
+ clipRule="evenodd"
+ />
+ </svg>
+ );
+}
diff --git a/packages/notifications/ms-teams/package.json b/packages/notifications/ms-teams/package.json
new file mode 100644
index 000000000..d31350c44
--- /dev/null
+++ b/packages/notifications/ms-teams/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "@openstatus/notification-ms-teams",
+ "version": "0.0.0",
+ "main": "src/index.ts",
+ "scripts": {
+ "test": "bun test",
+ "tsc": "tsc"
+ },
+ "dependencies": {
+ "@openstatus/db": "workspace:*",
+ "@openstatus/notification-base": "workspace:*",
+ "@openstatus/utils": "workspace:*",
+ "zod": "4.1.13"
+ },
+ "devDependencies": {
+ "@openstatus/tsconfig": "workspace:*",
+ "@types/node": "24.0.8",
+ "bun-types": "1.3.1",
+ "typescript": "5.9.3"
+ }
+}
diff --git a/packages/notifications/ms-teams/src/card.ts b/packages/notifications/ms-teams/src/card.ts
new file mode 100644
index 000000000..a9e1d26eb
--- /dev/null
+++ b/packages/notifications/ms-teams/src/card.ts
@@ -0,0 +1,279 @@
+import type { FormattedMessageData } from "@openstatus/notification-base";
+
+type AdaptiveCardContainerStyle = "attention" | "warning" | "good";
+type AdaptiveCardTextColor =
+ | "Default"
+ | "Dark"
+ | "Light"
+ | "Accent"
+ | "Good"
+ | "Warning"
+ | "Attention";
+
+type AdaptiveCardTextBlock = {
+ type: "TextBlock";
+ text: string;
+ weight?: "Default" | "Lighter" | "Bolder";
+ size?: "Default" | "Small" | "Medium" | "Large" | "ExtraLarge";
+ color?: AdaptiveCardTextColor;
+ isSubtle?: boolean;
+ fontType?: "Default" | "Monospace";
+ spacing?: "None" | "Small" | "Default" | "Medium" | "Large";
+ horizontalAlignment?: "Left" | "Center" | "Right";
+ wrap?: boolean;
+};
+
+type AdaptiveCardFact = { title: string; value: string };
+
+type AdaptiveCardFactSet = {
+ type: "FactSet";
+ facts: AdaptiveCardFact[];
+};
+
+type AdaptiveCardContainer = {
+ type: "Container";
+ style?: AdaptiveCardContainerStyle;
+ items: AdaptiveCardBodyElement[];
+};
+
+type AdaptiveCardBodyElement =
+ | AdaptiveCardTextBlock
+ | AdaptiveCardFactSet
+ | AdaptiveCardContainer;
+
+type AdaptiveCardOpenUrlAction = {
+ type: "Action.OpenUrl";
+ title: string;
+ url: string;
+};
+
+export type AdaptiveCard = {
+ type: "AdaptiveCard";
+ $schema: "https://adaptivecards.io/schemas/adaptive-card.json";
+ version: "1.5";
+ body: AdaptiveCardBodyElement[];
+ actions: AdaptiveCardOpenUrlAction[];
+};
+
+const SCHEMA_URL = "https://adaptivecards.io/schemas/adaptive-card.json";
+const CARD_VERSION = "1.5";
+const FOOTER_TEXT = "openstatus";
+
+function buildUrlText(data: FormattedMessageData): string {
+ if (data.monitorMethod && data.monitorJobType === "http") {
+ return `${data.monitorMethod} ${data.monitorUrl}`;
+ }
+ return data.monitorUrl;
+}
+
+function buildHeader(
+ data: FormattedMessageData,
+ style: AdaptiveCardContainerStyle,
+ titleColor: AdaptiveCardTextColor,
+ title: string,
+): AdaptiveCardContainer {
+ return {
+ type: "Container",
+ style,
+ items: [
+ {
+ type: "TextBlock",
+ text: title,
+ weight: "Bolder",
+ size: "Large",
+ color: titleColor,
+ wrap: true,
+ },
+ {
+ type: "TextBlock",
+ text: buildUrlText(data),
+ fontType: "Monospace",
+ spacing: "None",
+ isSubtle: true,
+ wrap: true,
+ },
+ ],
+ };
+}
+
+function buildFactSet(data: FormattedMessageData): AdaptiveCardFactSet {
+ return {
+ type: "FactSet",
+ facts: [
+ { title: "Status code", value: data.statusCodeFormatted },
+ { title: "Regions", value: data.regionsDisplay },
+ { title: "Latency", value: data.latencyDisplay },
+ { title: "Timestamp", value: data.timestampFormatted },
+ ],
+ };
+}
+
+function buildFooter(): AdaptiveCardTextBlock {
+ return {
+ type: "TextBlock",
+ text: FOOTER_TEXT,
+ size: "Small",
+ isSubtle: true,
+ horizontalAlignment: "Right",
+ wrap: false,
+ };
+}
+
+function buildIncidentDurationBlock(
+ label: string,
+ duration: string,
+): AdaptiveCardTextBlock {
+ return {
+ type: "TextBlock",
+ text: `**${label}:** ${duration}`,
+ wrap: true,
+ spacing: "Medium",
+ };
+}
+
+export function buildAlertCard(data: FormattedMessageData): AdaptiveCard {
+ const body: AdaptiveCardBodyElement[] = [
+ buildHeader(
+ data,
+ "attention",
+ "Attention",
+ `${data.monitorName} is failing`,
+ ),
+ buildFactSet(data),
+ {
+ type: "Container",
+ items: [
+ { type: "TextBlock", text: "**Error message**", wrap: true },
+ {
+ type: "TextBlock",
+ text: data.errorMessage,
+ fontType: "Monospace",
+ wrap: true,
+ },
+ ],
+ },
+ buildFooter(),
+ ];
+
+ return {
+ type: "AdaptiveCard",
+ $schema: SCHEMA_URL,
+ version: CARD_VERSION,
+ body,
+ actions: [
+ {
+ type: "Action.OpenUrl",
+ title: "View dashboard",
+ url: data.dashboardUrl,
+ },
+ ],
+ };
+}
+
+export function buildRecoveryCard(data: FormattedMessageData): AdaptiveCard {
+ const body: AdaptiveCardBodyElement[] = [
+ buildHeader(data, "good", "Good", `${data.monitorName} is recovered`),
+ ];
+
+ if (data.incidentDuration) {
+ body.push(buildIncidentDurationBlock("Downtime", data.incidentDuration));
+ }
+
+ body.push(buildFactSet(data), buildFooter());
+
+ return {
+ type: "AdaptiveCard",
+ $schema: SCHEMA_URL,
+ version: CARD_VERSION,
+ body,
+ actions: [
+ {
+ type: "Action.OpenUrl",
+ title: "View dashboard",
+ url: data.dashboardUrl,
+ },
+ ],
+ };
+}
+
+export function buildDegradedCard(data: FormattedMessageData): AdaptiveCard {
+ const body: AdaptiveCardBodyElement[] = [
+ buildHeader(data, "warning", "Warning", `${data.monitorName} is degraded`),
+ ];
+
+ if (data.incidentDuration) {
+ body.push(
+ buildIncidentDurationBlock(
+ "Previous incident duration",
+ data.incidentDuration,
+ ),
+ );
+ }
+
+ body.push(buildFactSet(data), buildFooter());
+
+ return {
+ type: "AdaptiveCard",
+ $schema: SCHEMA_URL,
+ version: CARD_VERSION,
+ body,
+ actions: [
+ {
+ type: "Action.OpenUrl",
+ title: "View dashboard",
+ url: data.dashboardUrl,
+ },
+ ],
+ };
+}
+
+export function buildTestCard(): AdaptiveCard {
+ return {
+ type: "AdaptiveCard",
+ $schema: SCHEMA_URL,
+ version: CARD_VERSION,
+ body: [
+ {
+ type: "Container",
+ style: "good",
+ items: [
+ {
+ type: "TextBlock",
+ text: "Test notification",
+ weight: "Bolder",
+ size: "Large",
+ color: "Good",
+ wrap: true,
+ },
+ {
+ type: "TextBlock",
+ text: "Your Microsoft Teams webhook is configured correctly.",
+ spacing: "None",
+ isSubtle: true,
+ wrap: true,
+ },
+ ],
+ },
+ {
+ type: "FactSet",
+ facts: [
+ { title: "Status", value: "Webhook Connected" },
+ { title: "Type", value: "Test Notification" },
+ ],
+ },
+ {
+ type: "TextBlock",
+ text: "You will receive notifications here when your monitors trigger fail, recover, or degrade.",
+ wrap: true,
+ },
+ buildFooter(),
+ ],
+ actions: [
+ {
+ type: "Action.OpenUrl",
+ title: "View dashboard",
+ url: "https://app.openstatus.dev",
+ },
+ ],
+ };
+}
diff --git a/packages/notifications/ms-teams/src/index.test.ts b/packages/notifications/ms-teams/src/index.test.ts
new file mode 100644
index 000000000..ca080ed95
--- /dev/null
+++ b/packages/notifications/ms-teams/src/index.test.ts
@@ -0,0 +1,338 @@
+import { afterEach, beforeEach, describe, expect, spyOn, test } from "bun:test";
+import type { Incident, Monitor } from "@openstatus/db/src/schema";
+import { selectNotificationSchema } from "@openstatus/db/src/schema";
+import { sendAlert, sendDegraded, sendRecovery, sendTest } from "./index";
+
+type FetchMock = ReturnType<typeof spyOn<typeof globalThis, "fetch">>;
+
+type AdaptiveCardElement = {
+ type: string;
+ text?: string;
+ color?: string;
+ style?: string;
+ items?: AdaptiveCardElement[];
+ facts?: Array<{ title: string; value: string }>;
+};
+
+type AdaptiveCardAction = {
+ type: string;
+ title: string;
+ url: string;
+};
+
+type AdaptiveCardPayload = {
+ type: string;
+ version: string;
+ body: AdaptiveCardElement[];
+ actions: AdaptiveCardAction[];
+};
+
+type MessagePayload = {
+ type: string;
+ attachments: Array<{
+ contentType: string;
+ content: AdaptiveCardPayload;
+ }>;
+};
+
+describe("Microsoft Teams Notifications", () => {
+ let fetchMock: FetchMock;
+
+ beforeEach(() => {
+ // @ts-expect-error spyOn typing requires the full `typeof fetch` (incl. preconnect)
+ fetchMock = spyOn(globalThis, "fetch").mockImplementation(() =>
+ Promise.resolve(new Response(null, { status: 200 })),
+ );
+ });
+
+ afterEach(() => {
+ fetchMock.mockRestore();
+ });
+
+ const createMockMonitor = (): Monitor => ({
+ id: 1,
+ name: "API Health Check",
+ url: "https://api.example.com/health",
+ jobType: "http",
+ periodicity: "5m",
+ status: "active",
+ active: true,
+ public: true,
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ regions: ["iad"],
+ description: "",
+ headers: [],
+ body: "",
+ workspaceId: 1,
+ timeout: 45000,
+ degradedAfter: null,
+ assertions: null,
+ method: "GET",
+ deletedAt: null,
+ externalName: null,
+ otelEndpoint: null,
+ otelHeaders: [],
+ retry: 3,
+ followRedirects: false,
+ });
+
+ const createMockNotification = () => ({
+ id: 1,
+ name: "Microsoft Teams Notification",
+ provider: "ms-teams" as const,
+ workspaceId: 1,
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ data: JSON.stringify({
+ "ms-teams": {
+ webhookUrl:
+ "https://prod-00.westeurope.logic.azure.com:443/workflows/test/triggers/manual/paths/invoke",
+ },
+ }),
+ });
+
+ const createMockResolvedIncident = (): Incident => ({
+ id: 1,
+ title: "",
+ summary: "",
+ status: "resolved",
+ monitorId: 1,
+ workspaceId: 1,
+ startedAt: new Date("2026-01-22T10:00:00.000Z"),
+ acknowledgedAt: null,
+ acknowledgedBy: null,
+ resolvedAt: new Date("2026-01-22T12:15:30.000Z"),
+ resolvedBy: null,
+ incidentScreenshotUrl: null,
+ recoveryScreenshotUrl: null,
+ autoResolved: true,
+ createdAt: new Date("2026-01-22T10:00:00.000Z"),
+ updatedAt: new Date("2026-01-22T12:15:30.000Z"),
+ });
+
+ const readMessagePayload = (): MessagePayload => {
+ const calls = fetchMock.mock.calls;
+ const init = calls[0][1];
+ if (!init || typeof init.body !== "string") {
+ throw new Error("expected string body");
+ }
+ return JSON.parse(init.body) as MessagePayload;
+ };
+
+ const getCard = (msg: MessagePayload): AdaptiveCardPayload => {
+ return msg.attachments[0].content;
+ };
+
+ const findContainerByStyle = (
+ card: AdaptiveCardPayload,
+ style: string,
+ ): AdaptiveCardElement | undefined => {
+ return card.body.find(
+ (el) => el.type === "Container" && el.style === style,
+ );
+ };
+
+ const findFactSet = (
+ card: AdaptiveCardPayload,
+ ): AdaptiveCardElement | undefined => {
+ return card.body.find((el) => el.type === "FactSet");
+ };
+
+ const findTextBlockContaining = (
+ card: AdaptiveCardPayload,
+ needle: string,
+ ): AdaptiveCardElement | undefined => {
+ return card.body.find(
+ (el) =>
+ el.type === "TextBlock" &&
+ typeof el.text === "string" &&
+ el.text.includes(needle),
+ );
+ };
+
+ test("Send Alert", async () => {
+ const monitor = createMockMonitor();
+ const notification = selectNotificationSchema.parse(
+ createMockNotification(),
+ );
+
+ await sendAlert({
+ monitor,
+ notification,
+ statusCode: 500,
+ message: "Something went wrong",
+ cronTimestamp: Date.now(),
+ latency: 1500,
+ regions: ["iad"],
+ });
+
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ const [url, init] = fetchMock.mock.calls[0];
+ expect(String(url)).toContain("logic.azure.com");
+ expect(init?.method).toBe("POST");
+
+ const msg = readMessagePayload();
+ expect(msg.type).toBe("message");
+ expect(msg.attachments[0].contentType).toBe(
+ "application/vnd.microsoft.card.adaptive",
+ );
+
+ const card = getCard(msg);
+ expect(card.type).toBe("AdaptiveCard");
+ expect(card.version).toBe("1.5");
+
+ const header = findContainerByStyle(card, "attention");
+ expect(header).toBeDefined();
+ const title = header?.items?.[0];
+ expect(title?.text).toContain("API Health Check");
+ expect(title?.text).toContain("is failing");
+ expect(title?.color).toBe("Attention");
+
+ const factSet = findFactSet(card);
+ expect(factSet?.facts).toHaveLength(4);
+ expect(factSet?.facts?.[0]).toEqual({
+ title: "Status code",
+ value: "500 Internal Server Error",
+ });
+
+ const action = card.actions[0];
+ expect(action.type).toBe("Action.OpenUrl");
+ expect(action.title).toBe("View dashboard");
+ expect(action.url).toBe("https://app.openstatus.dev/monitors/1");
+ });
+
+ test("Send Recovery (no incident)", async () => {
+ const monitor = createMockMonitor();
+ const notification = selectNotificationSchema.parse(
+ createMockNotification(),
+ );
+
+ await sendRecovery({
+ monitor,
+ notification,
+ statusCode: 200,
+ cronTimestamp: Date.now(),
+ latency: 150,
+ regions: ["iad"],
+ });
+
+ const card = getCard(readMessagePayload());
+ const header = findContainerByStyle(card, "good");
+ expect(header).toBeDefined();
+ expect(header?.items?.[0]?.text).toContain("is recovered");
+ expect(findTextBlockContaining(card, "Downtime:")).toBeUndefined();
+ });
+
+ test("Send Recovery (with resolved incident)", async () => {
+ const monitor = createMockMonitor();
+ const notification = selectNotificationSchema.parse(
+ createMockNotification(),
+ );
+
+ await sendRecovery({
+ monitor,
+ notification,
+ statusCode: 200,
+ cronTimestamp: Date.now(),
+ latency: 150,
+ regions: ["iad"],
+ incident: createMockResolvedIncident(),
+ });
+
+ const card = getCard(readMessagePayload());
+ const downtime = findTextBlockContaining(card, "Downtime:");
+ expect(downtime).toBeDefined();
+ expect(downtime?.text).toContain("2h 15m 30s");
+ });
+
+ test("Send Degraded (no incident)", async () => {
+ const monitor = createMockMonitor();
+ const notification = selectNotificationSchema.parse(
+ createMockNotification(),
+ );
+
+ await sendDegraded({
+ monitor,
+ notification,
+ statusCode: 504,
+ message: "slow",
+ cronTimestamp: Date.now(),
+ latency: 5234,
+ regions: ["iad"],
+ });
+
+ const card = getCard(readMessagePayload());
+ const header = findContainerByStyle(card, "warning");
+ expect(header).toBeDefined();
+ expect(header?.items?.[0]?.text).toContain("is degraded");
+ expect(
+ findTextBlockContaining(card, "Previous incident duration:"),
+ ).toBeUndefined();
+ });
+
+ test("Send Degraded (with incident)", async () => {
+ const monitor = createMockMonitor();
+ const notification = selectNotificationSchema.parse(
+ createMockNotification(),
+ );
+
+ await sendDegraded({
+ monitor,
+ notification,
+ statusCode: 504,
+ message: "slow",
+ cronTimestamp: Date.now(),
+ latency: 5234,
+ regions: ["iad"],
+ incident: createMockResolvedIncident(),
+ });
+
+ const card = getCard(readMessagePayload());
+ const block = findTextBlockContaining(card, "Previous incident duration:");
+ expect(block).toBeDefined();
+ expect(block?.text).toContain("2h 15m 30s");
+ });
+
+ test("Send Test", async () => {
+ await sendTest({
+ webhookUrl:
+ "https://prod-00.westeurope.logic.azure.com:443/workflows/test/triggers/manual/paths/invoke",
+ });
+
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ const card = getCard(readMessagePayload());
+ const header = findContainerByStyle(card, "good");
+ expect(header?.items?.[0]?.text).toBe("Test notification");
+ expect(card.actions[0].url).toBe("https://app.openstatus.dev");
+ });
+
+ test("Send Test with empty webhookUrl", async () => {
+ await expect(sendTest({ webhookUrl: "" })).rejects.toThrow();
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+
+ test("Handle fetch error", async () => {
+ // @ts-expect-error see beforeEach
+ fetchMock.mockImplementation(() =>
+ Promise.reject(new Error("Network error")),
+ );
+
+ const monitor = createMockMonitor();
+ const notification = selectNotificationSchema.parse(
+ createMockNotification(),
+ );
+
+ await expect(
+ sendAlert({
+ monitor,
+ notification,
+ statusCode: 500,
+ message: "boom",
+ cronTimestamp: Date.now(),
+ latency: 1000,
+ regions: ["iad"],
+ }),
+ ).rejects.toThrow();
+ });
+});
diff --git a/packages/notifications/ms-teams/src/index.ts b/packages/notifications/ms-teams/src/index.ts
new file mode 100644
index 000000000..e1cfeaa0d
--- /dev/null
+++ b/packages/notifications/ms-teams/src/index.ts
@@ -0,0 +1,71 @@
+import { msTeamsDataSchema } from "@openstatus/db/src/schema";
+import {
+ type NotificationContext,
+ buildCommonMessageData,
+} from "@openstatus/notification-base";
+import { assertSafeUrl } from "@openstatus/utils";
+import {
+ type AdaptiveCard,
+ buildAlertCard,
+ buildDegradedCard,
+ buildRecoveryCard,
+ buildTestCard,
+} from "./card";
+
+const postCard = async (
+ card: AdaptiveCard,
+ webhookUrl: string,
+): Promise<void> => {
+ if (!webhookUrl || webhookUrl.trim() === "") {
+ throw new Error("Microsoft Teams webhook URL is required");
+ }
+
+ await assertSafeUrl(webhookUrl);
+
+ const res = await fetch(webhookUrl, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ type: "message",
+ attachments: [
+ {
+ contentType: "application/vnd.microsoft.card.adaptive",
+ contentUrl: null,
+ content: card,
+ },
+ ],
+ }),
+ });
+
+ if (!res.ok) {
+ throw new Error(
+ `Failed to send Microsoft Teams notification: ${res.status} ${res.statusText}`,
+ );
+ }
+};
+
+export const sendAlert = async (ctx: NotificationContext): Promise<void> => {
+ const config = msTeamsDataSchema.parse(JSON.parse(ctx.notification.data));
+ const data = buildCommonMessageData(ctx);
+ await postCard(buildAlertCard(data), config["ms-teams"].webhookUrl);
+};
+
+export const sendRecovery = async (ctx: NotificationContext): Promise<void> => {
+ const config = msTeamsDataSchema.parse(JSON.parse(ctx.notification.data));
+ const data = buildCommonMessageData(ctx, { incident: ctx.incident });
+ await postCard(buildRecoveryCard(data), config["ms-teams"].webhookUrl);
+};
+
+export const sendDegraded = async (ctx: NotificationContext): Promise<void> => {
+ const config = msTeamsDataSchema.parse(JSON.parse(ctx.notification.data));
+ const data = buildCommonMessageData(ctx, { incident: ctx.incident });
+ await postCard(buildDegradedCard(data), config["ms-teams"].webhookUrl);
+};
+
+export const sendTest = async ({
+ webhookUrl,
+}: {
+ webhookUrl: string;
+}): Promise<void> => {
+ await postCard(buildTestCard(), webhookUrl);
+};
diff --git a/packages/notifications/ms-teams/src/mock.ts b/packages/notifications/ms-teams/src/mock.ts
new file mode 100644
index 000000000..6ed50cc3a
--- /dev/null
+++ b/packages/notifications/ms-teams/src/mock.ts
@@ -0,0 +1,94 @@
+import type { Monitor, Notification } from "@openstatus/db/src/schema";
+import { sendAlert, sendDegraded, sendRecovery, sendTest } from "./index";
+
+function requireWebhookUrl(): string {
+ const url = process.env.MS_TEAMS_WEBHOOK;
+ if (!url) {
+ throw new Error("MS_TEAMS_WEBHOOK env var is required");
+ }
+ return url;
+}
+
+const webhookUrl = requireWebhookUrl();
+
+const monitor: Monitor = {
+ id: 1,
+ name: "OpenStatus Docs",
+ url: "https://docs.openstatus.dev",
+ periodicity: "10m",
+ jobType: "http",
+ active: true,
+ public: true,
+ createdAt: null,
+ updatedAt: null,
+ regions: ["ams", "fra"],
+ description: "Monitor Description",
+ headers: [],
+ body: "",
+ workspaceId: 1,
+ timeout: 45000,
+ degradedAfter: null,
+ assertions: null,
+ status: "active",
+ method: "GET",
+ deletedAt: null,
+ externalName: null,
+ otelEndpoint: null,
+ otelHeaders: [],
+ retry: 3,
+ followRedirects: false,
+};
+
+const notification: Notification = {
+ id: 1,
+ name: "Microsoft Teams",
+ data: JSON.stringify({ "ms-teams": { webhookUrl } }),
+ provider: "ms-teams",
+ workspaceId: 1,
+ createdAt: null,
+ updatedAt: null,
+};
+
+async function main() {
+ console.log("Sending alert...");
+ await sendAlert({
+ monitor,
+ notification,
+ statusCode: 503,
+ message: "Connection timeout",
+ cronTimestamp: Date.now(),
+ latency: 2450,
+ regions: ["ams"],
+ });
+
+ console.log("Sending degraded...");
+ await sendDegraded({
+ monitor,
+ notification,
+ statusCode: 504,
+ message: "Slow response",
+ cronTimestamp: Date.now(),
+ latency: 5234,
+ regions: ["ams"],
+ });
+
+ console.log("Sending recovery...");
+ await sendRecovery({
+ monitor,
+ notification,
+ statusCode: 200,
+ cronTimestamp: Date.now(),
+ latency: 156,
+ regions: ["ams"],
+ });
+
+ console.log("Sending test...");
+ await sendTest({ webhookUrl });
+
+ console.log("Done.");
+}
+
+main().catch((err) => {
+ console.error(err);
+ process.exit(1);
+});
diff --git a/packages/notifications/ms-teams/tsconfig.json b/packages/notifications/ms-teams/tsconfig.json
new file mode 100644
index 000000000..b4382e67e
--- /dev/null
+++ b/packages/notifications/ms-teams/tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "extends": "@openstatus/tsconfig/nextjs.json",
+ "include": ["src", "*.ts"],
+ "compilerOptions": {
+ "types": ["bun-types"]
+ }
+}
diff --git a/packages/proto/api/openstatus/notification/v1/providers.proto b/packages/proto/api/openstatus/notification/v1/providers.proto
index a81d2a87f..7e68031ea 100644
--- a/packages/proto/api/openstatus/notification/v1/providers.proto
+++ b/packages/proto/api/openstatus/notification/v1/providers.proto
@@ -35,6 +35,8 @@ enum NotificationProvider {
NOTIFICATION_PROVIDER_WEBHOOK = 11;
// WhatsApp notification.
NOTIFICATION_PROVIDER_WHATSAPP = 12;
+ // Microsoft Teams notification.
+ NOTIFICATION_PROVIDER_MS_TEAMS = 13;
}
// DiscordData contains configuration for Discord notifications.
@@ -159,6 +161,15 @@ message WhatsappData {
string phone_number = 1 [(buf.validate.field).string.min_len = 1];
}
+// MsTeamsData contains configuration for Microsoft Teams notifications.
+message MsTeamsData {
+ // Microsoft Teams webhook URL (Power Automate Workflows).
+ string webhook_url = 1 [
+ (buf.validate.field).string.uri = true,
+ (gnostic.openapi.v3.property) = {example: {yaml: "https://prod-00.westeurope.logic.azure.com:443/workflows/abc/triggers/manual/paths/invoke"}}
+ ];
+}
+
// NotificationData is a union of provider-specific configuration.
message NotificationData {
oneof data {
@@ -186,5 +197,7 @@ message NotificationData {
WebhookData webhook = 11;
// WhatsApp configuration.
WhatsappData whatsapp = 12;
+ // Microsoft Teams configuration.
+ MsTeamsData ms_teams = 13;
}
}
diff --git a/packages/proto/gen/openapi.yaml b/packages/proto/gen/openapi.yaml
index ebddda9eb..7214ec429 100644
--- a/packages/proto/gen/openapi.yaml
+++ b/packages/proto/gen/openapi.yaml
@@ -1877,6 +1877,19 @@ components:
title: ListNotificationsResponse
additionalProperties: false
description: ListNotificationsResponse is the response containing notification channels.
+ openstatus.notification.v1.MsTeamsData:
+ type: object
+ properties:
+ webhookUrl:
+ type: string
+ examples:
+ - https://prod-00.westeurope.logic.azure.com:443/workflows/abc/triggers/manual/paths/invoke
+ title: webhook_url
+ format: uri
+ description: Microsoft Teams webhook URL (Power Automate Workflows).
+ title: MsTeamsData
+ additionalProperties: false
+ description: MsTeamsData contains configuration for Microsoft Teams notifications.
openstatus.notification.v1.Notification:
type: object
properties:
@@ -1952,6 +1965,15 @@ components:
title: grafana_oncall
required:
- grafanaOncall
+ - type: object
+ properties:
+ msTeams:
+ title: ms_teams
+ description: Microsoft Teams configuration.
+ $ref: '#/components/schemas/openstatus.notification.v1.MsTeamsData'
+ title: ms_teams
+ required:
+ - msTeams
- type: object
properties:
ntfy:
@@ -2044,6 +2066,7 @@ components:
- NOTIFICATION_PROVIDER_TELEGRAM
- NOTIFICATION_PROVIDER_WEBHOOK
- NOTIFICATION_PROVIDER_WHATSAPP
+ - NOTIFICATION_PROVIDER_MS_TEAMS
description: NotificationProvider represents the supported notification channel types.
openstatus.notification.v1.NotificationSummary:
type: object
diff --git a/packages/proto/gen/ts/openstatus/notification/v1/providers_pb.ts b/packages/proto/gen/ts/openstatus/notification/v1/providers_pb.ts
index b415085eb..2e4795a70 100644
--- a/packages/proto/gen/ts/openstatus/notification/v1/providers_pb.ts
+++ b/packages/proto/gen/ts/openstatus/notification/v1/providers_pb.ts
@@ -12,7 +12,7 @@ import type { Message } from "@bufbuild/protobuf";
* Describes the file openstatus/notification/v1/providers.proto.
*/
export const file_openstatus_notification_v1_providers: GenFile = /*@__PURE__*/
- fileDesc("CipvcGVuc3RhdHVzL25vdGlmaWNhdGlvbi92MS9wcm92aWRlcnMucHJvdG8SGm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxIlsKC0Rpc2NvcmREYXRhEkwKC3dlYmhvb2tfdXJsGAEgASgJQje6Ryw6KhIoaHR0cHM6Ly9kaXNjb3JkLmNvbS9hcGkvd2ViaG9va3MvMTIzL2FiY7pIBXIDiAEBIj4KCUVtYWlsRGF0YRIxCgVlbWFpbBgBIAEoCUIiukcYOhYSFG9wcy10ZWF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dHNhcHBEYXRhSABCBgoEZGF0YSrmAwoUTm90aWZpY2F0aW9uUHJvdmlkZXISJQohTk9USUZJQ0FUSU9OX1BST1ZJREVSX1VOU1BFQ0lGSUVEEAASIQodTk9USUZJQ0FUSU9OX1BST1ZJREVSX0RJU0NPUkQQARIfChtOT1RJRklDQVRJT05fUFJPVklERVJfRU1BSUwQAhIlCiFOT1RJRklDQVRJT05fUFJPVklERVJfR09PR0xFX0NIQVQQAxIoCiROT1RJRklDQVRJT05fUFJPVklERVJfR1JBRkFOQV9PTkNBTEwQBBIeChpOT1RJRklDQVRJT05fUFJPVklERVJfTlRGWRAFEiMKH05PVElGSUNBVElPTl9QUk9WSURFUl9QQUdFUkRVVFkQBhIiCh5OT1RJRklDQVRJT05fUFJPVklERVJfT1BTR0VOSUUQBxIfChtOT1RJRklDQVRJT05fUFJPVklERVJfU0xBQ0sQCBIdChlOT1RJRklDQVRJT05fUFJPVklERVJfU01TEAkSIgoeTk9USUZJQ0FUSU9OX1BST1ZJREVSX1RFTEVHUkFNEAoSIQodTk9USUZJQ0FUSU9OX1BST1ZJREVSX1dFQkhPT0sQCxIiCh5OT1RJRklDQVRJT05fUFJPVklERVJfV0hBVFNBUFAQDCphCg5PcHNnZW5pZVJlZ2lvbhIfChtPUFNHRU5JRV9SRUdJT05fVU5TUEVDSUZJRUQQABIWChJPUFNHRU5JRV9SRUdJT05fVVMQARIWChJPUFNHRU5JRV9SRUdJT05fRVUQAkJdWltnaXRodWIuY29tL29wZW5zdGF0dXNocS9vcGVuc3RhdHVzL3BhY2thZ2VzL3Byb3RvL29wZW5zdGF0dXMvbm90aWZpY2F0aW9uL3YxO25vdGlmaWNhdGlvbnYxYgZwcm90bzM", [file_buf_validate_validate, file_gnostic_openapi_v3_annotations]);
+ fileDesc("CipvcGVuc3RhdHVzL25vdGlmaWNhdGlvbi92MS9wcm92aWRlcnMucHJvdG8SGm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxIlsKC0Rpc2NvcmREY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VklERVJfV0hBVFNBUFAQDBIiCh5OT1RJRklDQVRJT05fUFJPVklERVJfTVNfVEVBTVMQDSphCg5PcHNnZW5pZVJlZ2lvbhIfChtPUFNHRU5JRV9SRUdJT05fVU5TUEVDSUZJRUQQABIWChJPUFNHRU5JRV9SRUdJT05fVVMQARIWChJPUFNHRU5JRV9SRUdJT05fRVUQAkJdWltnaXRodWIuY29tL29wZW5zdGF0dXNocS9vcGVuc3RhdHVzL3BhY2thZ2VzL3Byb3RvL29wZW5zdGF0dXMvbm90aWZpY2F0aW9uL3YxO25vdGlmaWNhdGlvbnYxYgZwcm90bzM", [file_buf_validate_validate, file_gnostic_openapi_v3_annotations]);
/**
* DiscordData contains configuration for Discord notifications.
@@ -322,6 +322,27 @@ export type WhatsappData = Message<"openstatus.notification.v1.WhatsappData"> &
export const WhatsappDataSchema: GenMessage<WhatsappData> = /*@__PURE__*/
messageDesc(file_openstatus_notification_v1_providers, 12);
+/**
+ * MsTeamsData contains configuration for Microsoft Teams notifications.
+ *
+ * @generated from message openstatus.notification.v1.MsTeamsData
+ */
+export type MsTeamsData = Message<"openstatus.notification.v1.MsTeamsData"> & {
+ /**
+ * Microsoft Teams webhook URL (Power Automate Workflows).
+ *
+ * @generated from field: string webhook_url = 1;
+ */
+ webhookUrl: string;
+};
+
+/**
+ * Describes the message openstatus.notification.v1.MsTeamsData.
+ * Use `create(MsTeamsDataSchema)` to create a new message.
+ */
+export const MsTeamsDataSchema: GenMessage<MsTeamsData> = /*@__PURE__*/
+ messageDesc(file_openstatus_notification_v1_providers, 13);
+
/**
* NotificationData is a union of provider-specific configuration.
*
@@ -427,6 +448,14 @@ export type NotificationData = Message<"openstatus.notification.v1.NotificationD
*/
value: WhatsappData;
case: "whatsapp";
+ } | {
+ /**
+ * Microsoft Teams configuration.
+ *
+ * @generated from field: openstatus.notification.v1.MsTeamsData ms_teams = 13;
+ */
+ value: MsTeamsData;
+ case: "msTeams";
} | { case: undefined; value?: undefined };
};
@@ -435,7 +464,7 @@ export type NotificationData = Message<"openstatus.notification.v1.NotificationD
* Use `create(NotificationDataSchema)` to create a new message.
*/
export const NotificationDataSchema: GenMessage<NotificationData> = /*@__PURE__*/
- messageDesc(file_openstatus_notification_v1_providers, 13);
+ messageDesc(file_openstatus_notification_v1_providers, 14);
/**
* NotificationProvider represents the supported notification channel types.
@@ -533,6 +562,13 @@ export enum NotificationProvider {
* @generated from enum value: NOTIFICATION_PROVIDER_WHATSAPP = 12;
*/
WHATSAPP = 12,
+
+ /**
+ * Microsoft Teams notification.
+ *
+ * @generated from enum value: NOTIFICATION_PROVIDER_MS_TEAMS = 13;
+ */
+ MS_TEAMS = 13,
}
/**
diff --git a/packages/services/src/notification/internal.ts b/packages/services/src/notification/internal.ts
index 8b27d3e75..8705c6e77 100644
--- a/packages/services/src/notification/internal.ts
+++ b/packages/services/src/notification/internal.ts
@@ -6,6 +6,7 @@ import {
emailDataSchema,
googleChatDataSchema,
grafanaOncallDataSchema,
+ msTeamsDataSchema,
ntfyDataSchema,
opsgenieDataSchema,
pagerdutyDataSchema,
@@ -116,6 +117,7 @@ const providerDataSchemas = {
email: emailDataSchema,
"google-chat": googleChatDataSchema,
"grafana-oncall": grafanaOncallDataSchema,
+ "ms-teams": msTeamsDataSchema,
ntfy: ntfyDataSchema,
opsgenie: opsgenieDataSchema,
pagerduty: pagerdutyDataSchema,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f4e115332..3d3adbd3f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -497,6 +497,9 @@ importers:
'@openstatus/notification-grafana-oncall':
specifier: workspace:*
version: link:../../packages/notifications/grafana-oncall
+ '@openstatus/notification-ms-teams':
+ specifier: workspace:*
+ version: link:../../packages/notifications/ms-teams
'@openstatus/notification-ntfy':
specifier: workspace:*
version: link:../../packages/notifications/ntfy
@@ -1154,6 +1157,9 @@ importers:
'@openstatus/notification-grafana-oncall':
specifier: workspace:*
version: link:../../packages/notifications/grafana-oncall
+ '@openstatus/notification-ms-teams':
+ specifier: workspace:*
+ version: link:../../packages/notifications/ms-teams
'@openstatus/notification-ntfy':
specifier: workspace:*
version: link:../../packages/notifications/ntfy
@@ -1273,6 +1279,9 @@ importers:
'@openstatus/notification-grafana-oncall':
specifier: workspace:*
version: link:../notifications/grafana-oncall
+ '@openstatus/notification-ms-teams':
+ specifier: workspace:*
+ version: link:../notifications/ms-teams
'@openstatus/notification-ntfy':
specifier: workspace:*
version: link:../notifications/ntfy
@@ -1741,6 +1750,34 @@ importers:
specifier: 5.9.3
version: 5.9.3
+ packages/notifications/ms-teams:
+ dependencies:
+ '@openstatus/db':
+ specifier: workspace:*
+ version: link:../../db
+ '@openstatus/notification-base':
+ specifier: workspace:*
+ version: link:../base
+ '@openstatus/utils':
+ specifier: workspace:*
+ version: link:../../utils
+ zod:
+ specifier: 4.1.13
+ version: 4.1.13
+ devDependencies:
+ '@openstatus/tsconfig':
+ specifier: workspace:*
+ version: link:../../tsconfig
+ '@types/node':
+ specifier: 24.0.8
+ version: 24.0.8
+ bun-types:
+ specifier: 1.3.1
+ version: 1.3.1(@types/[email protected])
+ typescript:
+ specifier: 5.9.3
+ version: 5.9.3
+
packages/notifications/ntfy:
dependencies:
'@openstatus/db':