PATCH /messaging/v1/sms/definitions/{definitionKey}

Overview 

Updates a specific message definition. It can take up to two minutes for outbound messages to reflect the changes.

URL Parameters 

NameTypeDescription
definitionKeystringRequiredUnique identifier of the definition.

JSON Parameters 

NameTypeDescription
namestringRequiredName of the definition. Must be unique.
content.messagestringRequiredThe message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message.
statusstringOperational state of the definition: active, inactive, or deleted. 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.
descriptionstringUser-provided description of the send definition.
subscriptions.shortCodestringRequiredThe short or long code for the mobile transmissions for each message on this definition.
subscriptions.countryCodestringThe country code associated with the shortCode for the mobile transmissions for each message on this definition. Don’t use for long codes, unless your account configuration requires it.
subscriptions.keywordstringThe keyword used to track messages
subscriptions.autoAddSubscriberbooleanPermits adding a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey doesn’t exist as a subscriber. Default is true.
options.urlShortenerOptions.IsLinkShorteningEnabledbooleanIndicates if URL shortening is enabled for URLs in the message body. The values are true and false. Default is false.
options.urlShortenerOptions.isSubscriberTrackingEnabledbooleanIndicates if subscriber level tracking is enabled for URLs in the message body. The values are true and false. Default is false. The value is true if the value of shortenerType is SFMC.
options.urlShortenerOptions.shortenerTypestringThe type of URL shortener. The values is SFMC.
options.SmsMessageRegulatoryAuthorityTemplateIdstringThe ID of the DLT template used in the SMS. This attribute is available only for customers in India.

Responses 

StatusNameTypeDescription
200  Send definition is updated. Review example response.
 requestIdstringThe unique identifier of this request.
 namestringName of the definition.
 definitionKeystringUnique, user-generated key to access the definition object.
 definitionIdstringA unique object ID.
 descriptionstringUser-provided description of the send definition.
 statusstringOperational state of the definition: active, inactive, or deleted. 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.
 createdDatestringDate the definition was created.
 modifiedDatestringDate and time the definition was most recently changed.
 content.messagestringThe message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message.
 subscriptions.shortCodestringThe short or long code for the mobile transmissions for each message on this definition.
 subscriptions.countryCodestringThe country code associated with the shortCode for the mobile transmissions for each message on this definition. Don’t use for long codes, unless your account configuration requires it.
 subscriptions.keywordstringThe keyword used to track messages
 subscriptions.autoAddSubscriberbooleanAllows you to add a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey doesn’t exist as a subscriber. Default is true.
 subscriptions.updateSubscriberbooleanUpdates the recipient subscriber data including mobile number. Default is true.
options.urlShortenerOptions.IsLinkShorteningEnabledbooleanIndicates if URL shortening is enabled for URLs in the message body. The values are true and false. This attribute is available only for orgs using Hyperforce.
options.urlShortenerOptions.isSubscriberTrackingEnabledbooleanIndicates if subscriber level tracking is enabled for URLs in the message body. The values are true and false. The value is true if the value of shortenerType is SFMC. This attribute is available only for orgs using Hyperforce.
options.urlShortenerOptions.shortenerTypestringThe type of URL shortener. The values is SFMC. This attribute is available only for orgs using Hyperforce.
options.SmsMessageRegulatoryAuthorityTemplateIdstringThe ID of the DLT template used in the SMS. This attribute is available only for customers in India. Ensure that SMS_DLT_TEMPLATES business rule is enabled.

Usage 

Example Request 

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2PATCH /messaging/v1/sms/definitions/2FA_order_accounts
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7  "description": "description updated",
8  "content": {
9        "message": "In future"
10    },
11    "subscriptions": {
12        "shortCode": "519000242",
13        "countryCode": "US",
14        "keyword": "API"
15    },
16    "options": {
17        "urlShortenerOptions": {
18            "isLinkShorteningEnabled": true,
19            "isSubscriberTrackingEnabled": false,
20            "shortenerType": "SFMC"
21        },
22        "smsMessageRegulatoryAuthorityTemplateId": "1107170833298425627"
23    }
24}

Example Response 

1HTTP/1.1 200 OK
2{
3  "requestId": "582bec09-6d04-4222-bbba-cea616495596",
4  "name": "account-reset",
5  "definitionKey": "account-reset",
6  "description": "description updated",
7  "status": "Active",
8  "createdDate": "2024-07-10T04:20:00",
9  "modifiedDate": "2024-07-10T04:30:00",
10  "content": {
11    "message": "In future"
12    },
13  "subscriptions": {
14    "shortCode": "519000242",
15    "countryCode": "US",
16    "autoAddSubscriber": true,
17    "updateSubscriber": true,
18    "keyword": "API"
19   },
20  "options": {
21    "urlShortenerOptions": {
22        "isLinkShorteningEnabled": true,
23        "isSubscriberTrackingEnabled": false,
24        "shortenerType": "SFMC"
25   },
26   "smsMessageRegulatoryAuthorityTemplateId": "1107170833298425627"
27 }
28}

HTTP Responses 

ResponseReason
200 OKSend definition is updated. Review example response.
400 Bad RequestInvalid request
403 ForbiddenFailed to pass authorization.
500 Server ErrorInternal error

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!