Skip to main content
node
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":{"applicationName":["string"],"assignee":["string"],"contextualLabels":[{"key":"string","value":{"contextualLabelValues":["string"]}}],"createdAtRange":{"endTime":"2019-08-24T14:15:22Z","startTime":"2019-08-24T14:15:22Z"},"displayLabels":[{"key":"string","value":{"displayLabelValues":["string"]}}],"endTime":"2019-08-24T14:15:22Z","incidentDurationRange":{"endTime":"2019-08-24T14:15:22Z","startTime":"2019-08-24T14:15:22Z"},"isMuted":true,"metaLabels":[{"key":"key","value":"value"}],"metaLabelsOp":"FILTER_OPERATOR_OR_OR_UNSPECIFIED","searchQuery":{"incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","query":"error"},"severity":["INCIDENT_SEVERITY_UNSPECIFIED"],"startTime":"2019-08-24T14:15:22Z","state":["INCIDENT_STATE_UNSPECIFIED"],"status":["INCIDENT_STATUS_UNSPECIFIED"],"subsystemName":["string"]},"groupBys":[{"incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","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": [
    {
      "aggAssignmentsCount": [
        {
          "assignedTo": {
            "userId": "user_id"
          },
          "count": 10
        }
      ],
      "aggMetaLabelsCount": [
        {
          "count": 10,
          "metaLabel": {
            "key": "key",
            "value": "value"
          }
        }
      ],
      "aggSeverityCount": [
        {
          "count": 10,
          "severity": "INCIDENT_SEVERITY_UNSPECIFIED"
        }
      ],
      "aggStateCount": [
        {
          "count": 10,
          "state": "INCIDENT_STATE_UNSPECIFIED"
        }
      ],
      "aggStatusCount": [
        {
          "count": 10,
          "status": "INCIDENT_STATUS_UNSPECIFIED"
        }
      ],
      "allValuesCount": 123,
      "firstCreatedAt": "2023-11-07T05:31:56Z",
      "groupBysValue": [
        {
          "incidentField": {
            "id": "<string>"
          }
        }
      ],
      "lastClosedAt": "2023-11-07T05:31:56Z",
      "lastStateUpdateTime": "2023-11-07T05:31:56Z",
      "listIncidentsId": [
        "<string>"
      ]
    }
  ],
  "pagination": {
    "nextPageToken": "next_page_token",
    "totalSize": 100
  }
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

Request to get aggregated incident data with filtering and grouping options

filter
object

Filter configuration for incidents

groupBys
Incident group by · object[]
  • Incident group by
  • Incident group by
pagination
object

Pagination parameters for list requests

Response

Response containing aggregated incident data and pagination information

incidentAggs
Incident aggregation · object[]
required
pagination
object
required

Pagination information for list responses

I