Update a push template

Use this endpoint to update a push template.

API at a glance

Description: This API updates an existing push notification template in your Blueshift account. You can modify the template content, target devices, 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/push_template/studio/<TEMPLATE_UUID>/edit/info.
  • Optional fields: All body parameters are optional. Only include fields you want to update.
  • Device targeting: Choose apple, android, or both.
  • JSON payload: The content field should contain the JSON payload for push notifications. Leave GCM payload empty for iOS-only notifications, or leave APNs payload empty for Android-only notifications.
  • 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 push templates, bulk template modifications, and automated template management.

Request parameters

Check out the request parameters

Path parameters

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

Body parameters

Note: All body parameters are optional. Only include fields you want to update.

ParameterTypeRequiredDescription
push_templateobject❌ NoPush template object. 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.

Push template object

ParameterTypeDescription
message_typestringOnly json is supported. Default: json.
device_typestringTarget device: apple, android, or both.
contentstringSpecify the JSON payload of the notification. Leave GCM empty for iOS-only, APNs empty for Android-only.
tag_datastringFolder and tags in format folder_name:tag1,tag2,tag3. Tags must exist in your account.
skip_user_on_external_fetch_errorbooleanMessage is not sent if external fetch encounters an error. 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 push template content

Request

curl --request PUT \
     --url https://api.getblueshift.com/api/v1/push_templates/9da0744e-141d-4c9d-85d7-c89a54ac745b \
     --header 'accept: application/json' \
     --header 'authorization: Basic <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '{
       "push_template": {
         "message_type": "json",
         "device_type": "both",
         "content": "{\"GCM\":{\"notification\":{\"title\":\"Notification Content\"}},\"APNS\":{\"aps\":{\"alert\":\"Hello world, now we'\''re cookin!\"}}}",
         "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": "3879b1a3-ee84-5e13-b63c-ad83674c0ba1"
       },
       "external_fetches": [
         "e789705f-3eb3-4e2a-a666-648dedae6g86",
         "af9bbbd3-7133-4ab4-80a2-938b67c12d34"
       ]
     }'

Response

{
  "status": "OK"
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!