# Alerts

## List alert events

> Returns alert events divided into pages. Allows to specify page number and page size.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_Page_HttpAlert":{"required":["pagesAmount","totalCount"],"type":"object","properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/agent_HttpAlert"}},"pagesAmount":{"type":"integer","format":"int64"},"totalCount":{"type":"integer","format":"int64"}}},"agent_HttpAlert":{"required":["level","category","instance","summary","timestamp","alertId","map","lrn"],"type":"object","properties":{"level":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"instance":{"type":"string"},"summary":{"type":"string"},"docs":{"type":"string"},"timestamp":{"type":"integer","format":"int64"},"alertId":{"type":"integer"},"map":{"$ref":"#/components/schemas/agent_Map_String_String"},"lrn":{"type":"string"}}},"agent_Map_String_String":{"type":"object","additionalProperties":{"type":"string"}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/events":{"get":{"tags":["agent_Alerts"],"summary":"List alert events","description":"Returns alert events divided into pages. Allows to specify page number and page size.","operationId":"listAlertEvents","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The page number to be returned, must be greater than zero. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"pageSize","in":"query","description":"The elements amount on a single page, must be greater than zero.","required":true,"schema":{"type":"integer"}},{"name":"summary","in":"query","description":"Allows to filter results by partial summary text","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","description":"Allows to filter results by category. Accepted values are: 'Infrastructure', 'Consumers', 'Kafka Connect', 'Topics' )","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","description":"Allows to filter results by level","required":false,"schema":{"type":"string"}},{"name":"alertId","in":"query","description":"Allows to filter results by alert id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Page_HttpAlert"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## GET /api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert\_setting\_id}/conditions/{condition\_id}

> Get alert condition details

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AlertSetting":{"type":"integer","enum":[1000,1001,1002,1003,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,2000,3000,4000,4001,4002,5000,6000]},"agent_ConditionDetails":{"required":["createdAt","createdBy","modifiedAt","modifiedBy","condition","conditionDsl"],"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"modifiedAt":{"type":"string","format":"date-time"},"modifiedBy":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/agent_ChannelSummary"}},"condition":{"type":"string"},"conditionDsl":{"$ref":"#/components/schemas/agent_Json"},"conditionState":{"$ref":"#/components/schemas/agent_Json"}}},"agent_ChannelSummary":{"required":["id","name","templateName"],"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"templateName":{"type":"string"}}},"agent_Json":{},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_id}":{"get":{"tags":["agent_Alerts"],"summary":"Get alert condition details","operationId":"getAlertCondition","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"alert_setting_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/agent_AlertSetting"}},{"name":"condition_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_ConditionDetails"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## PUT /api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert\_setting\_id}/conditions/{condition\_id}

> Update alert condition

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AlertSetting":{"type":"integer","enum":[1000,1001,1002,1003,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,2000,3000,4000,4001,4002,5000,6000]},"agent_AlertConditionRequest":{"required":["condition"],"type":"object","properties":{"condition":{"oneOf":[{"$ref":"#/components/schemas/agent_JsonObject"},{"type":"string"}]},"channels":{"type":"array","items":{"type":"string"}}}},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_id}":{"put":{"tags":["agent_Alerts"],"summary":"Update alert condition","operationId":"updateAlertCondition","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"alert_setting_id","in":"path","description":"The Alert ID to enable","required":true,"schema":{"$ref":"#/components/schemas/agent_AlertSetting"}},{"name":"condition_id","in":"path","description":"The condition unique identifier","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The custom alert condition and a list of channel ids to route alerts to","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertConditionRequest"}}},"required":true},"responses":{"200":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## DELETE /api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert\_setting\_id}/conditions/{condition\_id}

> Delete alert condition

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AlertSetting":{"type":"integer","enum":[1000,1001,1002,1003,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,2000,3000,4000,4001,4002,5000,6000]},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_id}":{"delete":{"tags":["agent_Alerts"],"summary":"Delete alert condition","operationId":"deleteAlertCondition","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"alert_setting_id","in":"path","description":"The Alert ID to enable","required":true,"schema":{"$ref":"#/components/schemas/agent_AlertSetting"}},{"name":"condition_id","in":"path","description":"The condition unique identifier","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## GET /api/v1/environments/{environment}/proxy/api/v2/alert/settings

> Get alert settings

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_HttpCategorisedAlertRules":{"required":["categories"],"type":"object","properties":{"categories":{"$ref":"#/components/schemas/agent_Map_Category_List_HttpAlertRule"}}},"agent_Map_Category_List_HttpAlertRule":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/agent_HttpAlertRule"}}},"agent_HttpAlertRule":{"required":["id","description","category","enabled","isAvailable","details","lrn"],"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"},"category":{"$ref":"#/components/schemas/agent_Category"},"enabled":{"type":"boolean"},"conditionTemplate":{"type":"string"},"conditionRegex":{"type":"string"},"docs":{"type":"string"},"isAvailable":{"type":"boolean"},"details":{"$ref":"#/components/schemas/agent_AlertRuleDetails"},"lrn":{"type":"string"}}},"agent_Category":{"type":"string","enum":["Infrastructure","Consumers","Kafka Connect","Topics","Data Produced","Apps"]},"agent_AlertRuleDetails":{"oneOf":[{"$ref":"#/components/schemas/agent_ConditionalAlertRuleDetails"},{"$ref":"#/components/schemas/agent_FixedAlertRuleDetails"}]},"agent_ConditionalAlertRuleDetails":{"required":["conditions","alertType"],"type":"object","properties":{"conditions":{"$ref":"#/components/schemas/agent_Map_UUID_ConditionDetails"},"alertType":{"$ref":"#/components/schemas/agent_AlertType"}}},"agent_Map_UUID_ConditionDetails":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/agent_ConditionDetails"}},"agent_ConditionDetails":{"required":["createdAt","createdBy","modifiedAt","modifiedBy","condition","conditionDsl"],"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"modifiedAt":{"type":"string","format":"date-time"},"modifiedBy":{"type":"string"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/agent_ChannelSummary"}},"condition":{"type":"string"},"conditionDsl":{"$ref":"#/components/schemas/agent_Json"},"conditionState":{"$ref":"#/components/schemas/agent_Json"}}},"agent_ChannelSummary":{"required":["id","name","templateName"],"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"templateName":{"type":"string"}}},"agent_Json":{},"agent_AlertType":{"type":"string","enum":["Fixed","Conditional"]},"agent_FixedAlertRuleDetails":{"required":["alertType","modifiedBy","modifiedAt"],"type":"object","properties":{"alertType":{"$ref":"#/components/schemas/agent_AlertType"},"channels":{"type":"array","items":{"$ref":"#/components/schemas/agent_ChannelSummary"}},"condition":{"type":"string"},"conditionDsl":{"$ref":"#/components/schemas/agent_Json"},"modifiedBy":{"type":"string"},"modifiedAt":{"type":"string","format":"date-time"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/alert/settings":{"get":{"tags":["agent_Alerts"],"summary":"Get alert settings","operationId":"getAlertSettingsV2","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_HttpCategorisedAlertRules"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Update alert settings

> update of a fixed alert setting

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AlertSetting":{"type":"integer","enum":[1000,1001,1002,1003,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,2000,3000,4000,4001,4002,5000,6000]},"agent_AlertSettingPutRequest":{"required":["enabled"],"type":"object","properties":{"enabled":{"type":"boolean"},"channels":{"type":"array","items":{"type":"string"}},"config":{"$ref":"#/components/schemas/agent_JsonObject"}}},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_AlertSettingResponse":{"required":["message"],"type":"object","properties":{"message":{"type":"string"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/alert/settings/{alert_setting_id}":{"put":{"tags":["agent_Alerts"],"summary":"Update alert settings","description":"update of a fixed alert setting","operationId":"setAlertSettingsV2","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"alert_setting_id","in":"path","description":"The Alert ID to enable","required":true,"schema":{"$ref":"#/components/schemas/agent_AlertSetting"}}],"requestBody":{"description":"An request payload specifying whether to enable/disable the alert and supplying a distinct list of associated channel ids","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertSettingPutRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertSettingResponse"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Partially update alert settings

> partial update of a fixed alert setting

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AlertSetting":{"type":"integer","enum":[1000,1001,1002,1003,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,2000,3000,4000,4001,4002,5000,6000]},"agent_AlertSettingPatchRequest":{"type":"object","properties":{"enabled":{"type":"boolean"},"channels":{"type":"array","items":{"type":"string"}},"config":{"$ref":"#/components/schemas/agent_JsonObject"}}},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_AlertSettingResponse":{"required":["message"],"type":"object","properties":{"message":{"type":"string"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/alert/settings/{alert_setting_id}":{"patch":{"tags":["agent_Alerts"],"summary":"Partially update alert settings","description":"partial update of a fixed alert setting","operationId":"patchAlertSettingsV2","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"alert_setting_id","in":"path","description":"The Alert ID to enable","required":true,"schema":{"$ref":"#/components/schemas/agent_AlertSetting"}}],"requestBody":{"description":"An request payload specifying whether to enable/disable the alert and supplying a distinct list of associated channel ids","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertSettingPatchRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertSettingResponse"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## POST /api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert\_setting\_id}/conditions

> Create alert condition

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AlertSetting":{"type":"integer","enum":[1000,1001,1002,1003,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,2000,3000,4000,4001,4002,5000,6000]},"agent_AlertConditionRequest":{"required":["condition"],"type":"object","properties":{"condition":{"oneOf":[{"$ref":"#/components/schemas/agent_JsonObject"},{"type":"string"}]},"channels":{"type":"array","items":{"type":"string"}}}},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_AlertConditionResponse":{"required":["id"],"type":"object","properties":{"id":{"type":"string","format":"uuid"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/settings/{alert_setting_id}/conditions":{"post":{"tags":["agent_Alerts"],"summary":"Create alert condition","operationId":"createAlertCondition","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"alert_setting_id","in":"path","description":"The Alert ID to enable","required":true,"schema":{"$ref":"#/components/schemas/agent_AlertSetting"}}],"requestBody":{"description":"The custom alert condition and a list of channel ids to route alerts to","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertConditionRequest"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AlertConditionResponse"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## List alert channels

> Lists alert channels ordered by their creation time (most recent first)

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_ChannelField":{"type":"string","enum":["name","templateName","createdAt","updatedAt"]},"agent_Order":{"type":"string","enum":["asc","desc"]},"agent_Page_HttpChannelEntity":{"required":["pagesAmount","totalCount"],"type":"object","properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/agent_HttpChannelEntity"}},"pagesAmount":{"type":"integer","format":"int64"},"totalCount":{"type":"integer","format":"int64"}}},"agent_HttpChannelEntity":{"required":["id","name","templateName","templateVersion","connectionName","createdAt","createdBy","updatedAt","updatedBy","enabled","lrn"],"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"templateName":{"type":"string"},"templateVersion":{"type":"integer"},"connectionName":{"type":"string"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/agent_PropertyValue"}},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"enabled":{"type":"boolean"},"lrn":{"type":"string"}}},"agent_PropertyValue":{"required":["key","value"],"type":"object","properties":{"key":{"type":"string"},"value":{"$ref":"#/components/schemas/agent_Json"}}},"agent_Json":{},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channels":{"get":{"tags":["agent_Alerts"],"summary":"List alert channels","description":"Lists alert channels ordered by their creation time (most recent first)","operationId":"listAlertChannels","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The page number to be returned, must be greater than zero. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"pageSize","in":"query","description":"The elements amount on a single page, must be greater than zero.","required":true,"schema":{"type":"integer"}},{"name":"templateName","in":"query","description":"Filter by channel template name","required":false,"schema":{"type":"string"}},{"name":"channelName","in":"query","description":"Matches channels by name","required":false,"schema":{"type":"string"}},{"name":"sortField","in":"query","description":"The field to sort results by","required":false,"schema":{"$ref":"#/components/schemas/agent_ChannelField"}},{"name":"sortOrder","in":"query","description":"Sorting order. Defaults to ascending","required":false,"schema":{"$ref":"#/components/schemas/agent_Order"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Page_HttpChannelEntity"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Create alert channel

> The JSON object representing the properties to set this channel with

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_NewChannelApiEntity":{"required":["name","templateName","connectionName"],"type":"object","properties":{"name":{"type":"string"},"templateName":{"type":"string"},"connectionName":{"type":"string"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/agent_PropertyValue"}},"propertiesObject":{"$ref":"#/components/schemas/agent_JsonObject"}}},"agent_PropertyValue":{"required":["key","value"],"type":"object","properties":{"key":{"type":"string"},"value":{"$ref":"#/components/schemas/agent_Json"}}},"agent_Json":{},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_NewChannelResponse":{"required":["id"],"type":"object","properties":{"id":{"type":"string"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Conflict":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channels":{"post":{"tags":["agent_Alerts"],"summary":"Create alert channel","description":"The JSON object representing the properties to set this channel with","operationId":"createAlertChannel","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NewChannelApiEntity"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NewChannelResponse"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"409":{"description":"The supplied identifier is already being used by another resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Conflict"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Get alert channel details

> Get the alert channel details

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_HttpChannelEntity":{"required":["id","name","templateName","templateVersion","connectionName","createdAt","createdBy","updatedAt","updatedBy","enabled","lrn"],"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"templateName":{"type":"string"},"templateVersion":{"type":"integer"},"connectionName":{"type":"string"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/agent_PropertyValue"}},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"enabled":{"type":"boolean"},"lrn":{"type":"string"}}},"agent_PropertyValue":{"required":["key","value"],"type":"object","properties":{"key":{"type":"string"},"value":{"$ref":"#/components/schemas/agent_Json"}}},"agent_Json":{},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channels/{id}":{"get":{"tags":["agent_Alerts"],"summary":"Get alert channel details","description":"Get the alert channel details","operationId":"getAlertChannel","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The channel id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_HttpChannelEntity"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Update alert channel

> Update alert channel

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_UpdateChannelApiEntity":{"required":["name","connectionName"],"type":"object","properties":{"name":{"type":"string"},"connectionName":{"type":"string"},"enabled":{"type":"boolean"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/agent_PropertyValue"}},"propertiesObject":{"$ref":"#/components/schemas/agent_JsonObject"}}},"agent_PropertyValue":{"required":["key","value"],"type":"object","properties":{"key":{"type":"string"},"value":{"$ref":"#/components/schemas/agent_Json"}}},"agent_Json":{},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Conflict":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channels/{id}":{"put":{"tags":["agent_Alerts"],"summary":"Update alert channel","description":"Update alert channel","operationId":"updateAlertChannel","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The channel id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The JSON object representing the properties to set this channel with","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_UpdateChannelApiEntity"}}},"required":true},"responses":{"200":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"409":{"description":"The supplied identifier is already being used by another resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Conflict"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Delete a channel

> Permanently delete a channel

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channels/{id}":{"delete":{"tags":["agent_Alerts"],"summary":"Delete a channel","description":"Permanently delete a channel","operationId":"deleteAlertChannel","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The channel id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Patch alert channel

> Patch an alert channel

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_PatchChannelApiEntity":{"type":"object","properties":{"name":{"type":"string"},"connectionName":{"type":"string"},"enabled":{"type":"boolean"},"properties":{"type":"array","items":{"$ref":"#/components/schemas/agent_PropertyValue"}},"propertiesObject":{"$ref":"#/components/schemas/agent_JsonObject"}}},"agent_PropertyValue":{"required":["key","value"],"type":"object","properties":{"key":{"type":"string"},"value":{"$ref":"#/components/schemas/agent_Json"}}},"agent_Json":{},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Conflict":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channels/{id}":{"patch":{"tags":["agent_Alerts"],"summary":"Patch alert channel","description":"Patch an alert channel","operationId":"patchAlertChannel","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The channel id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The JSON object representing the properties to set this channel with","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_PatchChannelApiEntity"}}},"required":true},"responses":{"200":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"409":{"description":"The supplied identifier is already being used by another resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Conflict"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## List alert channel templates

> List channel templates and their applicable connections

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Alerts"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_ChannelTemplate":{"required":["id","name","templateVersion","version","enabled","builtIn","metadata","jsonSchema"],"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"templateVersion":{"type":"integer"},"version":{"type":"string"},"enabled":{"type":"boolean"},"builtIn":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/agent_TemplateMetadata"},"configuration":{"type":"array","items":{"$ref":"#/components/schemas/agent_TemplateProperty"}},"suitableConnections":{"type":"array","items":{"$ref":"#/components/schemas/agent_SuitableConnection"}},"jsonSchema":{"$ref":"#/components/schemas/agent_JsonObject"}}},"agent_TemplateMetadata":{"required":["author"],"type":"object","properties":{"author":{"type":"string"},"description":{"type":"string"}}},"agent_TemplateProperty":{"required":["id","key","displayName","type","required","provided"],"type":"object","properties":{"id":{"type":"integer"},"key":{"type":"string"},"displayName":{"type":"string"},"placeholder":{"type":"string"},"description":{"type":"string"},"type":{"$ref":"#/components/schemas/agent_TemplatePropertyType"},"required":{"type":"boolean"},"provided":{"type":"boolean"}}},"agent_TemplatePropertyType":{"required":["name","displayName"],"type":"object","properties":{"name":{"$ref":"#/components/schemas/agent_KeyDataType"},"displayName":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"minItems":1}}},"agent_KeyDataType":{"type":"string","description":"The data type of the property","enum":["STRING","ARRAY","MULTILINE","SECRET","DOUBLE","LONG","BOOLEAN","BASE64","ENUM","MAP"]},"agent_SuitableConnection":{"required":["templateName","name"],"type":"object","properties":{"templateName":{"type":"string"},"name":{"type":"string"}}},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/alert/channel-templates":{"get":{"tags":["agent_Alerts"],"summary":"List alert channel templates","description":"List channel templates and their applicable connections","operationId":"listAlertChannelTemplates","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/agent_ChannelTemplate"}}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/api-reference/6.1/reference/alerts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
