POST /push/v1/message

Overview

Creates a push message template for sending to a list of subscribers or an audience inclusion list or data extension. You can personalize each message for each subscriber using personalization strings or AMPscript lookups from a data extension within a single push message definition. You can also pass the text of the message to override the message contents specified in the definition for API-driven personalization.

JSON Parameters

NameTypeDescription
messageTypeintegerRequiredIndicates the type of message to create using the following integer values: 1 - Outbound (default), 3 - Location Entry, 4 - Location Exit, 5 - Beacon, 8 - Inbox
contentTypeintegerRequiredIndicates the content included within the message using the following integer values: 1 - Alert (default), 2 - Inbox, 3 - Inbox+Alert
namestringRequiredName of the message. Must be 100 or fewer characters. For Content Builder messages, use this format: content name-unique identifier. For example: 'my test content message-0debaa7a11e11b0a00b12345ef384b1z'.
applicationarrayRequiredApp used to send message
application.idstringRequiredThe ID of the application
application.namestringRequiredThe name of the application
alertstringMessage displayed on the mobile device
soundstringUsed to override the value on the push message definition. Indicates the sound file to play when the push message arrives on the mobile device. Name must include 100 or less characters.
badgeintegerAvailable for both iOS and Android. For iOS SDK version 4.9.5 and newer: Overrides the value on the push message definition. Badge count displays this number in a badge on the app and increments this number by one for each new unread message. For older iOS SDK versions: Overrides the value on the push message definition. Badge count does not increment.
content-availableintegerInteger value indicating the availability of content for an application enabled to use background push. Set this value to 1 to deliver the message as a silent push. This parameter applies only to apps integrated with the background push functionality available in iOS and Android. Note that you can use background push functionality in all apps with iOS 7 and Newsstand apps in iOS 6.
openDirectstringUsed to override the value on the push message definition. This value determines the location within the app that an app user views when they open that app via a push message. Assigned values must include 15 or less characters.
keysarrayUsed to override the value on the push message definition. An array of Key/Value pairs that correspond to customer values defined in MobilePush.
customarraySpecify the actual request body of the push message to precisely align that request body to your specifications.
sendInitiatorintegerIndicates the method used to initiate the send for a push message using the following integer values: 0 - UI-based send, 1 - API (default), 2 - Automation, 3 - Journey Builder
startDatedateDate and time when the message becomes available for sends. Uses a default value of the message creation time.
endDatedateDate and time when the message is no longer available for sends. This optional parameter applies only to messages whose contentType is CloudPage or Alert+CloudPage. endDate must be after startDate.
messagesPerPeriodintegerInteger value indicating the number of messages that can send during a specified time period to throttle the volume of users responding to the notification. Use only when sendInitiator value equals 0.
minutesPerPeriodintegerInteger value indicating the number of minutes included in a specified time period. Use only when sendInitiator value equals 0.
numberOfPeriodsintegerIndicates the time span of the period using the following integer values: 1 - Year, 2 - Month, 3 - Week, 4 - Day, 5 - Hour
isRollingPeriodbooleanBoolean value indicating whether the limit resets after a rolling time period window or ends at a specified time
messageLimitintegerInteger values indicating the total number of times a messages displays on a mobile device
titlestringThe title to be used in place of the message's original title.
subtitlestringThe subtitle to be used in place of the message's original subtitle. This setting applies only to push notification alerts.
mutable-contentbooleanIf true, rich push functionality is enabled for the message.
tzBasedbooleanBoolean value indicating whether a send occurs based on the specified time zone for a mobile device, as reflected in the contact record. To ensure timely delivery for each timezone, make sure that any dependent data extensions and audiences are available to be refreshed up to 14 hours prior to the scheduled send time. Uses a default value of false. Use only when sendInitiator value equals 0.
tzPastSendActionstringIndicates the action to perform when a time-zone-based send occurs and that send time already passed for some time zones. Uses the following string values: 1 - Send immediately (default), 2 - Send at scheduled time, next day, 3 - Never send
scheduleTzOffsetintegerInteger value indicating the time zone offset. Uses a default value of -6.
scheduledTzSupportsDstbooleanBoolean value indicating whether the scheduled time zone supports Daylight Savings Time. Uses a default value of false.
inclusionListsarrayArray of list ID values indicating the lists that will receive the send. Use only when sendInitiator value equals 0.
exclusionListsarrayArray of list ID values indicating the lists excluded from receiving the send. Use only when sendInitiator value equals 0.
statusintegerIndicates the status of the message using the following integer values:: 1 - Draft, 2 - Active (default), 3 - Inactive, 4 - Deleted
pageIdintegerInteger values indicating the page associated with the message for CloudPage and Alert+CloudPage sends
urlstringString value indicating the URL for the page associated with the message for CloudPage and Alert+CloudPage sends
subjectstringString value indicating the subject line used for the message
mediaarrayRich media to include in the message
media.androidUrlstringURL for the media to send to Android devices
media.iosUrlstringURL for the media to send to iOS devices
media.altstringText to display if the message cannot include the specified rich media
geofencesarrayArray of string values indicating the geofences associated with the message send. Use only when sendInitiator value equals 1.

Usage

You can create different types of messages using this call. Ensure that you include the correct properties for each message type using the list below.

API Rate Limits: We might enforce a rate limit if you perform more than 100 requests per minute or have more than 1,000 active push message templates. Rather than create a unique push message template for each subscriber, use personalization strings, AMPscript, or message field overrides when sending a push message.

Outbound Alert Message

  • messageType
  • contentType
  • name (required)
  • application (required)
  • alert
  • sound
  • badge
  • content-available
  • openDirect
  • keys
  • custom
  • sendInitiator
  • startDate (required)
  • messagesPerPeriod
  • minutesPerPeriod
  • tzBased
  • tzPastSendAction
  • scheduledTzOffset
  • scheduledTzSupportsDst
  • inclusionLists
  • exclusionLists
  • inclusionDataExtensions
  • exclusionDataExtensions
  • status
  • media
  • title
  • subtitle

Location Entry or Exit Alert Message

  • messageType
  • contentType
  • name (required)
  • application (required)
  • alert (required)
  • sound
  • badge
  • openDirect
  • keys
  • custom
  • sendInitiator
  • startDate (required)
  • messagesPerPeriod
  • numberOfPeriods
  • periodType
  • isRollingPeriod
  • messageLimit
  • scheduledTzOffset
  • scheduledTzSupportsDst
  • geofences (required)
  • status
  • media
  • title
  • subtitle

Location Entry or Exit Alert+Page Message

  • messageType
  • contentType
  • name (required)
  • application (required)
  • alert (required)
  • sound
  • badge
  • keys
  • custom
  • sendInitiator
  • startDate (required)
  • messagesPerPeriod
  • numberOfPeriods
  • periodType
  • isRollingPeriod
  • messageLimit
  • scheduledTzOffset
  • scheduledTzSupportsDst
  • geofences (required)
  • status
  • pageId (required)
  • url (required)
  • media
  • title
  • subtitle

Inbox Only Message

  • messageType
  • contentType
  • name (required)
  • application (required)
  • keys
  • custom
  • sendInitiator
  • startDate (required)
  • tzBased
  • tzPastSendAction
  • scheduledTzOffset
  • scheduledTzSupportsDst
  • inclusionLists
  • exclusionLists
  • inclusionDataExtensions
  • exclusionDataExtensions
  • status
  • pageId (required)
  • url (required)
  • subject (required)

Inbox+Alert Message

  • messageType
  • contentType
  • name (required)
  • application (required)
  • alert (required)
  • sound
  • badge
  • content-available
  • openDirect
  • keys
  • custom
  • sendInitiator
  • startDate (required)
  • messagesPerPeriod
  • minutesPerPeriod
  • tzBased
  • tzPastSendAction
  • scheduledTzOffset
  • scheduledTzSupportsDst
  • inclusionLists
  • exclusionLists
  • inclusionDataExtensions
  • exclusionDataExtensions
  • status
  • pageId (required)
  • url (required)
  • subject (required)
  • media
  • title
  • subtitle

Example Request

Example Response

If all values in the request are valid, the API returns a response with the message parameters.

If the request was not valid, the API returns a 400 response with details on the error. The example below includes the error for not including any DeviceTokens values:

Possible Errors

MessageDetails
Message id {0} is not valid.The messageID value provided in the URL was not in a valid format.
Message {0} is not valid for the client.The messageID value included in the URL does not match a valid value within the account.
The status for Message {0} is not set to Active.The status for the message used in the call must be set to Active.
The count of DeviceTokens cannot be zero.At least one value needs to be passed in the DeviceTokens parameter.
One or more DeviceTokens must be specified in order to send a message.The call does not include a parameter for the DeviceToken value.
Message is blank and no override message was provided.The message definition within the MobilePush interface does not have a message specified so the messageText parameter is required.
Cannot override message text with a blank message.The parameter for Override was set to true, but the value passed for messageText does not contain a value.
MessageText is not applicable when Override is false.The call does not require passing a value for messageText if Override is set to true.
{0} is not a valid send time (yyyy-MM-dd HH).The call includes an invalid send time.