PATCH
/
apps
/
{app_id}
/
subscriptions
/
{subscription_id}
/
owner
Transfer subscription
curl --request PATCH \
  --url https://api.onesignal.com/apps/{app_id}/subscriptions/{subscription_id}/owner \
  --header 'Content-Type: application/json' \
  --data '{
  "identity": {
    "external_id": "test_external_id",
    "onesignal_id": "<string>"
  }
}'
"{\n    \"identity\": {\n        \"external_id\": \"the-external-id-transferred-to\",\n        \"onesignal_id\": \"the-onesignal-id-transferred-to\"\n    }\n}"

Overview

Use this API to transfer a Subscription from one user to another within the same OneSignal app. It is highly recommended to use our web and mobile SDKs to set and update the External ID with the login method instead of this API. Your app or website may continue to be setting the wrong External ID. Make sure to only use this API if you are setting the same External ID within your app or website. This is typically used when:
  • You want to reassign an existing push, email, or SMS Subscription to a new or updated user.
  • You have changed how you’re identifying users (e.g., migrating from anonymous to known users).
  • Subscriptions cannot be transferred across different OneSignal apps.
  • For email and SMS Subscriptions, you can instead create new ones using Create User.
  • For push Subscriptions, platform limitations may apply—see Subscriptions for details.

How to Use This API

Required Path Parameter: subscription_id

You must know the subscription_id of the subscription to be transferred. This is a unique UUID assigned by OneSignal.

Required Body Parameter: identity (object)

This specifies the user the subscription should be moved to. Only one alias should be used per request. You can identify the target user using one of:

Path Parameters

app_id
string
required

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

subscription_id
string
required

The unique Subscription ID in UUID v4 format to transfer to the new user.

Body

application/json

Response

200
application/json

200

The response is of type object.