Overview
This endpoint allows you to update an existing push, email, or SMS template in your OneSignal app. Once updated, the changes are applied immediately and reflected across both the Dashboard and API when using the associatedtemplate_id
.
Templates are updated using the same structure as when creating templates.
How to use this API
To update a template, you must supply:- Your OneSignal App ID found in Keys & IDs.
- The Template ID
Template ID
Each template has a unique OneSignal-generatedtemplate_id
(UUID v4). You can find it:
- Using the View Templates API
- In the OneSignal Dashboard under Messages > Templates > Options > Copy Template ID

Copy Template ID
Channel-Specific Requirements
Push Templates
- The
contents
property must use theen
(English) key along with other languages you want to support. - All Push Notification Properties are valid.
- All platforms are enabled by default. To limit, explicitly enable desired ones (e.g.,
isAndroid: true
disables iOS and Web).
Email Templates
- Set
isEmail: true
- Include
email_subject
andemail_body
- All Email Channel Properties are supported.
SMS Templates
- Set
isSMS: true
- All SMS Channel Properties are supported.
Headers
Your App API key with prefix Key
. See Keys & IDs.
Path Parameters
Query Parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
Body
An internal name you set to help organize and track Templates. Maximum 128 characters.
The main message body with language-specific values. Supports Message Personalization.
Required to be set true
for email templates.
The body of the email in HTML format. Required for email templates. Supports Message Personalization.
Required to be set true
for SMS templates.
Add personalization to your templates programmatically. No need to upload a CSV. See Dynamic Content for details.
"{\"campaign_id\": {\"A\": {\"title\": \"Custom Title A\", \"message\": \"Custom Message A\", \"url\": \"https://www.onesignal.com\"}, \"B\": {\"title\": \"Custom Title B\", \"message\": \"Custom Message B\", \"url\": \"https://www.onesignal.com/login\"}}}"
Response
200
The ID of the template in UUID v4 format.
"15b739e8-93f9-4840-8c94-e115c30afddd"
An internal name you set to help organize and track Templates. Maximum 128 characters.
The date and time the template was created in ISO 8601 format.
The date and time the template was last updated in ISO 8601 format.
Options are: push
, email
, and SMS
.