Overview
Use this API to update an existing Subscription’s properties bysubscription_id
.
This endpoint is primarily used by the OneSignal SDK to manage subscription state.
Most external use cases are better served by the Update Subscription by token API, which can use the Email Address or Phone Number as the token
or the Update User API, which allows for updating user-level data.
For email opt-outs, it’s recommended to use the Unsubscribe Email (with token) API instead. This avoids the need to store or manage the
subscription_id
.How to use this API
Required:subscription_id
To update a subscription, you must know the subscription_id
. This is a UUID generated by OneSignal and is immutable.
- You can retrieve a subscription ID by querying the User object.
- See the Subscriptions guide for an explanation of how subscription IDs are generated and used.
You cannot update the
type
of a Subscription. If the type
is incorrect:- Use Delete Subscription to remove the incorrect entry.
- Use Create Subscription by alias to recreate the Subscription with the correct type.
Path Parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
The unique Subscription ID in UUID v4 format generated by OneSignal. See Subscriptions.
Body
application/json
The subscription's properties.
Response
200
The Subscription updated successfully. This process is asynchronous and may take a few seconds to complete.