const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/incidents:listIncidentAggregations';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"filter":{"assignee":["string"],"status":["INCIDENT_STATUS_UNSPECIFIED"],"state":["INCIDENT_STATE_UNSPECIFIED"],"severity":["INCIDENT_SEVERITY_UNSPECIFIED"],"contextualLabels":{"property1":{"contextualLabelValues":["string"]},"property2":{"contextualLabelValues":["string"]}},"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z","searchQuery":{"query":"error","incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","contextualLabel":"string"},"applicationName":["string"],"subsystemName":["string"],"isMuted":true,"createdAtRange":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"incidentDurationRange":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"metaLabels":[{"key":"key","value":"value"}],"metaLabelsOp":"FILTER_OPERATOR_OR_OR_UNSPECIFIED"},"groupBys":[{"incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","contextualLabel":"string","orderByDirection":"ORDER_BY_DIRECTION_UNSPECIFIED"}],"pagination":{"pageSize":10,"pageToken":"next_page_token"}}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"incidentAggs": [
{
"groupBysValue": [
{
"incidentField": {
"id": "<string>",
"severity": "INCIDENT_SEVERITY_UNSPECIFIED",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"closedAt": "2023-11-07T05:31:56Z",
"state": "INCIDENT_STATE_UNSPECIFIED",
"status": "INCIDENT_STATUS_UNSPECIFIED",
"lastStateUpdateTime": "2023-11-07T05:31:56Z",
"applicationName": "<string>",
"subsystemName": "<string>",
"duration": "<string>"
},
"contextualLabels": {
"fieldName": "field_name",
"fieldValue": "field_value"
}
}
],
"aggStateCount": [
{
"state": "INCIDENT_STATE_UNSPECIFIED",
"count": 10
}
],
"aggStatusCount": [
{
"status": "INCIDENT_STATUS_UNSPECIFIED",
"count": 10
}
],
"aggSeverityCount": [
{
"severity": "INCIDENT_SEVERITY_UNSPECIFIED",
"count": 10
}
],
"aggAssignmentsCount": [
{
"assignedTo": {
"userId": "user_id"
},
"count": 10
}
],
"firstCreatedAt": "2023-11-07T05:31:56Z",
"lastClosedAt": "2023-11-07T05:31:56Z",
"allValuesCount": 123,
"listIncidentsId": [
"<string>"
],
"lastStateUpdateTime": "2023-11-07T05:31:56Z",
"aggMetaLabelsCount": [
{
"metaLabel": {
"key": "key",
"value": "value"
},
"count": 10
}
]
}
],
"pagination": {
"totalSize": 100,
"nextPageToken": "next_page_token"
}
}
Retrieve aggregated incident data with support for grouping and filtering.
Requires the following permissions:
incidents:read
const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/incidents:listIncidentAggregations';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"filter":{"assignee":["string"],"status":["INCIDENT_STATUS_UNSPECIFIED"],"state":["INCIDENT_STATE_UNSPECIFIED"],"severity":["INCIDENT_SEVERITY_UNSPECIFIED"],"contextualLabels":{"property1":{"contextualLabelValues":["string"]},"property2":{"contextualLabelValues":["string"]}},"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z","searchQuery":{"query":"error","incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","contextualLabel":"string"},"applicationName":["string"],"subsystemName":["string"],"isMuted":true,"createdAtRange":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"incidentDurationRange":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"metaLabels":[{"key":"key","value":"value"}],"metaLabelsOp":"FILTER_OPERATOR_OR_OR_UNSPECIFIED"},"groupBys":[{"incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","contextualLabel":"string","orderByDirection":"ORDER_BY_DIRECTION_UNSPECIFIED"}],"pagination":{"pageSize":10,"pageToken":"next_page_token"}}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"incidentAggs": [
{
"groupBysValue": [
{
"incidentField": {
"id": "<string>",
"severity": "INCIDENT_SEVERITY_UNSPECIFIED",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"closedAt": "2023-11-07T05:31:56Z",
"state": "INCIDENT_STATE_UNSPECIFIED",
"status": "INCIDENT_STATUS_UNSPECIFIED",
"lastStateUpdateTime": "2023-11-07T05:31:56Z",
"applicationName": "<string>",
"subsystemName": "<string>",
"duration": "<string>"
},
"contextualLabels": {
"fieldName": "field_name",
"fieldValue": "field_value"
}
}
],
"aggStateCount": [
{
"state": "INCIDENT_STATE_UNSPECIFIED",
"count": 10
}
],
"aggStatusCount": [
{
"status": "INCIDENT_STATUS_UNSPECIFIED",
"count": 10
}
],
"aggSeverityCount": [
{
"severity": "INCIDENT_SEVERITY_UNSPECIFIED",
"count": 10
}
],
"aggAssignmentsCount": [
{
"assignedTo": {
"userId": "user_id"
},
"count": 10
}
],
"firstCreatedAt": "2023-11-07T05:31:56Z",
"lastClosedAt": "2023-11-07T05:31:56Z",
"allValuesCount": 123,
"listIncidentsId": [
"<string>"
],
"lastStateUpdateTime": "2023-11-07T05:31:56Z",
"aggMetaLabelsCount": [
{
"metaLabel": {
"key": "key",
"value": "value"
},
"count": 10
}
]
}
],
"pagination": {
"totalSize": 100,
"nextPageToken": "next_page_token"
}
}
API key authentication
Request to get aggregated incident data with filtering and grouping options
A successful response.
Response containing aggregated incident data and pagination information
Was this page helpful?