Prerequisite: Create an API Key
You need a Courier API key to authenticate CLI commands. Create one in your Courier Settings, then set it in your shell:Installation
- npm
- Direct download
Command Structure
The CLI uses a resource-based pattern:--help on any command to see available flags:
Send Your First Notification
You don’t need a template to send your first notification. Pass the content inline and Courier handles the rest. Send an email directlyManage User Profiles
Courier needs to know where to reach your users. Create profiles with their contact info so you can send byuser_id instead of passing email and phone every time.
Create a user profile
Check on a Notification
Every notification gets a message ID. Use it to check delivery status, inspect rendered content, or trace the full delivery timeline. Get the status of a sent notificationDebug a Delivery Issue
When a user reports they didn’t get a notification, run these in sequence to narrow it down. Find the notification Pull recent notifications for a specific user.DELIVERED, SENT, UNDELIVERABLE, or UNROUTABLE.
UNROUTABLE, the user’s profile is probably missing channel data.
Send to Groups
Create a list and add subscriberseng.frontend, eng.backend), target all of them at once.
Send in Bulk
For large sends (product launches, monthly digests, migration emails), use the bulk API to send to thousands of users in a single job.Manage Templates
Notification templates let you define reusable content and routing in Courier’s designer, then send by template ID. The V2 workflow is: create → add content → create a routing strategy → publish → send. Create a draft templatent_...). Use that ID in all subsequent commands.
Add content to the template
rs_...) from the response, then link it to your template:
password-reset) or ID.
Send using the template
Work with Tenants
If you’re building a B2B product, tenants let you scope branding, preferences, and notification behavior per customer organization. Create a tenantTrigger Automations
Automations let you orchestrate multi-step notification sequences (delays, conditions, batching) without writing that logic in your app. Invoke a saved automationManage Preferences
Let users control what they receive. Preferences are enforced at send time; Courier won’t deliver a notification if the user has opted out of that topic. Check a user’s current preferencesOutput Formats
Every command supports structured output via the--format flag:
Filter output with GJSON syntax using
--transform:
Global Flags
Scripting and CI/CD
Smoke-test a notification after deploy Run this in your CI pipeline to verify notifications still work after a deploy.AI Agent Usage
The CLI works as a zero-config tool for AI agents in Cursor, Claude Code, Codex, and similar environments. Install once, setCOURIER_API_KEY, and agents can run Courier operations directly via shell commands. Every command supports --format json for machine-readable output.
What’s Next
Manage Templates (CLI & MCP)
Step-by-step tutorial: create, publish, send, and archive templates from the CLI
MCP Server
Structured AI tool access for sending messages, managing users, and more
API Reference
Full REST API documentation
Source code: trycourier/courier-cli