Create template
Create reusable message templates for push, email, and SMS channels. Templates can be accessed through both the dashboard and API using a template_id.
post/templates
Request
- Base URLhttps://api.onesignal.com
- URLhttps://api.onesignal.com/templates
- Authnone required
Headers
Authorizationstring required
Your App API key with prefix Key . See Keys & IDs.
Content-Typestring required
Request body
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 created template record. content reflects the configuration as stored. Fields not relevant to the chosen channel are returned as null.
Changes
No recorded changes to this operation across all 2 revisions of this API.