Skip to main content

POST /send

Custom Formatting

To improve working with cURL, Courier also supports a custom urlencoded format that can be used in the place of JSON. This format allows nested data values using square bracket syntax. This is useful when passing profile and data parameters. For example, a cURL --data option with the profile parameter and a nested email would look like this:

--data "profile[email]=test@example.com"

Send Response Data

Sending a message is an async process. So upon submission of a message, only a requestId will be returned.

{ "requestId": "87e7c05b-4f46-fda24e356e23" }
POSThttps://api.courier.com/send
Send a notification to a specified recipient.
BODY PARAM
messageobject
tooneOfrequired
datajson
An object that includes any data you want to pass to the message. The data will populate the corresponding template or elemental variables.
emailstring
A unique email address associated to the recipient of message.
user_idstring
A unique identifier associated with the recipient of the delivered message.
list_idstring
A unique identifier associated with a Courier list of subscribers. A message will be sent to each subscriber in the list.
list_patternstring
A unique identifier associated with a Courier pattern used to identify specific list(s) intended to send. A message will be sent to each subscriber in the specific list(s).
phone_numberstring
A unique phone number associated to the recipient of message.
preferencesjson
An object that includes any preferences for the recipient.
templatestringrequired
A notification template id or event mapping from Courier Studio.
brand_idstring
A unique identifier that represents the brand that should be used for rendering the notification. Note that a brand_id will only be applied to a Template message.
routingobject
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 configured in the Courier Studio UI.
methodstringrequired
The method for selecting channels to send the message with.
channelsarray
An array of valid channel identifiers (like email, push, sms, etc.) and additional routing nodes.
channelsrecord
A map of valid channel identifiers (e.g. email, sms, etc.) to channel configuration objects whose properties are below. If you don't specify 'channels', Courier will use the default configuration for each channel as specified in the Courier Studio UI.
providersrecord
The providers object is a map of valid provider identifiers (e.g. twilio, slack, etc.) to provider configuration objects. If you don't specify providers, Courier will use the default configuration for each provider as specified in the Courier Studio UI.
metadataobject
eventstring
An arbitrary string to tracks the event that generated this request (e.g. 'signup').
tagsarray
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.
trace_idstring
A unique ID used to correlate this request to processing on your servers. Courier does not verify the uniqueness of this ID.
utmobject
Identify the campaign that refers traffic to a specific website, and attributes the browser's website session.
campaignstring
contentstring
mediumstring
sourcestring
termstring
timeoutobject
messagenumber
An arbitrary duration for a message to be available for delivery. Default is 72 hours or 259200000 Milliseconds
channelnumber
(Business tier only) Time in ms to attempt a channel before failover.
providernumber
(Business tier only) Time in ms to attempt a provider before failover.
delayobject
durationnumber
The millisecond duration to delay the delivery of the message.
Responses
AUTH TOKEN
curl --request POST \
--url https://api.courier.com/send \
--header 'Accept: application/json'
Response Example
{
"requestId": "1-5e2b2615-05efbb3acab9172f88dd3f6f"
}

Example

Method: POST

URL: https://api.courier.com/send

Body: ​

{
"message": {
"to": {
"email": "hello@example.com"
},
"template": "abcdef12345678",
"data": {
"name": "John Doe"
},
"routing": {
"method": "single",
"channels": [
"email"
]
}
}
}