> ## Documentation Index
> Fetch the complete documentation index at: https://learn.servitly.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Get alert-definitions by thing-definition
> Returns the list of alert-definitions of a specific thing-definition.
An alert-definition describes the condition that activates an event on a thing (e.g. Temperature > 100), the condition that clears it, the resulting event severity and the notification messages sent to the users.
Set includeInherited to true to obtain also the alert-definitions inherited from the parent thing-definitions.
## OpenAPI
````json GET /inventory/thingDefinitions/{thingDefinitionId}/alertDefinitions
{
"openapi": "3.1.0",
"info": {
"title": "Servitly DPS API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.servitly-sandbox.com",
"description": "[AWS SANDBOX]"
},
{
"url": "https://api.servitly.com",
"description": "[AWS PRODUCTION Ireland]"
},
{
"url": "https://api-ap.servitly.com",
"description": "[AWS Hong Kong]"
},
{
"url": "https://azapi.servitly-dev.com",
"description": "[AZURE DEV Frankfurt]"
},
{
"url": "https://azapi.servitly-staging.com",
"description": "[AZURE STAGING Frankfurt]"
},
{
"url": "https://azapi.servitly.com",
"description": "[AZURE PRODUCTION Frankfurt]"
}
],
"security": [
{
"bearerAuth": []
}
],
"tags": [
{
"name": "ACTIONS"
},
{
"name": "ALERTS"
},
{
"name": "API GATEWAY"
},
{
"name": "AUTHENTICATION"
},
{
"name": "AUTHORIZATIONS"
},
{
"name": "CUSTOMERS"
},
{
"name": "DATA IMPORT / EXPORT"
},
{
"name": "EVENTS"
},
{
"name": "LOCATIONS"
},
{
"name": "MAINTENANCE"
},
{
"name": "MAPPING"
},
{
"name": "METRIC DATA"
},
{
"name": "MOBILE APP"
},
{
"name": "ORGANIZATION"
},
{
"name": "PARTNERS"
},
{
"name": "PRODUCT MODELS"
},
{
"name": "SPARE PARTS"
},
{
"name": "STATISTICS"
},
{
"name": "STORE ORDERS"
},
{
"name": "SUBSCRIPTIONS"
},
{
"name": "SUBSCRIPTIONS (OLD)"
},
{
"name": "THING CONTROL"
},
{
"name": "THING DEFINITIONS"
},
{
"name": "THING MANAGEMENT"
},
{
"name": "THINGS"
},
{
"name": "TICKETS"
},
{
"name": "USER TYPES"
},
{
"name": "USERS"
},
{
"name": "WORK SESSIONS"
}
],
"paths": {
"/inventory/thingDefinitions/{thingDefinitionId}/alertDefinitions": {
"get": {
"summary": "Get alert-definitions by thing-definition",
"description": "Returns the list of alert-definitions of a specific thing-definition.
An alert-definition describes the condition that activates an event on a thing (e.g. Temperature > 100), the condition that clears it, the resulting event severity and the notification messages sent to the users.
Set includeInherited to true to obtain also the alert-definitions inherited from the parent thing-definitions.",
"tags": [
"THING DEFINITIONS"
],
"parameters": [
{
"$ref": "#/components/parameters/tenantNameHeader"
},
{
"$ref": "#/components/parameters/includeInherited"
},
{
"in": "path",
"name": "thingDefinitionId",
"required": "true",
"schema": {
"$ref": "#/components/schemas/ObjectId"
},
"description": "The thing-definition identifier."
}
],
"responses": {
"200": {
"description": "Successful operation.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AlertDefinition"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/NotAuthenticated"
},
"403": {
"$ref": "#/components/responses/NotAuthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/ApiLimit"
},
"500": {
"$ref": "#/components/responses/IntError"
}
}
}
}
},
"components": {
"parameters": {
"tenantNameHeader": {
"in": "header",
"name": "X-Servitly-Tenant",
"required": "true",
"schema": {
"type": "string",
"example": "{{tenantName}}"
},
"description": "The name of the tenant (e.g. acme)."
},
"includeInherited": {
"in": "query",
"name": "includeInherited",
"required": "false",
"schema": {
"type": "boolean"
},
"description": "If true, the response includes the elements inherited from parent thing definitions."
}
},
"schemas": {
"ObjectId": {
"type": "string",
"example": "abcd1234",
"minimum": "1",
"description": "The object identifier (e.g. 6620e4bb42541977c406b984)."
},
"AlertDefinition": {
"type": "object",
"properties": {
"id": {
"type": "string",
"readOnly": "true",
"example": "abcd1234",
"description": "The alert object identifier."
},
"thingDefinition": {
"writeOnly": "true",
"example": "abcd1234",
"description": "The thing-definition identifier associated with the alert.",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"name": {
"type": "string",
"example": "E503",
"description": "The alert name."
},
"title": {
"type": "string",
"example": "Overheating",
"description": "The alert alternative title."
},
"description": {
"type": "string",
"example": "High temperature detected",
"description": "The alert description."
},
"technicalDescription": {
"type": "string",
"example": "High temperature occurs when....",
"description": "The alert troubleshooting technical description."
},
"severity": {
"type": "string",
"enum": [
"WARNING",
"CRITICAL",
"INFORMATIONAL"
],
"description": "The event severity."
},
"category": {
"type": "string",
"enum": [
"FAILURE",
"ANOMALY",
"INFORMATION"
],
"description": "The event category."
},
"eventSeverity": {
"type": "integer",
"enum": [
"1",
"2",
"3",
"4",
"5"
],
"description": "The event severity (1:FAILURE, 2:MAJOR ANOMALY, 3:MINOR ANOMALY, 4:OPERATION, 5:MAINTENANCE)."
},
"activeConditionMetric": {
"description": "The metric the active condition (e.g. Temperature > 100) is based on.",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"activeConditionPredicate": {
"type": "string",
"enum": [
"EQUAL",
"NOT_EQUAL",
"LESS",
"GREATER",
"LESS_EQUAL",
"GREATER_EQUAL",
"CONTAINS",
"EXPIRED_BY_N_DAYS"
],
"description": "The active condition predicate."
},
"activeConditionSeparator": {
"type": "string",
"description": "The active condition predicate separator char used in case of CONTAINS predicate."
},
"activeConditionValue": {
"type": "string",
"description": "The active condition value to check."
},
"activeConditionValueMetric": {
"description": "The metric used as comparison value by the active condition (e.g. Temperature > Temperature2).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"activeConditionValueCustomerPropertyDefinitionId": {
"description": "The customer property used as comparison value by the active condition (e.g. Temperature > customer.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"activeConditionValueLocationPropertyDefinitionId": {
"description": "The location property used as comparison value by the active condition (e.g. Temperature > location.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"activeConditionValueThingPropertyDefinitionId": {
"description": "The thing property used as comparison value by the active condition (e.g. Temperature > thing.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"activeConditionValueThingDefinitionPropertyDefinitionId": {
"description": "The thing-definition property used as comparison value by the active condition (e.g. Temperature > thingDefinition.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"minimumActiveTime": {
"type": "integer",
"description": "The minimum time the active condition must be true before activating the alert instance."
},
"minimumActiveTimeUnit": {
"type": "string",
"enum": [
"SECONDS",
"MINUTES",
"HOURS"
],
"description": "The time unit related to the minimum active time value."
},
"clearConditionMetric": {
"description": "The metric the clear condition (e.g. Temperature > 100) is based on.",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"clearConditionPredicate": {
"type": "string",
"enum": [
"EQUAL",
"NOT_EQUAL",
"LESS",
"GREATER",
"LESS_EQUAL",
"GREATER_EQUAL",
"CONTAINS",
"EXPIRED_BY_N_DAYS"
],
"description": "The clear condition predicate."
},
"clearConditionSeparator": {
"type": "string",
"description": "The clear condition predicate separator char used in case of CONTAINS predicate."
},
"clearConditionValue": {
"type": "string",
"description": "The clear condition value to check."
},
"clearConditionValueMetric": {
"description": "The metric used as comparison value by the clear condition (e.g. Temperature > Temperature2).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"clearConditionValueCustomerPropertyDefinitionId": {
"description": "The customer property used as comparison value by the clear condition (e.g. Temperature > customer.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"clearConditionValueLocationPropertyDefinitionId": {
"description": "The location property used as comparison value by the clear condition (e.g. Temperature > location.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"clearConditionValueThingPropertyDefinitionId": {
"description": "The thing property used as comparison value by the clear condition (e.g. Temperature > thing.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"clearConditionValueThingDefinitionPropertyDefinitionId": {
"description": "The thing-definition property used as comparison value by the clear condition (e.g. Temperature > thingDefinition.properties.maxTemperature).",
"allOf": [
{
"$ref": "#/components/schemas/IdRef"
}
]
},
"alertActivatedNotificationTitle": {
"type": "string",
"description": "The alert notification title.",
"example": "${alert.severity}: ${thingDefinition.name} ${thing.serialNumber} - ${alert.title}"
},
"alertActivatedNotificationLongMessage": {
"type": "string",
"description": "The long message notified when the alert is activated.",
"example": "${alert.severity}: ${thing.serialNumber} - ${alert.title}"
},
"alertActivatedNotificationShortMessage": {
"type": "string",
"description": "The short message notified when the alert is activated. This message is used for PUSH, SMS and VOICE notifications.",
"example": "${alert.description}"
},
"alertClearedNotificationTitle": {
"type": "string",
"description": "The alert clearing notification title.",
"example": "${alert.severity}: ${thingDefinition.name} ${thing.serialNumber} - ${alert.title}"
},
"alertClearedNotificationLongMessage": {
"type": "string",
"description": "The long message notified when the alert is cleared.",
"example": "${alert.severity}: ${thing.serialNumber} - ${alert.title}"
},
"alertClearedNotificationShortMessage": {
"type": "string",
"description": "The short message notified when the alert is cleared. This message is used for PUSH, SMS and VOICE notifications.",
"example": "${alert.description}"
},
"delayedNotificationTime": {
"type": "integer",
"description": "The minimum time the alert must remain active before being notified."
},
"delayedNotificationTimeUnit": {
"type": "string",
"enum": [
"SECONDS",
"MINUTES",
"HOURS"
],
"description": "The time unit related to the delayed time value."
}
}
},
"IdRef": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The referenced object identifier.",
"example": "1234abcd"
}
}
}
},
"responses": {
"NotAuthenticated": {
"description": "User not authenticated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "User not authenticated"
}
}
}
}
}
},
"NotAuthorized": {
"description": "User not authorized.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "User not authorized"
}
}
}
}
}
},
"NotFound": {
"description": "Resource was not found.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "Resource not found"
}
}
}
}
}
},
"ApiLimit": {
"description": "API call rate limit exceeded.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "API call rate limit exceeded"
}
}
}
}
}
},
"IntError": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "Internal Server Error"
}
}
}
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}
````