How to send notifications from AI agents

Let your AI agent send email, SMS, push, Slack, Teams, and in-app messages with one API or MCP call. Courier handles routing, preferences, and logs.

Updated Nov 6, 2026

Last updated: November 2026

Short answer

Give your AI agent one tool that sends, and let a messaging platform handle the rest. With Courier, the agent calls one API or MCP tool with a template and a user ID. Courier picks the channel, applies the user's preferences, fails over between providers, and logs every delivery. Courier is the customer messaging platform for humans and AI agents: everything in the UI is available via the API, CLI, and MCP server.

Why AI agents need a messaging layer

An AI agent is good at deciding who to tell and when. It shouldn't also own how: provider keys, channel fallbacks, unsubscribes, and a record of what went out. A messaging layer gives your agent:

  • One call, every channel. Email, SMS, push, an in-app Inbox, Slack, Microsoft Teams, and WhatsApp from the same send.
  • Words your team approved. The template holds the content. The agent decides when and who, without composing the message.
  • Preferences that hold. Map a template to a subscription topic and Courier checks each user's choices at send time, so an opted-out user stays opted out, whoever sends.
  • Failover. If a provider can't deliver, Courier tries the next one on the channel.
  • A log for every message. Who got it, which provider carried it, and whether it was delivered, opened, or clicked.

Three ways to send from an AI agent

1. Connect the Courier MCP server

The fastest path. Courier hosts an MCP server at https://mcp.courier.com with 170+ tools across the Courier API. Your agent sends with send_message_template, passing a user_id and a published template.

Terminal
claude mcp add --transport http courier https://mcp.courier.com --header api_key:YOUR_COURIER_API_KEY

Then ask your agent:

Code
With Courier MCP, send my nt_01kx4h2jdafq8bk9aftxak4b40 template to user_123 for build 1.4.2.

The agent resolves the recipient, looks up the template, and sends. Courier documents the setup for Claude Code, Cursor, Codex, VS Code, Windsurf, and more. The MCP send tools take a user_id or a list_id, so save the user's profile first. The Send from an AI agent guide walks through it.

2. Give the agent a send tool built on the Courier SDK

For an agent running in production, wrap one send call as a tool. You decide exactly what the agent can do: which templates, which recipients, which data.

TypeScript
import Courier from '@trycourier/courier';

const client = new Courier();

const response = await client.send.message({
  message: {
    to: { user_id: 'user_123' },
    template: 'nt_01kx4h2jdafq8bk9aftxak4b40',
    data: { name: 'Sarah Bennett' },
  },
});

console.log(response.requestId);

The same call in Python:

Python
import os
from courier import Courier

client = Courier(
    api_key=os.environ.get("COURIER_API_KEY"),
)

response = client.send.message(
    message={
        "to": {"user_id": "your_user_id"},
        "template": "your_template_id",
        "data": {"foo": "bar"},
    },
)
print(response.request_id)

Register it as a tool in your agent framework and keep template IDs on an allowlist, so the agent only sends messages your team approved. Step-by-step recipes: Claude Agent SDK, OpenAI Agents SDK, and Vercel AI SDK.

3. Hand the agent a journey

When one message isn't enough, the agent starts a journey: a multi-step flow with delays, branches, digests, and throttles, built on a visual canvas or through the API.

JavaScript
import Courier from '@trycourier/courier';

const client = new Courier();

const journeysInvokeResponse = await client.journeys.invoke('welcome-journey', {
  user_id: 'user_123',
  data: { order_id: 'ORD-9042', order_total: 49.99 },
});

Inside a journey, an AI node runs a model as a step. It returns structured output that the next branch or template uses, so a model can score or classify a user before the journey decides what to send. AI nodes are on the Business and Enterprise plans.

Let routing pick the channel

Tell Courier which channels to try and in what order. single stops at the first channel that delivers; all sends on every channel in the list. The user's preferences apply on top.

JavaScript
import Courier from '@trycourier/courier';

const client = new Courier();

const { requestId } = await client.send.message({
  message: {
    to: { user_id: "user_123" },
    template: "nt_01kx4h2jdafq8bk9aftxak4b40",
    routing: {
      method: "single",
      channels: ["push", "email"],
    },
  },
});

A user who never turned on push still gets the email.

When the agent needs a person

Some calls shouldn't be automatic. The agent sends an approval request through Courier, and a person answers it where they already work:

  • Slack: template buttons render as Slack buttons.
  • Microsoft Teams: Adaptive Cards, built in Design Studio.
  • Inbox: action buttons on the message, inside your product.

Every Courier action button is a link to a URL you choose, or a callback in your app, so the answer comes back to you and your app resumes the agent. In the Inbox, it's one prop:

JSX
<CourierInbox
  onMessageClick={({ message, index }) => openInApp(message)}
  onMessageActionClick={({ message, action, index }) => handleAction(message, action)}
/>

Keep AI agents safe

  • Build with a Test key. Test's built-in email provider only delivers to the address you signed up with, so until you connect your own provider, an agent can't reach a real customer by mistake.
  • Templates hold the words. The agent chooses the moment and the recipient; your team owns what it says.
  • Send limits cap volume. Set limits per user, topic, or tenant. A message over the limit shows as THROTTLED in the log instead of delivering.
  • Idempotency keys stop duplicate sends. Agents retry. Send an Idempotency-Key header, and a repeated request returns the original response instead of sending again.
  • Every send is traceable. Ask the agent to run trace_message with a message ID or your own trace_id, and it gets each message's event history and status reason.

Why teams pick Courier for AI agents

  • 170+ MCP tools. The whole Courier API, against 23 on Novu's MCP server.
  • Both jobs on one platform. Coding agents build your templates, journeys, and preferences. Production AI agents send them. Everything in the UI is available via the API, CLI, and MCP server.
  • One price on every channel. Sending from an AI agent costs the same as any other send: $0.005 per send on Business, Inbox included, with no per-agent fee.
  • Start free today. The Developer plan is free and includes 10,000 sends a month, journeys, broadcasts, the MCP server, the CLI, and the SDKs.

See Courier for AI agents for Courier Skills, the CLI, and setup in every coding agent.

Start free with 10,000 sends a month, or run the AI agent quickstart to send your first test email in three steps.

FAQ

Frequently asked questions

Give the agent one tool: Courier's hosted MCP server, or a send call from the Courier SDK. The agent passes a user ID and a published template. Courier picks the channel, applies the user's preferences, fails over between providers, and logs the delivery.

One API, every channel

Ship notifications without the boilerplate

Courier gives you one API for email, SMS, push, and chat, with templates, routing, retries, and delivery logs built in.

Last updated Nov 6, 2026. Code samples are illustrative; provider APIs and pricing change over time, so check each provider’s docs before relying on them.