Update an SMS template

Use this endpoint to update an existing SMS template.

API at a glance

Description: This API updates an existing SMS/MMS template in your Blueshift account. You can modify the template name, content, message type, link shortening, recommendation schemes, external fetches, and other properties.

Authentication & testing

Testing the API on this page

How to try it here

  • Use your User API Key as the Username (leave Password blank).
  • User API Key Location
  • Select the appropriate API endpoint based on your Blueshift region.
  • API - Select Region
  • Enter the necessary parameters and click Try It to run the request.
Authentication using Base64 encoding

Note for developers

API requests require authentication using HTTP Basic Authentication with an API key. The API key serves as the username, while the password field should be left empty. The format to encode is: your_api_key: (note the trailing colon).

This string must be Base64-encoded and included in the request's Authorization header as follows:

Authorization: Basic encoded_value

You can generate the encoded value using a trusted Base64 encoder.


Postman collection

Try it with Postman: Explore the API using Blueshift's Postman collection.


Things to know before you start

  • Finding template UUID: Template UUIDs can be found from the URL when viewing a template in Blueshift: https://app.getblueshift.com/dashboard#/app/sms_template/<template_uuid>/edit.
  • Required fields: template object with resource is required.
  • MMS requirements: For MMS templates, media_url is required.
  • SMS requirements: For SMS templates, content is required.
  • Removing configurations: Leaving external_fetches or transaction_mixins blank will remove previously added configurations. For account_algorithm_uuid, send null to remove the recommendation scheme.
  • Tag data: Tags must already exist in your account. Format: folder_name:tag1,tag2,tag3.
  • Use case: Best for programmatically updating SMS/MMS templates, bulk template modifications, and automated template management.

Request parameters

Check out the request parameters

Path parameters

ParameterTypeRequiredDescription
template_uuidstring✅ YesThe UUID of the SMS template to update.

Body parameters

ParameterTypeRequiredDescription
templateobject✅ YesTemplate object with resource required. See structure below.
template_propertyobject❌ NoCampaign behavior properties. See structure below.
external_fetchesarray❌ NoExternal fetch UUIDs. Leaving blank removes existing fetches.
transaction_mixinsarray❌ NoTransaction mixin UUIDs. Leaving blank removes existing mixins.

Template object

ParameterTypeRequiredDescription
resourceobject✅ YesTemplate content object. See structure below.
namestring❌ NoSpecify a new name for the template.
tag_datastring❌ NoFolder and tags in format folder_name:tag1,tag2,tag3. Tags must exist in your account.
skip_user_on_external_fetch_errorboolean❌ NoMessage is not sent if external fetch encounters an error. Default: true.

Resource object

ParameterTypeRequiredDescription
contentstring✅ Yes (for SMS)Content of the SMS template. Required for SMS messages.
media_urlstring✅ Yes (for MMS)URL for media in MMS message. Required for MMS messages.
subjectstring❌ NoSubject for MMS template.
shorten_linksboolean❌ NoEnable link shortening for click tracking. Default: true.

Template property object

ParameterTypeDescription
skip_user_on_blank_productsbooleanSkip user if products are blank. Default: true.
skip_user_on_blank_event_productsbooleanSkip user if event products are blank. Default: true.
account_algorithm_uuidstringRecommendation scheme UUID. Leave blank for no change, send null to remove existing scheme.

Example requests & responses

Update SMS template content

Request

curl --request PUT \
     --url https://api.getblueshift.com/api/v1/sms_templates/9da0744e-141d-4c9d-85d7-c89a54ac745b \
     --header 'accept: application/json' \
     --header 'authorization: Basic <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '{
       "template": {
         "name": "Summer Rush",
         "resource": {
           "subject": "Hey, {{user.firstname}}!",
           "content": "Check out our summer sale!",
           "shorten_links": true
         },
         "tag_data": "Regions:USA,China,Brazil,Hong Kong,India,Sweden,Canada",
         "skip_user_on_external_fetch_error": true
       },
       "template_property": {
         "skip_user_on_blank_products": true,
         "skip_user_on_blank_event_products": true,
         "account_algorithm_uuid": "2879b1a3-ee84-4e13-b63c-ad83674c0ca1"
       },
       "external_fetches": [
         {
           "uuid": "e789705f-3eb3-4e2a-a666-648dedae6g86"
         }
       ]
     }'

Response

{
  "name": "John's SMS template",
  "created_at": "2016-08-19T21:53:38.000Z",
  "updated_at": "2020-11-19T12:48:13.000Z",
  "uuid": "41e574b2-72bd-4fad-bc5b-6b0aa0cc04f3",
  "archived": false,
  "author": "John Doe"
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!