Shreya Gupta
March 22, 2023

Table of contents
Send and Automate Slack & Microsoft Teams Notifications with One API
Prerequisites: What You Need to Get Started
How to Send Slack Notifications with Node.js and Courier
Slack Resources
How to Send Microsoft Teams Notifications with Node.js and Courier
How to Send Slack, Teams, and Email Notifications in One API Call
Step 1: Create a Notification Template
Step 2: Build an Automation
FAQs
Want to send notifications to Slack, Microsoft Teams, or both—without managing multiple APIs? This guide shows you how to send and automate messages across channels using a single Courier API call from your Node.js app.
You’ll learn how to:
If you're working in Python, check out our Slack and Teams automation guide for Python. Or jump straight to the working code.
Before you send Slack or Microsoft Teams messages from Node.js, make sure you have the following in place:
bash
npm install @trycourier/courier
## How to Send Slack Notifications with Node.js and CourierYou can use Courier to send direct messages to Slack users from your Node.js app with just one API call. Here’s how to get your Slack integration set up and running.
Go to Courier’s Slack channel configuration and click Install Provider.
🎯 If you're only using Microsoft Teams, skip ahead to the Teams integration setup.

Head over to Slack Apps and click Create an App. Choose an app name and workspace.

Under OAuth & Permissions, add the following scopes:
chat:writeim:writeusers:readusers:read.emailThen click Install App to Workspace. After installation, copy the Bot User OAuth Token—you’ll need it later.


Here’s a code example for sending a direct message using Courier:
Copied!
const { CourierClient } = require("@trycourier/courier");const courier = CourierClient({ authorizationToken: "auth_token" });async function send_message() {const { requestId } = await courier.send({message: {to: {slack: {access_token: "slack_access_token",email: "example@email.com"}},content: {title: "Important Survey Reminder",body: "This is a reminder to fill out your survey by the end of this week.",},routing: {method: "single",channels: ["direct_message"]}},});console.log(requestId);}send_message();
Run the Node.js program to see your notification popup in the user's Slack direct message!

Check your Courier logs for errors if your user did not receive the message.
Courier makes it easy to send direct messages to Microsoft Teams users from your Node.js app. Here’s how to configure your Teams integration and send messages with a single API call.
If you don’t already have one, create a free Microsoft 365 developer account. You’ll use it to register and manage your Teams app.
Install the Microsoft Teams Developer Portal and create a new app:


Go to App features → Bot and either select an existing bot or create one. Save the password you generate.
Leave the Messaging endpoint blank for now.

Deploy your bot using the Courier Microsoft Teams Netlify Starter:
Once deployed, copy the Netlify site URL—you’ll use it for the messaging endpoint.

Back in the Developer Portal:


In your Courier Channels settings, choose Microsoft Teams, then paste in your:
Click Install Provider.

Here’s a working code example:
Copied!
const { CourierClient } = require("@trycourier/courier");const courier = CourierClient({ authorizationToken: "auth_token" });async function send_message() {const { requestId } = await courier.send({message: {to: {ms_teams: {conversation_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tenant_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",service_url: "https://smba.trafficmanager.net/amer"}},content: {title: "Important Survey Reminder",body: "This is a reminder to fill out your survey by the end of this week.",},routing: {method: "single",channels: ["direct_message"]}},});console.log(requestId);}send_message();
Finally, you can run the Node.js program, and you will see a notification in your Team channel.
Microsoft Teams Resources
Courier’s multi-channel messaging makes it easy to send a single message to multiple platforms—like Slack, Microsoft Teams, and email—using one API call from your Node.js app.
Use this when:
Copied!
const { CourierClient } = require("@trycourier/courier");const courier = CourierClient({ authorizationToken: "auth_token" });async function send_message() {const { requestId } = await courier.send({message: {to: {slack: {access_token: "access_token",email: "example@email.com"},ms_teams: {conversation_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tenant_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",service_url: "https://smba.trafficmanager.net/amer"},email: "example@email.com"},content: {title: "Important Survey Reminder",body: "This is a reminder to fill out your survey by the end of this week.",},routing: {method: "all",channels: ["direct_message", "email"]}},});console.log(requestId);}send_message();
Courier supports a wide range of multi-channel notification providers—including email, SMS, push, and chat tools like Slack and Microsoft Teams.
You can expand your message delivery by including email in the to object, and adding "email" to the channels array inside routing. This allows you to send the same notification across chat and email in a single API call.

Copied!
const { CourierClient } = require("@trycourier/courier");const courier = CourierClient({ authorizationToken: "auth_token" });async function send_message() {const { requestId } = await courier.send({message: {to: {slack: {access_token: "access_token",email: "example@email.com"},ms_teams: {conversation_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tenant_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",service_url: "https://smba.trafficmanager.net/amer"},email: "example@email.com"},// template: "template_id",content: {title: "Important Survey Reminder",body: "This is a reminder to fill out your survey by the end of this week.",},routing: {method: "all",channels: ["direct_message", "email"]}},});console.log(requestId);}send_message();
💡 To prioritize delivery without duplicates, use
"single"as yourrouting.method.
Courier will attempt each channel in order—Slack, then Teams, then email—until one succeeds.
If you prefer to build notifications without writing code, Courier’s visual automation tools let you design, schedule, and send messages using a drag-and-drop interface.
Start by opening the Notification Designer and creating a new notification. You can add one or more channels—such as Slack, Microsoft Teams, email, or SMS—and customize the content for each one individually.
Click any channel icon to edit its message content. Use the drag-and-drop Library on the left side to reuse content blocks across channels and maintain consistency.

Once your message is ready, click the gear icon next to the notification title (top right) to copy the Notification ID. You’ll need it when setting up the automation.
Go to the Automations dashboard and click Create Automation. Select a Schedule Trigger and choose a date and time for when the message should send.
Next, add a Send step and choose the notification you created. Change the Payload Type to JSON, then click Editor to define your recipient data.
Here’s how to structure the fields:
Click
and enter slack as an Object
access_token, emailClick
again and enter ms_teams as an Object
conversation_id, tenant_id, service_urlIf you'd also like to send email or SMS, add fields for "email" and "phone_number" using the same structure.
Courier will now send the message to the selected channels using the profile data provided.

Automating notifications in team communication platforms such as Slack and Teams can significantly improve team productivity and communication. However, building automated notifications from scratch can be complex and time-consuming. That's where Courier comes in with its easy-to-use Node.js SDK that allows developers to send notifications to multiple channels with just a few lines of code.
By following the steps outlined in this article, you can set up notification automation with Courier and Node.js for both Slack and Teams. Additionally, you can leverage Courier's multi-channel functionality to integrate other applications and channels into your notification system.
Courier supports multi-channel delivery using a single send API call. To send to both Slack and Teams, include both in the to object and use the routing configuration to specify behavior.
Copied!
routing: {method: "all", // or "single" for fallbackchannels: ["direct_message"]}
"all" to send to all channels at once"single" to send to the first available (e.g., Slack → fallback to Teams → fallback to email)Learn more about routing logic here.
Courier does not store your Slack tokens. You provide them at runtime in the API call. Be sure to keep these tokens in environment variables or a secure secrets manager—never commit them to version control.
Copied!
slack: {access_token: process.env.SLACK_BOT_TOKEN,email: "user@example.com"}
This error usually means the integration for the channel you’re trying to send with—like Slack or Teams—is not properly installed or configured in your Courier account.
Fix:
Check logs in the Courier Message Log to confirm which provider failed.
Yes. Set routing.method to "single" and Courier will attempt to deliver the message using each channel in order until one succeeds.
Copied!
routing: {method: "single",channels: ["direct_message", "email"]}
This is ideal for high-priority alerts or workflows where delivery matters more than the channel.
Use Courier’s Notification Designer to build multi-channel messages, then schedule them in Automations using a visual workflow.
If you’re using Microsoft Teams and the message doesn’t arrive:
You can also view failed attempts in the Courier logs to troubleshoot further.
Yes—Courier identifies Slack users by their email address (using Slack’s users.lookupByEmail under the hood). Just make sure the email is tied to an active Slack account and the Bot Token has the correct scopes (users:read.email).
You can send test messages to yourself using your own Slack or Teams credentials and email. Use Courier’s test users and preview tools to confirm layout, content, and channel behavior without affecting production users.
💡 Pro tip: Use Courier’s Message Designer Preview to test all channels in one place.

Build with AI: let your agent handle notifications end to end
Courier's Build with AI toolkit gives coding agents direct access to your notification infrastructure. Four integration points, one goal: let your agent send messages, debug deliveries, manage users, and follow notification best practices without context-switching. Works with Claude Code, Cursor, and any agent that can run shell commands or call MCP tools.
By Kyle Seyler
April 07, 2026

How to Use Claude Code on Mobile to Design, Test, and Ship Multichannel Notifications
A walkthrough of using Claude Code's mobile app with Courier's MCP server and CLI to design, test, and ship a multichannel product announcement from a phone. Covers the full workflow: drafting the content outline, creating notification templates using Courier's elemental format, building channel-specific variants for email, Slack, push, and SMS, customizing brand styling through the API, iterating on design with test sends, getting team approval, and publishing with custom routing rules. The whole thing took a couple hours, mostly cold start and design iterations.
By Kyle Seyler
April 06, 2026

Transactional, Product, and Marketing Notifications: What Are the Differences?
Understanding the difference between transactional, product, and marketing notifications is essential for developers building notification infrastructure. Transactional notifications confirm user actions and require no opt-in. Product notifications drive feature adoption through education. Marketing notifications promote sales and require explicit consent. This guide explains the legal requirements, best practices, and when to use each notification type to build compliant systems users trust.Retry
By Kyle Seyler
October 23, 2025
© 2026 Courier. All rights reserved.