Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Courier Destination


Destination Info
  • Accepts Identify and Track calls.
  • Refer to it as Courier in the Integrations object
  • This integration is partner owned. Please reach out to the partner's support for any issues.

Courier(link takes you to an external page) provides a way to design and deliver notifications. Design once with a rich visual editor and deliver to any channel through one API request.

This destination is maintained by Courier. For any issues with the destination, contact the Courier support team.


Getting Started

getting-started page anchor
  1. From the Destinations catalog page in the Segment App, click Add Destination.
  2. Search for "Courier" in the Destinations Catalog, and select the "Courier" destination.
  3. Choose which Source should send data to the "Courier" destination.
  4. Go to the Courier Settings Page(link takes you to an external page), find and copy the "Auth Token".
  5. Enter the "Auth Token" in the "Courier" destination settings field "API Key" in Segment.

If you aren't familiar with the Segment Spec, read the Group method documentation to learn about what it does. An example call would look like:

1
analytics.group("0e8c78ea9d97a7b8185e8632", {
2
name: "Initech",
3
industry: "Technology",
4
employees: 329,
5
plan: "enterprise",
6
"total billed": 830,
7
});

Segment sends Group calls to Courier as an group event.


If you aren't familiar with the Segment Spec, read through the Identify method documentation to learn about what it does. An example call would look like:

1
analytics.identify('userId123', {
2
email: carrier.pigeon@example.com'
3
});

Segment sends Identify calls to Courier as an identify event.

User Profiles

user-profiles page anchor

Identify calls made from Segment automatically create profiles for users in Courier. Traits included in the Segment Identify call automatically merge into a user's Courier Profile over time.

The example below shows a few basic properties you might want to track if you send notifications to users in one or more channels:

1
analytics.identify('userId123', {
2
email: 'carrier.pigeon@example.com',
3
sms: '+1-123-555-7890',
4
tokens: {
5
slackToken: '****************',
6
microsoftTeamsToken: '****************',
7
whatsAppToken: '****************'
8
},
9
...
10
});

For more information on how Courier handles profiles, see the Courier Profile documentation(link takes you to an external page).


If you aren't familiar with the Segment Spec, read through the Track method documentation to learn about what it does. An example call would look like:

analytics.track("Login Button Clicked");

Segment sends Track calls to Courier as a track event.

Inbound Events and Properties

inbound-events-and-properties page anchor

Segment Track events are inbound events that might trigger a notification when Courier receives them. To begin, events appear in Courier's Data Logs(link takes you to an external page) after you configure the Courier destination.

All Inbound Events coming from Segment Track calls appear with a Segment-TrackEvent prefix in Courier to help distinguish them from other inbound events.

Courier extracts data from the Segment Track properties object, and conditionally triggers a request to the Courier Send API(link takes you to an external page) - only if that event is already mapped(link takes you to an external page).

  • Segment passes all properties from the Track call to the Send API as elements in the data json objects. You can use these data points as variables in the Notification Template or as input on conditional routing logic.
  • Courier uses the userId or anonymousId to look up and include the associated User Profile with the inbound event. (See the note in the Identify section above.)
1
analytics.track('Login Button Clicked', {
2
orderNumber: 12345678980,
3
estimatedDelivery: '2020-06-10T18:41:29.093Z',
4
...
5
})

Courier does not send notifications until you publish a Notification Template and map incoming Segment Track events to that published Notification Template. If you send data to Courier before you complete those steps, incoming events are marked with a status of Unmapped.

Mapping Inbound Events to Notification Templates

mapping-inbound-events-to-notification-templates page anchor

Once you are comfortable with the Notification Template(s) and are ready to send Notifications, you can map these inbound events to start sending. You can do this directly from the Event Log in Courier(link takes you to an external page) or in the Events settings page.


You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo(link takes you to an external page).

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

(information)

Real-time to batch destination sync frequency

Real-time audience syncs to Courier may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.


Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
API Keystring
required

Locate your Courier Auth Token by visiting your General Settings page for a quick copy and paste option: https://app.courier.com/settings