Send a transactional push
Send a transactional push. You send a message using a transactional_message_id for a transactional push message template composed in the user interface. You can optionally override any of the template values at send time. The transactional_message_id can be either the numerical ID for the template or the Trigger Name that you assigned the template.
You can find your transactional_message_id from the code sample in the Overview tab for your transactional message in the user interface, or you can look up a list of your transactional messages through the App API.
- 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 message template that you want to use for your message. You can call the template by its numerical ID or by the Trigger Name that you assigned to the template in the UI (case insensitive).
- 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 record, Customer.io creates an empty record using that value as the Trigger Name. The ID must be a string. If the name already belongs to another channel, the request fails with400, and numeric IDs ignore this setting. See details. - Type: objectcustom
_data Optional key/value pairs you want to attach to the push payload. Firebase only supports string values. This overrides the Custom Data from your transactional template.
- Type: objectcustom
_device A device to perform an upsert operation at the time of send. The device will be added/updated on the profile from the Identifiers block.
- Type: objectcustom
_payload Optional key/value pairs you want to attach to the push payload. Firebase only supports string values. This overrides all other payload values, including the Custom Payload from your transactional template.
- 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 An image URL to show in the push. This overrides Image from the transactional template (referenced by
transactional_message_id). - 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
A deep link to open when the push is tapped. This overrides Link from the transactional template (referenced by
transactional_message_id). - Type: stringmessage
The message body for your notification. This overrides the notification body of the transactional template (referenced by
transactional_message_id). - 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: stringenumsound
For iOS Only: your notification can alert users with the device's default notification sound or play no sound at all.
values- default
- none
- Type: stringtitle
The title for your notification. This overrides the title of the transactional template (referenced by
transactional_message_id). - Type: stringenumto
The devices you want to send this push to—
all,last_used, or a custom device token from the identified profile. Defaults toalland overrides theTovalue from your transactional template.values- all
- last
_used - $device
_token
- application/json
- application/json
- application/json
curl https://api.customer.io/v1/send/push \
--request POST \
--header 'X-Workspace-Id: 100' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"transactional_message_id": 44,
"title": "Did you really login from a new location?",
"identifiers": {
"id": 12345
},
"message_data": {
"password_reset_token": "abcde-12345-fghij-d888",
"account_id": "123dj"
}
}'
{
"delivery_id": "string",
"queued_at": 1,
"send_at": 1
}Returns a unique ID for the delivery.