Send a transactional web push
Send a transactional web push notification to a person's browsers. You send a message using a transactional_message_id for a transactional web push message that you created in the user interface, or with auto_create, a trigger name for a message that Customer.io creates on the first request. You can override some of the message's content at send time. The transactional_message_id can be either the numerical ID for the message or the Trigger Name that you assigned it. Learn more about transactional web push.
Until you generate web push keys in Workspace settings > Web push, requests return 400 with Web push is not set up for this workspace.
The message goes to the person's eligible browsers, and to chooses which of them receive it. If the message has a Website, only browsers that subscribed on that website are eligible. Browsers don't use the platform, sound, and custom_payload fields from the transactional push request, so this endpoint ignores them.
When auto_create creates a new message, the message has no text of its own, so include message in every request until you add text to the message in Customer.io. A request for a message with saved text can leave out message to use that text.
Limits: A request can be up to 500KB.
- identifiersrequired
Identifies the person represented by your transactional message by one of, and only one of,
id,email, orcio_id.Identifies the person represented by your transactional message by one of, and only one of,
id,email, orcio_id.- idType: stringrequired
The identifier for the person represented by the transactional message. NOTE: If your workspace identifies people by email, use the
emailidentifier instead.
- transactional
_message _id requiredThe transactional web push message that you want to send. You can call the message by its numerical ID or by the Trigger Name that you assigned to the message in the UI (case insensitive). The message must be a web push message.
- Type: integer · ID (integer)
The ID of the transactional message you want to send.
- Type: booleanauto
_create If
trueand yourtransactional_message_iddoesn't match a message, Customer.io creates a web push message using that value as the Trigger Name. The ID must be a string. A new message sends to all of the person's eligible browsers until you change its Browsers (or To) setting. - Type: object | nullcustom
_data Key-value pairs to deliver with the notification, which your website can read. This overrides the custom data of the transactional message. If you send
null, Customer.io uses the message's own custom data. - Type: objectcustom
_device A browser to add or update on the person's profile before the send.
tostill chooses which browsers receive the message, so settoto the same endpoint to send only to this browser. - Type: booleandisable
_message _retention If true, the message body is not retained in delivery history. Setting this value overrides the value set in the settings of your
transactional_message_id. - Type: stringimage
_url The URL of an image to show in the notification. This overrides the image of the transactional message for this send.
- Type: stringlanguage
Overrides language preferences for the person you want to send your transactional message to. Use one of our supported two- or four-letter language codes.
- Type: stringlink
The URL to open when the person clicks the notification. This overrides the link of the transactional message for this send.
- Type: stringmessagemin length:1
The notification text. This replaces the text of the transactional message for this send, so it can't be blank or only spaces.
- Type: objectmessage
_data An object containing the key-value pairs referenced using liquid in your message.
- Type: booleanqueue
_draft If true, your transactional message is held as a draft in Customer.io and not sent directly to your audience. You must go to the Deliveries and Drafts page to send your message.
- Type: integersend
_at A unix timestamp (seconds since epoch) determining when the message will be sent. The timestamp can be up to 90 days in the future. If this value is in the past, your message is sent immediately.
- Type: booleansend
_to _unsubscribed If false, your message is not sent to unsubscribed recipients. Setting this value overrides the value set in the settings of your
transactional_message_id. - Type: stringtitle
The notification title. This overrides the title of the transactional message for this send.
- Type: stringto
Which of the person's eligible browsers receive the message, overriding the message's Browsers (or To) setting for this send. Use
allfor every eligible browser,last_usedfor the most recently used one, or a browser's subscription endpoint to send to that browser. If you leave it out, the send uses the message's setting. If the endpoint isn't one of the person's eligible browsers, the request still returns200, and the delivery is undeliverable.
- application/json
- application/json
- application/json
- application/json
{
"identifiers": {
"id": "user_123"
},
"transactional_message_id": "booking_confirmed",
"link": "https://www.example.com/bookings/8812",
"message": "Your room at the Harbor Hotel is ready for check-in on May 12.",
"message_data": {
"booking_id": "8812",
"hotel_name": "Harbor Hotel"
},
"title": "Your booking is confirmed",
"to": "last_used"
}
{
"delivery_id": "string",
"queued_at": 1,
"send_at": 1
}Returns a unique ID for the delivery.