Update template
Update existing OneSignal message templates for push, email, or SMS. Changes apply immediately across dashboard and API usage via the template_id
reference.
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 associated template_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 (UUID)
Template ID
The template_id
is a UUID that uniquely identifies the template.
You can find it in the following ways:
- Use the View Templates API.
- In the OneSignal Dashboard under Messages > Templates:
- Use Options > Copy Template ID
Copy Template ID
- View it directly in the template URL
Template ID in the URL
- Use Options > Copy Template ID
Channel-Specific Requirements
Push Templates
- Set the
contents
property with theen
(English) key. - All Push Notification Properties are valid.
- Platforms are enabled by default. To limit, explicitly enable desired ones (e.g.,
isAndroid: true
disables iOS and Web). See Target Specific Platforms.
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
Response
200
The response is of type object
.