Unable To Create Alerts Via API

How to create Alerts in Orchestrator using API endpoints?

Prerequisites to create Alerts in Orchestrator:

  • OAuth required scopes: OR.Monitoring or OR.Monitoring.Write.
  • Required permissions: Alerts.Create


A tool like Postman could be used to check and create an alert:

  1. Get the folder ID
  2. Go to headers (in Postman) and add X-UIPATH-OrganizationUnitId with the folder Id
  3. To get the folder ID, use the API or swagger and call the "odata/folders' endpoint :

1.png

  1. In Postman build the request as below:
  • URL: https://ORCHESTRATOR_URL/odata/Alerts/UiPath.Server.Configuration.OData.RaiseProcessAlert
  • Method: POST
  • Authorization: Bearer Token
Example:
image.png


Headers:

Content-Type: application/json;odata.metadata=minimal;odata.streaming=true
Accept: application/json
X-UIPATH-OrganizationUnitId: FolderId

Example:
image.png

Body of type JSON:
{
"processAlert": {
"Message": "This is a sample Error alert.",
"Severity": "Error",
"RobotName": "marian.platonov@uipath.com-unattended",
"ProcessName": "Raise an Error Alert in Orchestrator"
}
}

Example:
image.png



Results in Orchestrator:
image.png