Update subscriptions
Learn how to create and update subscriptions for your users
Description
This route facilitates the management of subscriptions, enabling users to create, update, and delete subscriptions effectively.
Users are allowed only one subscription per metric, ensuring simplicity and clarity in tracking metrics. When adjusting thresholds on existing subscriptions, the new parameters overwrite the previous settings, ensuring seamless customization.
Setting a threshold of 0 for a subscription promptly deletes it.
Endpoint
POST https://sentry.aleno.ai/subscriptions
Query parameters
No query parameters.
Payload
subscriptions
required
List of SubscriptionCreateData
List that contains data related to subscriptions you want to create. Data description can be found bellow
SubscriptionCreateData description
SubscriptionCreateData is an object that describes a subscription you want to create.
userId
required
string
The ID of the user for this subscription.
metricKey
required
string
The key of the metric for this subscription.
threshold
required
number
The value of the threshold for alert triggering. Threshold unit is % (threshold 50 means 50%) of variation of the metric on which on alert should be triggered.
Must be in range: 0 U [0.0001, 10000].
Using a threshold of 0 will dekete the subscription.
CURL example
Result
The result of this operation is an object that includes a list of Subscription objects, representing the updated subscriptions. Additionally, it provides the count of deleted subscriptions.
upsertedSubscriptions
The list of subscrptions that have either been created or updated during the update.
numberDeletedSubscriptions
number
The number of subscriptions that have been deleted during the update
Last updated