Create a duplicate of a template in another app. The new template will be completely separate from the original (including having a new template_id) but will be created with all the same content.
Overview
This endpoint lets you to transfer an existing template from an app_id
provided in the query parameter, to the target_app_id
specified in the body parameter.
The app_id
and target_app_id
must be within the same Organization.
This endpoint requires your Organization API key, not your app REST API key, because it involves permission on more than app at once. Make sure your user has admin access to both apps when you make this request or it will fail with permission denied.
How to use this API
Get the app IDs of the current app (app_id
) that has the template and the app in which you want to copy that template to (target_app_id
). See Keys & IDs for details on getting the App IDs.
Template ID
To transfer a specific template, it must be identifiable via the required template_id
path parameter. This is the UUID found in the URL, when viewing the template you intend to view. This is added as a path parameter in your request.
Example
Transferring a template between apps.
curl --location 'https://api.onesignal.com/templates/<Template Id>?app_id=<APP ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Key YOUR_ORG_API_KEY' \
--data '{
"target_app_id":"<Target App ID>"
}'