Transfer a subscription to a different user.
Overview
Use this API to transfer a subscription from one user to another within the same OneSignal app.
You cannot transfer subscriptions across OneSignal apps. Email and SMS subscriptions can simply be recreated on the other app with the Create user API. However, push subscriptions have more limitations depending on the platform. See the import sections of the Subscriptions docs for details.
How to use this API
You must know the subscription_id
of the subscription you want to transfer and the alias of the User in which to transfer the subscription. The subscription_id
set in the path parameters will be moved to the user identified in the identity
body parameter.
If you don't know the subscription_id
you can also use the Create user or Create subscription (by alias) APIs instead. If the provided type
and token
of the Subscription exist within the OneSignal app, it will be transferred to the new user alias you set in the request.
Find the subscription ID
If you don't save the subscription_id
somewhere, then you can use the View user API to pull all the subscriptions
associated with the "old" user and find the corresponding id
(the subscription_id
) you want to transfer.
Identify the user
The identity
object in the request body will identify the user that the subscription should be moved to. The external_id
is the most common and recommended alias to use, but you can also use the onesignal_id
or custom Aliases.
Only one alias should be used in the identity
object. The transfer is completed synchronously.