The Courier C# SDK provides typed access to the Courier REST API from applications written in C#. It targets .NET Standard 2.0, uses async/await throughout, and returns strongly typed response objects. Available on GitHub.Documentation Index
Fetch the complete documentation index at: https://www.courier.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Quick Start
Authentication
Get your API key from Settings > API Keys in the Courier dashboard. Set it as an environment variable:| Property | Environment variable | Default |
|---|---|---|
ApiKey | COURIER_API_KEY | — |
BaseUrl | COURIER_BASE_URL | https://api.courier.com |
Sending Notifications
With a template
With inline content
Available Resources
The SDK covers the full Courier API. Every method is async and returns strongly typed models.| Resource | Namespace | Description |
|---|---|---|
| Send | client.Send | Send messages to one or more recipients |
| Messages | client.Messages | Retrieve status, history, and content of sent messages |
| Profiles | client.Profiles | Create, update, and retrieve user profiles |
| Users | client.Users | Manage preferences, tenants, and push tokens per user |
| Auth | client.Auth | Issue JWT tokens for client-side SDK authentication |
| Bulk | client.Bulk | Send messages to large recipient lists via jobs |
| Lists | client.Lists | Manage subscription lists and their subscribers |
| Audiences | client.Audiences | Define and query audience segments |
| Tenants | client.Tenants | Manage tenants for multi-tenant setups |
| Automations | client.Automations | Invoke multi-step automation workflows |
| Brands | client.Brands | Manage brand settings (logos, colors, templates) |
| Notifications | client.Notifications | List and inspect notification templates |
| Translations | client.Translations | Manage localized content |
Common Operations
Checking Message Status
Managing User Profiles
Issuing JWT Tokens
| Scope | Permission |
|---|---|
user_id:<id> | Which user the token is for (required) |
inbox:read:messages | Read inbox messages |
inbox:write:events | Mark messages as read/archived |
read:preferences | Read notification preferences |
write:preferences | Update notification preferences |
write:user-tokens | Register push notification tokens |
Configuration
Error Handling
When the API returns a non-success status code, the SDK throws aCourierException:
Retries and Timeouts
The SDK automatically retries failed requests up to 2 times with exponential backoff. UseWithOptions to configure per-request:
WithOptions returns a new client instance; the original is unchanged.
More Operations
The SDK covers the full Courier REST API. Here are a few more resources beyond what’s documented above:| Resource | Method | Use case |
|---|---|---|
| User preferences | client.Users.Preferences.Retrieve(userId) | Fetch a user’s notification preferences for your preference center |
| Cancel a message | client.Messages.Cancel(messageId) | Cancel a delayed or queued message before delivery |
| Push tokens | client.Users.Tokens.AddSingle(token, params) | Register a device push token for iOS, Android, or React Native |
| Automations | client.Automations.Invoke.InvokeAdHoc(params) | Run a multi-step workflow via Automations |
API Reference
Full REST API docs with request/response examples.
Send API
Learn about the Send endpoint, routing, and message options.
Quickstart
Send your first notification in under two minutes.
GitHub
Source code, issues, and changelog.