Courier

The Courier Developer Hub

Welcome to the Courier developer hub. You'll find comprehensive guides and documentation to help you start working with Courier as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    API Reference

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.

Client Libraries

Prebuilt libraries and sample code for popular languages.

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: "[email protected]",
    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": "[email protected]",
        "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": "[email protected]",
      "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: "[email protected]",
                        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 Digs\Courier\Courier;

    $courier = new Courier("<AUTH_TOKEN>");
    
    $result = $courier->sendNotification("<EVENT_ID>", 
        "<RECIPIENT_ID>", 
        [
            'email' => '[email protected]', 
            'phone_number' => '555-228-3890'
        ],
        [
            'world' => 'PHP!'
        ]);
    $messageId = $result->messageId;
    echo($messageId);
?>

Live Streaming

Courier stream 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.

Updated 13 days ago


Home


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.