Copy template to another app
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 API allows you to copy a template from one app (app_id
) to another (target_app_id
). The duplicated template will have the same content as the original, but a new unique template_id
.
Authorization Required: You must use your Organization API key, not an app-level REST API key.
Permissions Note: Your user must have admin-level access to both the source and target apps. If not, the request will fail with a “permission denied” error.
Requirements
- Organization Membership: Both the
app_id
andtarget_app_id
must belong to the same Organization. - Organization API Key: Required for this operation.
- Admin Access: Required for both source and target apps.
Parameters
template_id
(path param): UUID of the template to be copied.app_id
(query param): ID of the app where the original template exists.target_app_id
(body param): ID of the app where the template will be duplicated.
How to Use
1. Locate the Template ID
Get the template_id
using:
- The View templates API, or
- Your OneSignal Dashboard:
-
Go to Messages > Templates
-
Use Options > Copy Template ID
Copy Template ID
-
Or extract it from the URL when viewing the template:
Template ID in the URL when viewing the template
-
2. Get App IDs
Refer to Keys & IDs to find your app_id
and target_app_id
.
Response
The response will include:
- The new
template_id
for the copied template - Confirmation of successful creation
- Any warnings if applicable (e.g., limited fields copied)
Headers
Your Organization 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
.