Personalized Alerts API Code Samples
Selection of code samples that demonstrate the use of the Personalized Alerts API. Copy and edit these code samples to suit your needs.
When using the code samples, remember to replace:
- {vanity_name} with your tenant name
- {api_key} with your API key
- {security_token} with a valid security token
These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Personalized Alerts" in API Reference.
Retrieve personalized alerts
Use this sample request to retrieve all the personalized alerts you have access to.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/alerts' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns your personalized alerts.

{
"ownedAlerts": [
{
"alertId": "00000000-0000-0000-0000-000000000000",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
},
"displayName": "Critical Employee Turnover",
"isEnabledForUser": true
}
],
"sharedAlerts": [
{
"alertId": "00000000-0000-0000-0000-000000000000",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": true,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"sameMetricOtherTime": {
"timePeriod": {
"samePeriodPreviousYear": {}
}
}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.02
}
}
]
}
}
},
"displayName": "Studio Critical Employee Turnover alert",
"isEnabledForUser": true
}
]
}
Retrieve a personalized alert
Use this sample request to retrieve a specific personalized alert.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/alerts/00000000-0000-0000-0000-000000000000' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns the personalized alert details.

{
"alertId": "00000000-0000-0000-0000-000000000000",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": true,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"sameMetricOtherTime": {
"timePeriod": {
"samePeriodPreviousYear": {}
}
}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.02
}
}
]
}
}
},
"displayName": "Studio alert",
"isEnabledForUser": true
}
Create a personalized alert
Use this sample request to create a new personalized alert.
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1alpha/alerts' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "API Critical Employee Alert",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
}
}'
The response returns the personalized alert details.

{
"alertId": "00000000-0000-0000-0000-000000000000",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
},
"displayName": "API Critical Employee Alert",
"isEnabledForUser": true
}
Update a personalized alert
Use this sample request to update an existing personalized alert.
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1alpha/alerts/00000000-0000-0000-0000-000000000000' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "Updated API Critical Employee Alert",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
}
}'
The response returns the personalized alert details.

{
"alertId": "00000000-0000-0000-0000-000000000000",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
},
"displayName": "Updated API Critical Employee Alert",
"isEnabledForUser": true
}
Enable or disable a personalized alert
Use this sample request to disable an existing personalized alert.
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1alpha/alerts/00000000-0000-0000-0000-000000000000' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
"status": "PAUSED"
}'
The response returns the personalized alert's status.

{
"status": "PAUSED"
}
Delete a personalized alert
Use this sample request to delete an existing personalized alert.
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1alpha/alerts/00000000-0000-0000-0000-000000000000' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns the deleted personalized alert's ID.

{
"alertId": "00000000-0000-0000-0000-000000000000"
}
Retrieve personalized alerts notifications
Use this sample request to retrieve all the notifications for your personalized alerts.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/notifications' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns any notifications for your personalized alerts in the last 30 days, including the criteria that triggered the alert.

{
"notifications": [{
"alertNotificationId": "00000000-0000-0000-0000-000000000000",
"alertId": "00000000-0000-0000-0000-000000000000",
"createdDate": "1755110082092",
"alertDetails": {
"triggerType": "DV_UPDATE",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
}
},
"resultInfo": [],
"resultType": "NOMINAL"
},
{
"alertNotificationId": "00000000-0000-0000-0000-000000000000",
"alertId": "00000000-0000-0000-0000-000000000000",
"createdDate": "1755108543010",
"alertDetails": {
"triggerType": "DV_UPDATE",
"triggerCriteria": {
"groupedMetricValueThreshold": {
"metric": {
"id": "Exit_Model.Rate.Exit",
"parameterValues": [],
"timeHandling": {
"trailingPeriods": {
"periodType": "M",
"periodsBack": 6
}
}
},
"filters": [
{
"conceptReference": {
"id": "Employee.isCriticalEmployee",
"qualifyingPath": "Employee_Exit.Employee"
}
}
],
"dimension": {
"id": "Organization_Hierarchy",
"qualifyingPath": "Employee_Exit.Employee"
},
"relativeTimePeriod": {
"allowPartialPeriod": false,
"periodType": "QUARTER",
"periodCount": 1,
"direction": "BACKWARD"
},
"ruleSet": {
"compareTo": {
"noComparison": {}
},
"rules": [
{
"relativeToValueRule": {
"rulePredicate": "GREATER_THAN",
"comparand": 0.1
}
}
]
}
}
}
},
"resultInfo": [
{
"memberResult": {
"memberId": "[Hierarchy].[-1].[Office of CEO]",
"displayName": "BlueSphere",
"value": 0.3333333333333333,
"formattedValue": "33.3%"
}
},
{
"memberResult": {
"memberId": "[Hierarchy].[-1].[Finance]",
"displayName": "Finance",
"value": 0.12931034482758622,
"formattedValue": "12.9%"
}
},
{
"memberResult": {
"memberId": "[Hierarchy].[-1].[Product]",
"displayName": "Product",
"value": 0.10714285714285714,
"formattedValue": "10.7%"
}
}
],
"resultType": "TRIGGERED"
}]
}