Path parameters
-
The SID of the Service to create the resource under.
Body
-
Action string
The actions to display for the notification. For APNS, translates to the
aps.category
value. For GCM, translates to thedata.twi_action
value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. -
Deprecated.
-
The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS
Payload
item, therefore theaps
key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the APNS documentation for more details. We reserve keys that start withtwi_
for future use. Custom keys that start withtwi_
are not allowed. -
Body string
The notification text. For FCM and GCM, translates to
data.twi_body
. For APNS, translates toaps.alert.body
. For SMS, translates tobody
. SMS requires either thisbody
value, ormedia_urls
attribute defined in thesms
parameter of the notification. -
The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to
data
in the FCM and GCM payloads. FCM and GCM reserve certain keys that cannot be used in those channels. For APNS, attributes ofdata
are inserted into the APNS payload as custom properties outside of theaps
dictionary. In all channels, we reserve keys that start withtwi_
for future use. Custom keys that start withtwi_
are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. -
DeliveryCallbackUrl string
URL to send webhooks.
-
Deprecated.
-
The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the FCM documentation for more details. Target parameters
to
,registration_ids
,condition
, andnotification_key
are not allowed in this parameter. We reserve keys that start withtwi_
for future use. Custom keys that start withtwi_
are not allowed. FCM also reserves certain keys, which cannot be used in that channel. -
The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the GCM documentation for more details. Target parameters
to
,registration_ids
, andnotification_key
are not allowed. We reserve keys that start withtwi_
for future use. Custom keys that start withtwi_
are not allowed. GCM also reserves certain keys. -
Identity array[string]
-
Priority string
The priority of the notification. Can be:
low
orhigh
and the default ishigh
. A value oflow
optimizes the client app's battery consumption; however, notifications may be delivered with unspecified delay. For FCM and GCM,low
priority is the same asNormal
priority. For APNSlow
priority is the same as5
. A value ofhigh
sends the notification immediately, and can wake up a sleeping device. For FCM and GCM,high
is the same asHigh
priority. For APNS,high
is a priority10
. SMS does not support this property.Values are
high
orlow
. -
Segment array[string]
The Segment resource is deprecated. Use the
tag
parameter, instead. -
The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding
form
parameter of the Twilio Message resource. These parameters of the Message resource are supported in snake case format:body
,media_urls
,status_callback
, andmax_price
. Thestatus_callback
parameter overrides the corresponding parameter in the messaging service, if configured. Themedia_urls
property expects a JSON array. -
Sound string
The name of the sound to be played for the notification. For FCM and GCM, this Translates to
data.twi_sound
. For APNS, this translates toaps.sound
. SMS does not support this property. -
Tag array[string]
A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag
all
is available to notify all Bindings in a Service instance. Similarly, the implicit tagsapn
,fcm
,gcm
,sms
andfacebook-messenger
are available to notify all Bindings in a specific channel. -
Title string
The notification title. For FCM and GCM, this translates to the
data.twi_title
value. For APNS, this translates to theaps.alert.title
value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. -
ToBinding array[string]
The destination address specified as a JSON string. Multiple
to_binding
parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. -
Ttl integer
How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property.
curl \
-X POST https://notify.twilio.com/v1/Services/{ServiceSid}/Notifications \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'Action=string&Body=string&DeliveryCallbackUrl=string&Identity=string&Priority=high&Segment=string&Sound=string&Tag=string&Title=string&ToBinding=string&Ttl=42'
{
"Action": "string",
"Body": "string",
"DeliveryCallbackUrl": "string",
"Identity": [
"string"
],
"Priority": "high",
"Segment": [
"string"
],
"Sound": "string",
"Tag": [
"string"
],
"Title": "string",
"ToBinding": [
"string"
],
"Ttl": 42
}
{
"Action": "string",
"Body": "string",
"DeliveryCallbackUrl": "string",
"Identity": [
"string"
],
"Priority": "high",
"Segment": [
"string"
],
"Sound": "string",
"Tag": [
"string"
],
"Title": "string",
"ToBinding": [
"string"
],
"Ttl": 42
}
{
"account_sid": "string",
"action": "string",
"body": "string",
"date_created": "2023-05-04T09:42:00+00:00",
"identities": [
"string"
],
"priority": "high",
"segments": [
"string"
],
"service_sid": "string",
"sid": "string",
"sound": "string",
"tags": [
"string"
],
"title": "string",
"ttl": 42
}
{
"account_sid": "string",
"action": "string",
"body": "string",
"date_created": "2024-05-04T09:42:00+00:00",
"identities": [
"string"
],
"priority": "high",
"segments": [
"string"
],
"service_sid": "string",
"sid": "string",
"sound": "string",
"tags": [
"string"
],
"title": "string",
"ttl": 42
}