Audiences
AuthTokens
Brands
Inbound
Lists
Messages
Notifications
Profiles
Tenants
User Preferences
User Tenants
Send a message
Use the send API to send a message to one or more recipients.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Defines the message to be delivered
An arbitrary object that includes any data you want to pass to the message. The data will populate the corresponding template or elements variables.
"Define run-time configuration for one or more channels. If you don't specify channels, the default configuration for each channel will be used. Valid ChannelId's are: email, sms, push, inbox, direct_message, banner, and webhook."
Context to load with this recipient. Will override any context set on message.context.
An id of a tenant, see tenants api docs. Will load brand, default preferences and any other base context data associated with this tenant.
Metadata such as utm tracking attached with the notification through this channel.
An arbitrary string to tracks the event that generated this request (e.g. 'signup').
An array of up to 9 tags you wish to associate with this request (and corresponding messages) for later analysis. Individual tags cannot be more than 30 characters in length.
Identify the campaign that refers traffic to a specific website, and attributes the browser's website session.
A unique ID used to correlate this request to processing on your servers. Note: Courier does not verify the uniqueness of this ID.
The ID of the subscription topic you want to apply to the message. If this is a templated message, it will override the subscription topic if already associated
An object whose keys are valid provider identifiers which map to an object.
Allows you to customize which channel(s) Courier will potentially deliver the message. If no routing key is specified, Courier will use the default routing configuration or routing defined by the template.
A list of channels or providers to send the message through. Can also recursively define sub-routing methods, which can be useful for defining advanced push notification delivery strategies.
Time in ms to attempt the channel before failing over to the next available channel.
Defines the time to wait before delivering the message. You can specify one of the following options. Duration with the number of milliseconds to delay. Until with an ISO 8601 timestamp that specifies when it should be delivered. Until with an OpenStreetMap opening_hours-like format that specifies the Delivery Window (e.g., 'Mo-Fr 08:00-18:00pm')
The duration of the delay in milliseconds.
An ISO 8601 timestamp that specifies when it should be delivered or an OpenStreetMap opening_hours-like format that specifies the Delivery Window (e.g., 'Mo-Fr 08:00-18:00pm')
"Expiry allows you to set an absolute or relative time in which a message expires. Note: This is only valid for the Courier Inbox channel as of 12-08-2022."
An epoch timestamp or ISO8601 timestamp with timezone (YYYY-MM-DDThh:mm:ss.sTZD)
that describes the time in which a message expires.
A duration in the form of milliseconds or an ISO8601 Duration format (i.e. P1DT4H).
The recipient or a list of recipients of the message
A unique identifier associated with an Audience. A message will be sent to each user in the audience.
Describes the content of the message in a way that will work for email, push, chat, or any channel. Either this or template must be specified.
For example, "2022-01-01"
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Defines the message to be delivered
Describes the content of the message in a way that will work for email, push, chat, or any channel. Either this or template must be specified.
For example, "2022-01-01"
text
The text content displayed in the notification. Either this field must be specified, or the elements field
Text alignment.
left
, center
, right
Allows the text to be rendered as a heading level.
text
, h1
, h2
, subtext
Specifies the color of text. Can be any valid css color value
Apply bold to the text
Apply italics to the text
Apply a strike through the text
Apply an underline to the text
Region specific content. See locales docs for more details.
markdown
An arbitrary object that includes any data you want to pass to the message. The data will populate the corresponding template or elements variables.
"Define run-time configuration for one or more channels. If you don't specify channels, the default configuration for each channel will be used. Valid ChannelId's are: email, sms, push, inbox, direct_message, banner, and webhook."
Id of the brand that should be used for rendering the message. If not specified, the brand configured as default brand will be used.
A list of providers enabled for this channel. Courier will select one provider to send through unless routing_method is set to all.
The method for selecting the providers to send the message with.
Single will send to one of the available providers for this channel,
all will send the message through all channels. Defaults to single
.
all
, single
A JavaScript conditional expression to determine if the message should
be sent through the channel. Has access to the data and profile object.
For example, data.name === profile.name
Channel specific overrides.
Context to load with this recipient. Will override any context set on message.context.
An id of a tenant, see tenants api docs. Will load brand, default preferences and any other base context data associated with this tenant.
Metadata such as utm tracking attached with the notification through this channel.
An arbitrary string to tracks the event that generated this request (e.g. 'signup').
An array of up to 9 tags you wish to associate with this request (and corresponding messages) for later analysis. Individual tags cannot be more than 30 characters in length.
Identify the campaign that refers traffic to a specific website, and attributes the browser's website session.
A unique ID used to correlate this request to processing on your servers. Note: Courier does not verify the uniqueness of this ID.
The ID of the subscription topic you want to apply to the message. If this is a templated message, it will override the subscription topic if already associated
An object whose keys are valid provider identifiers which map to an object.
Provider specific overrides.
A JavaScript conditional expression to determine if the message should be sent
through the channel. Has access to the data and profile object. For example,
data.name === profile.name
Allows you to customize which channel(s) Courier will potentially deliver the message. If no routing key is specified, Courier will use the default routing configuration or routing defined by the template.
all
, single
A list of channels or providers to send the message through. Can also recursively define sub-routing methods, which can be useful for defining advanced push notification delivery strategies.
Time in ms to attempt the channel before failing over to the next available channel.
no-escalation
, delivered
, viewed
, engaged
Defines the time to wait before delivering the message. You can specify one of the following options. Duration with the number of milliseconds to delay. Until with an ISO 8601 timestamp that specifies when it should be delivered. Until with an OpenStreetMap opening_hours-like format that specifies the Delivery Window (e.g., 'Mo-Fr 08:00-18:00pm')
The duration of the delay in milliseconds.
An ISO 8601 timestamp that specifies when it should be delivered or an OpenStreetMap opening_hours-like format that specifies the Delivery Window (e.g., 'Mo-Fr 08:00-18:00pm')
"Expiry allows you to set an absolute or relative time in which a message expires. Note: This is only valid for the Courier Inbox channel as of 12-08-2022."
The recipient or a list of recipients of the message
A unique identifier associated with an Audience. A message will be sent to each user in the audience.
Response
A successful call to POST /send
returns a 202
status code along with a requestId
in the response body.
For send requests that have a single recipient, the requestId
is assigned to the derived message as its message_id. Therefore the requestId
can be supplied to the Message's API for single recipient messages.
For send requests that have multiple recipients (accounts, audiences, lists, etc.), Courier assigns a unique id to each derived message as its message_id
. Therefore the requestId
cannot be supplied to the Message's API for single-recipient messages.