const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/incidents:assign';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"incidentIds":["incident_id_1","incident_id_2"],"assignedTo":{"userId":"user_id"}}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));{
"incidents": [
{
"id": "incident_id",
"state": "INCIDENT_STATE_UNSPECIFIED",
"status": "INCIDENT_STATUS_UNSPECIFIED",
"assignments": [
{
"assignedTo": {
"userId": "user_id"
},
"assignedBy": {
"userId": "user_id"
}
}
],
"severity": "INCIDENT_SEVERITY_UNSPECIFIED",
"contextualLabels": {},
"displayLabels": {},
"events": [
{
"id": "incident_event_id",
"incidentEventType": "INCIDENT_EVENT_TYPE_UNSPECIFIED",
"originatorType": "ORIGINATOR_TYPE_UNSPECIFIED",
"snoozeIndicator": {
"startTime": "2023-11-07T05:31:56Z",
"durationMinutes": 123,
"userId": "<string>"
},
"assignment": {
"assignment": {
"assignedTo": {
"userId": "user_id"
},
"assignedBy": {
"userId": "user_id"
}
}
},
"unassign": {},
"upsertState": {
"stateType": "UPSERT_INCIDENT_STATE_TYPE_UNSPECIFIED",
"payload": {
"cxEventKey": "<string>"
},
"isMuted": true
},
"acknowledge": {
"acknowledgedBy": {
"userId": "user_id"
}
},
"close": {
"closedBy": {
"userId": "user_id"
}
},
"administrativeEvent": {
"userId": "<string>"
},
"operationalEvent": {
"systemName": "<string>"
}
}
],
"createdAt": "2024-01-01T00:00:00.000Z",
"lastStateUpdateTime": "2024-01-01T00:00:00.000Z",
"lastStateUpdateKey": "last_state_update_key",
"duration": "<string>",
"name": "incident_name",
"description": "incident_description",
"closedAt": "2024-01-01T00:00:00.000Z",
"isMuted": false,
"metaLabels": [
{
"key": "key",
"value": "value"
}
]
}
]
}Assign one or more incidents to a specific user.
Requires the following permissions:
incidents:assignconst fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/incidents:assign';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"incidentIds":["incident_id_1","incident_id_2"],"assignedTo":{"userId":"user_id"}}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));{
"incidents": [
{
"id": "incident_id",
"state": "INCIDENT_STATE_UNSPECIFIED",
"status": "INCIDENT_STATUS_UNSPECIFIED",
"assignments": [
{
"assignedTo": {
"userId": "user_id"
},
"assignedBy": {
"userId": "user_id"
}
}
],
"severity": "INCIDENT_SEVERITY_UNSPECIFIED",
"contextualLabels": {},
"displayLabels": {},
"events": [
{
"id": "incident_event_id",
"incidentEventType": "INCIDENT_EVENT_TYPE_UNSPECIFIED",
"originatorType": "ORIGINATOR_TYPE_UNSPECIFIED",
"snoozeIndicator": {
"startTime": "2023-11-07T05:31:56Z",
"durationMinutes": 123,
"userId": "<string>"
},
"assignment": {
"assignment": {
"assignedTo": {
"userId": "user_id"
},
"assignedBy": {
"userId": "user_id"
}
}
},
"unassign": {},
"upsertState": {
"stateType": "UPSERT_INCIDENT_STATE_TYPE_UNSPECIFIED",
"payload": {
"cxEventKey": "<string>"
},
"isMuted": true
},
"acknowledge": {
"acknowledgedBy": {
"userId": "user_id"
}
},
"close": {
"closedBy": {
"userId": "user_id"
}
},
"administrativeEvent": {
"userId": "<string>"
},
"operationalEvent": {
"systemName": "<string>"
}
}
],
"createdAt": "2024-01-01T00:00:00.000Z",
"lastStateUpdateTime": "2024-01-01T00:00:00.000Z",
"lastStateUpdateKey": "last_state_update_key",
"duration": "<string>",
"name": "incident_name",
"description": "incident_description",
"closedAt": "2024-01-01T00:00:00.000Z",
"isMuted": false,
"metaLabels": [
{
"key": "key",
"value": "value"
}
]
}
]
}API key authentication
Request to assign one or more incidents to a user
A successful response.
Response containing the updated incidents after assignment
List of incidents after assignment
Show child attributes
"incident_id"
INCIDENT_STATE_UNSPECIFIED, INCIDENT_STATE_TRIGGERED, INCIDENT_STATE_RESOLVED INCIDENT_STATUS_UNSPECIFIED, INCIDENT_STATUS_TRIGGERED, INCIDENT_STATUS_ACKNOWLEDGED, INCIDENT_STATUS_RESOLVED Show child attributes
INCIDENT_SEVERITY_UNSPECIFIED, INCIDENT_SEVERITY_INFO, INCIDENT_SEVERITY_WARNING, INCIDENT_SEVERITY_ERROR, INCIDENT_SEVERITY_CRITICAL, INCIDENT_SEVERITY_LOW The incident's current contextual labels - dynamic labels that give contextual information about the incident (for example, the alert_name label can appear in an incident created by an event originating from the alerting system).
Show child attributes
Show child attributes
The ID of the incident event
"incident_event_id"
INCIDENT_EVENT_TYPE_UNSPECIFIED, INCIDENT_EVENT_TYPE_UPSERT_STATE, INCIDENT_EVENT_TYPE_OPEN, INCIDENT_EVENT_TYPE_CLOSE, INCIDENT_EVENT_TYPE_SNOOZE_INDICATOR, INCIDENT_EVENT_TYPE_ASSIGN, INCIDENT_EVENT_TYPE_UNASSIGN, INCIDENT_EVENT_TYPE_ACKNOWLEDGE ORIGINATOR_TYPE_UNSPECIFIED, ORIGINATOR_TYPE_OPERATIONAL, ORIGINATOR_TYPE_ADMINISTRATIVE Show child attributes
Details of the user who assigned the incident and the user to whom it was assigned
Show child attributes
Show child attributes
UPSERT_INCIDENT_STATE_TYPE_UNSPECIFIED, UPSERT_INCIDENT_STATE_TYPE_TRIGGERED, UPSERT_INCIDENT_STATE_TYPE_RESOLVED "2024-01-01T00:00:00.000Z"
"2024-01-01T00:00:00.000Z"
"last_state_update_key"
"incident_name"
"incident_description"
"2024-01-01T00:00:00.000Z"
false
Was this page helpful?