v1

latestOpenAPI 3.1.02026-07-26497885.9 KB

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.

patch/templates/{template_id}?app_id={app_id}

Path parameters

template_idstring required

The template ID in UUID v4 format. See Templates.

Query parameters

app_idstring required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

Headers

Authorizationstring required

Your App API key with prefix Key . See Keys & IDs.

Request body

namestring required

An internal name you set to help organize and track Templates. Maximum 128 characters.

isEmailboolean

Required to be set true for email templates.

email_bodystring

The body of the email in HTML format. Required for email templates. Supports Message Personalization.

isSMSboolean

Required to be set true for SMS templates.

dynamic_contentobject

Add personalization to your templates programmatically. No need to upload a CSV. See Dynamic Content for details.

Example request

{
  "dynamic_content": {
    "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

The updated template record. Same shape as POST /templates.

idstring uuid required

Template ID in UUID v4 format.

namestring

Internal label set when the template was created or last updated. Maximum 128 characters.

channel'push' | 'email' | 'SMS'

The primary channel the template is configured for. Note: SMS is uppercased while the others are lowercased.

created_atstring date-time

ISO-8601 timestamp when the template was created.

updated_atstring date-time

ISO-8601 timestamp when the template was last updated.