POST /messaging/v1/sms/definitions

Creates an SMS send definition.

NameTypeDescription
definitionKeyStringRequired. A unique key for the SMS send definition object.
nameStringRequired. A unique name for the send definition.
content.messageStringRequired. The message content for the send definition. You can personalize the message by including AMPscript in the message body.
statusStringThe state of the send definition. Possible values are active or inactive. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
descriptionStringA description of the send definition.
subscriptions.shortCodeStringRequired. The short or long code to send messages from.
subscriptions.countryCodeStringThe country code associated with the short code. Don’t specify this value for long codes unless your account configuration requires it.
subscriptions.keywordStringRequired. The keyword used to track messages.
subscriptions.autoAddSubscriberBooleanIndicates whether to add a recipient as a short code subscriber by contact key. If this value is false, the message is rejected if the subscriber’s contact key doesn’t exist. The default value is true.
subscriptions.updateSubscriberBooleanIndicates whether to update the subscriber data for the recipient, including their mobile number. The default value is true.
options.urlShortenerOptions.IsLinkShorteningEnabledBooleanIndicates whether to enable URL shortening for URLs in the message body.
options.urlShortenerOptions.isSubscriberTrackingEnabledBooleanIndicates whether to enable subscriber-level tracking for URLs in the message body. The value is true if the value of shortenerType is SFMC.
options.urlShortenerOptions.shortenerTypeStringThe type of URL shortener to use in the send definition. The only accepted value is SFMC.
options.SmsMessageRegulatoryAuthorityTemplateIdStringThe ID of the DLT template used in the SMS. This attribute applies only to senders based in India.

If the value of updateSubscriber is true, then autoAddSubscriber must also be true. The API returns an error if updateSubscriber is true but autoAddSubscriber is false.

NameTypeDescription
requestIdStringA unique identifier for the request.
nameStringThe name of the SMS send definition.
definitionKeyStringThe unique key of the SMS send definition.
definitionIdStringA unique identifier for the send definition.
descriptionStringA description of the send definition.
statusStringThe state of the send definition. Possible values are Active, Inactive, or Deleted.
createdDateStringThe date and time when the definition was created.
modifiedDateStringThe date and time when the definition was last modified.
content.messageStringThe message content for the send definition.
subscriptions.shortCodeStringThe short or long code associated with the send definition.
subscriptions.countryCodeStringThe country code associated with the short code for the send definition.
subscriptions.keywordStringThe keyword used to track messages.
subscriptions.autoAddSubscriberBooleanIndicates whether to add a recipient as a short code subscriber by contact key.
subscriptions.updateSubscriberBooleanIndicates whether the subscriber data for the recipient is updated.
options.urlShortenerOptions.IsLinkShorteningEnabledBooleanIndicates whether URL shortening is enabled for URLs in the message body.
options.urlShortenerOptions.isSubscriberTrackingEnabledBooleanIndicates whether subscriber-level tracking is enabled for URLs in the message body.
options.urlShortenerOptions.shortenerTypeStringThe type of URL shortener used in the send definition.
options.SmsMessageRegulatoryAuthorityTemplateIdStringThe ID of the DLT template used in the SMS.

To associate a short code to a send definition, use the alphabetic countryCode and numeric shortCode attributes.

A successful request produces a 201 Created response that includes information about the send definition, as shown in this example.

To associate a long code or international phone number to a send definition, add the numeric country code at the beginning of the phone number. Then, use this number as the shortCode attribute. Don't use the alphabetic countryCode attribute unless your account configuration requires it.

A successful request produces a 201 Created response that includes information about the send definition, as shown in this example.

ResponseReason
201 CreatedSend definition created.
409 ConflictSend definition exists on the server.
400 Bad RequestInvalid request.
403 ForbiddenFailed to pass authorization.
500 Server ErrorInternal error.