Alert rules
Alert rule management
List alert rules
Query Parameters
Page number (1-indexed)
11 <= valueItems per page
201 <= value <= 100Filter by plant UUID
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/alert-rules"{
"data": [
{
"condition": "LT",
"cooldownMinutes": 0,
"createdAt": "2019-08-24T14:15:22Z",
"enabled": true,
"id": "string",
"lastTriggeredAt": "2019-08-24T14:15:22Z",
"metric": "string",
"name": "string",
"organizationId": "string",
"plantId": "string",
"severity": "INFO",
"threshold": 0,
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"meta": {
"limit": 0,
"page": 0,
"total": 0,
"totalPages": 0
}
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Validation error",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Create an alert rule
Request Body
application/json
Comparison condition
"LT" | "GT" | "EQ"Cooldown between triggers in minutes
151 <= value <= 1440Whether the rule is enabled
trueTelemetry metric to monitor
length <= 100Rule name
length <= 200Restrict to a specific plant (null = all plants in org)
uuidAlert severity when triggered
"WARNING""INFO" | "WARNING" | "CRITICAL" | "EMERGENCY"Threshold value
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/api/v1/alert-rules" \ -H "Content-Type: application/json" \ -d '{ "condition": "LT", "metric": "soc", "name": "High SOC alert", "threshold": 90 }'{
"condition": "LT",
"cooldownMinutes": 0,
"createdAt": "2019-08-24T14:15:22Z",
"enabled": true,
"id": "string",
"lastTriggeredAt": "2019-08-24T14:15:22Z",
"metric": "string",
"name": "string",
"organizationId": "string",
"plantId": "string",
"severity": "INFO",
"threshold": 0,
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Validation error or plant tenancy violation",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Get alert rule by ID
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/alert-rules/string"{
"condition": "LT",
"cooldownMinutes": 0,
"createdAt": "2019-08-24T14:15:22Z",
"enabled": true,
"id": "string",
"lastTriggeredAt": "2019-08-24T14:15:22Z",
"metric": "string",
"name": "string",
"organizationId": "string",
"plantId": "string",
"severity": "INFO",
"threshold": 0,
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Alert rule not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Update an alert rule
Path Parameters
Request Body
application/json
Comparison condition
"LT" | "GT" | "EQ"Cooldown between triggers in minutes
151 <= value <= 1440Whether the rule is enabled
trueTelemetry metric to monitor
length <= 100Rule name
length <= 200Restrict to a specific plant (null = all plants in org)
uuidAlert severity when triggered
"WARNING""INFO" | "WARNING" | "CRITICAL" | "EMERGENCY"Threshold value
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://loading/api/v1/alert-rules/string" \ -H "Content-Type: application/json" \ -d '{}'{
"condition": "LT",
"cooldownMinutes": 0,
"createdAt": "2019-08-24T14:15:22Z",
"enabled": true,
"id": "string",
"lastTriggeredAt": "2019-08-24T14:15:22Z",
"metric": "string",
"name": "string",
"organizationId": "string",
"plantId": "string",
"severity": "INFO",
"threshold": 0,
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Validation error or plant tenancy violation",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Alert rule not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Delete an alert rule
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://loading/api/v1/alert-rules/string"{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Alert rule not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}