Home
Explore our guides and examples to integrate Courier
Courier is the smartest way to design & deliver notifications. Design once, deliver to any channel with one API.
Get Started
Use one of our Getting Started Guides to help you start sending notifications.
API Reference
Learn more about the Courier REST API
Help Center
Get help using the Courier App. How to’s and best practices for setting up Courier, using the Notification Designer and other features.
Integrations
Learn what is needed to integrate with the many supported channel providers.
Client Libraries
Prebuilt libraries and sample code for popular languages.
- 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 message supporting email & SMS
const { messageId } = await courier.send({
eventId: "<EVENT_ID>", // get from the Courier UI
recipientId: "<RECIPIENT_ID>", // usually your system's User ID
profile: {
email: "example@example.com",
phone_number: "555-228-3890",
},
data: {}, // optional variables for merging into templates
});
from trycourier import Courier
client = Courier(auth_token="your-auth-token") #or set via COURIER_AUTH_TOKEN env var
resp = client.send(
event="your-event-id",
recipient="your-recipient-id",
profile={
"email": "example@example.com",
"phone_number": "555-867-5309"
},
data={
"world": "Python!"
}
)
print(resp['messageId'])
require "trycourier"
begin
client = Courier::Client.new "your-auth-token" # or set via COURIER_AUTH_TOKEN env var
res = client.send({
"event" => "your-event-id",
"recipient" => "your-recipient-id",
"profile" => {
"email": "example@example.com",
"phone_number": "555-867-5309"
},
"data" => {
"world" => "Ruby!"
}
})
puts res.code # the HTTP response code
puts res.message_id # if 200, this will be the Courier message ID for this notification
rescue Courier::ResponseError => re
puts re.message
rescue Courier::InputError => ie
puts ie.message
end
package main
import (
"log"
"github.com/trycourier/courier-go"
)
func send() {
client := courier.CourierClient("<AUTH_TOKEN>")
var message = []byte(`{
eventId: "<EVENT_ID>", // get from the Courier UI
recipientId: "<RECIPIENT_ID>"
profile: {
email: "example@example.com",
phone_number: "555-228-3890"
},
data: {} // optional variables for merging into templates
overrides: {} // optional http provider overrides
}`)
response, err := client.Send(message)
if err != nil {
log.Fatalln(err)
}
log.Println(response.MessageId)
}
func main() {
send()
}
<?
use Courier\CourierClient;
$client = new Courier("https://api.courier.com/", "TOKEN");
$response = $client->sendNotification(
"<EVENT-ID>",
"<RECIPIENT_ID>");
print_r($response);
?>
Courier.init("<AUTH_TOKEN>");
SendRequestBody sendRequestBody = new SendRequestBody();
sendRequestBody.setEvent("<EVENT-ID>");
sendRequestBody.setRecipient("<RECIPIENT_ID>");
HashMap<String, String> profile = new HashMap<>();
profile.put("email", "example@example.com");
profile.put("phone_number", "555-228-3890");
sendRequestBody.setProfile(new Gson().toJson(profile));
SendResponseBody sendResponseBody = new SendService().send(sendRequestBody);
System.out.println(sendResponseBody);
Join the 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.
Live Streaming
Courier streams on Twitch. Follow trycourier to be notified of future streams.
Previous Stream Recordings
Recordings of previous streams are published to the Courier YouTube Channel. Be sure to subscribe to be notified of new content.
You can also check out the blog posts for all our previous Courier Live episodes.