Welcome to the Courier Documentation
Find all the tutorials and resources you need to build product notifications with Courier.
Getting Started
Learn what Courier is, what the key concepts are, and how to send your first notification using your programming language of choice.
Tutorials
Learn basic Courier platform concepts that cover everything from adding providers to sending notifications to a list.
UI Components
Courier provides embeddable UI components and client SDKs for web, iOS, and Android.
API Reference
The Courier REST API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Courier Platform Overview
Our platform is designed around a small number of key concepts that make it easy to build powerful notification experiences while also being flexible enough to integrate into whatever kind of application or system you may be building.
Users
Specifying the recipient or recipients of the notification.
Content
Constructing the content of the notification, including the use of templates, dynamic variables and channel agnostic markup.
Integrations
The channels and providers being used to deliver the notification.
Sending
Sending notifications, including setting limits and handling retries.
Preferences
Respecting user delivery preferences and drop-in user preference components.
Automations
Create fully managed notification workflows and implement scheduling, batching, and throttling with zero lines of code.
Inbox
Embed a modern notification inbox to your app with our web, iOS, and Android SDKs.
Workspaces
Setup test and production environments, manage access control and configure the behavior of your apps.
Logging
Logging, analytics, and observability.
Server SDK Libraries
You can access our REST API and integrate Courier into your application using one of our server SDK libraries.
- courier-node
- courier-python
- courier-ruby
- courier-go
- courier-php
- courier-java
import { CourierClient } from "@trycourier/courier";
const courier = CourierClient({ authorizationToken: "<AUTH_TOKEN>" }); // get from the Courier UI
// Example: send a basic message to an email recipient
const { requestId } = await courier.send({
message: {
to: {
data: {
name: "Marty",
},
email: "marty_mcfly@email.com",
},
content: {
title: "Back to the Future",
body: "Oh my {{name}}, we need 1.21 Gigawatts!",
},
routing: {
method: "single",
channels: ["email"],
},
},
});
from trycourier import Courier
client = Courier(auth_token="your-auth-token") #or set via COURIER_AUTH_TOKEN env var
resp = client.send_message(
message={
'to': {
'email': 'marty_mcfly@email.com',
'data': {'name': 'Marty'}
},
'content': {
'title': 'Back to the Future',
'body': 'Oh my {{name}}, we need 1.21 Gigawatts!',
},
'routing': {
'method': 'single',
'channels': ['email'],
}
}
)
print(resp['requestId'])
require "trycourier"
begin
client = Courier::Client.new "your-auth-token" # or set via COURIER_AUTH_TOKEN env var
res = client.send_message({
"message" => {
"to" => {
"email" => "marty_mcfly@email.com",
"data" => {
"name" => "Marty McFly"
}
}
"content" => {
"title" => "hello {{name}}",
"body" => "Welcome to Courier!"
},
"data" => {
"name" => "Ruby"
}
}
})
puts res.code # the HTTP response code
puts res.request_id # if the code is 202, this will be the Courier request ID for this message
rescue Courier::CourierAPIError => re #error sent from from the API
puts re.message
end
package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go/v2"
)
func main() {
client := courier.CourierClient("<YOUR_AUTH_TOKEN>", nil)
message := courier.SendMessageRequestBody{
"template": "<COURIER_TEMPLATE>",
"to": map[string]string{
"email": "marty_mcfly@email.com",
"data": map[string]string{
"name": "Marty McFly"
}
}
}
reqID, err := client.SendMessage(context.Background(), message)
if err != nil {
panic(err)
}
fmt.Println(reqID)
}
<?php
require "./vendor/autoload.php";
use Courier\CourierClient;
$courier = new CourierClient("https://api.courier.com/", "redacted");
$result = $courier->sendEnhancedNotification(
(object) [
'to' => [
'email' => "marty_mcfly@email.com",
],
'template' => "COURIER_TEMPLATE",
'data' => [
'name' => "Marty McFly",
],
],
);
echo( $result->requestId );
?>
import com.google.gson.Gson;
Courier.init("<AUTH_TOKEN>");
Gson gson = new Gson();
SendEnhancedRequestBody sendEnhancedRequestBody = new SendEnhancedRequestBody();
SendRequestMessage sendRequestMessage = new SendRequestMessage();
HashMap<String, Object> toMap = gson.fromJson("{'email':'marty_mcfly@email.com'}", HashMap.class);
sendRequestMessage.setTo(toMap);
sendRequestMessage.setTemplate("my-template");
sendRequestMessage.setBrand_id("my-brand");
sendEnhancedRequestBody.setMessage(sendRequestMessage);
SendEnhancedResponseBody sendEnhancedResponseBody2 = new SendService().sendEnhancedMessage(sendEnhancedRequestBody);
System.out.println(sendEnhancedResponseBody2);
Join the Courier Community
Connect with the Courier developer community on the Courier Discord Server. Get community support, share ideas and inspiration, join our beta programs, and much more.