POST
/
templates
/
{template_id}
/
copy_to_app?app_id=
{app_id}
curl --request POST \
  --url 'https://api.onesignal.com/templates/{template_id}/copy_to_app?app_id={app_id}' \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "target_app_id": "YOUR_OTHER_APP_ID"
}'
{
  "success": true
}

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 and target_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

Authorization
string
default:Key YOUR_ORGANIZATION_API_KEY
required

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

Path Parameters

template_id
string
default:YOUR_TEMPLATE_ID
required

The template ID in UUID v4 format. See Templates.

Query Parameters

app_id
string
default:YOUR_APP_ID
required

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

Body

application/json

Response

200
application/json

200

The response is of type object.