Skip to main content

incidents

Creates, updates, deletes, gets or lists an incidents resource.

Overview

Nameincidents
TypeResource
Iddatadog.service_management.incidents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe incident's ID. (example: 00000000-0000-0000-1234-000000000000)
attributesobjectThe incident's attributes from a response.
relationshipsobjectThe incident's relationships from a response.
typestringIncident resource type. (default: incidents, example: incidents)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_incidentselectincident_id, regionincludeGet the details of an incident by incident_id.
list_incidentsselectregioninclude, page[size], page[offset]Get all incidents for the user's organization.
search_incidentsselectquery, regioninclude, sort, page[size], page[offset]Search for incidents matching a certain query.
create_incidentinsertregion, data__dataCreate an incident.
update_incidentupdateincident_id, region, data__dataincludeUpdates an incident. Provide only the attributes that should be updated as this request is a partial update.
delete_incidentdeleteincident_id, regionDeletes an existing incident from the users organization.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
incident_idstringThe UUID of the incident.
querystringSpecifies which incidents should be returned. The query can contain any number of incident facets joined by ANDs, along with multiple values for each of those facets joined by ORs. For example: state:active AND severity:(SEV-2 OR SEV-1).
regionstring(default: datadoghq.com)
includearraySpecifies which types of related objects should be included in the response.
page[offset]integer (int64)Specific offset to use as the beginning of the returned page.
page[size]integer (int64)Size for a given page. The maximum allowed value is 100.
sortstringSpecifies the order of returned incidents.

SELECT examples

Get the details of an incident by incident_id.

SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.incidents
WHERE incident_id = '{{ incident_id }}' -- required
AND region = '{{ region }}' -- required
AND include = '{{ include }}'
;

INSERT examples

Create an incident.

INSERT INTO datadog.service_management.incidents (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data,
included
;

UPDATE examples

Updates an incident. Provide only the attributes that should be updated as this request is a partial update.

UPDATE datadog.service_management.incidents
SET
data__data = '{{ data }}'
WHERE
incident_id = '{{ incident_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
AND include = '{{ include}}'
RETURNING
data,
included;

DELETE examples

Deletes an existing incident from the users organization.

DELETE FROM datadog.service_management.incidents
WHERE incident_id = '{{ incident_id }}' --required
AND region = '{{ region }}' --required
;