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. (incidents) (default: incidents, example: incidents)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_incidentselectincident_idincludeGet the details of an incident by incident_id.
list_incidentsselectinclude, page[size], page[offset]Get all incidents for the user's organization.
search_incidentsselectqueryinclude, sort, page[size], page[offset]Search for incidents matching a certain query.
create_incidentinsertdataCreate an incident.
update_incidentupdateincident_id, dataincludeUpdates an incident. Provide only the attributes that should be updated as this request is a partial update.
delete_incidentdeleteincident_idDeletes an existing incident from the users organization.
import_incidentexecdataincludeImport an incident from an external system. This endpoint allows you to create incidents with<br />historical data such as custom timestamps for detection, declaration, and resolution.<br />Imported incidents do not execute integrations or notification rules.

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).
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
includearraySpecifies which related object types to include in the response when importing an incident.
page[offset]integer (int64)Specific offset to use as the beginning of the returned page.
page[size]integer (int64)Number of items to return per 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 include = '{{ include }}'
;

INSERT examples

Create an incident.

INSERT INTO datadog.service_management.incidents (
data
)
SELECT
'{{ data }}' /* required */
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 }}'
WHERE
incident_id = '{{ incident_id }}' --required
AND 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
;

Lifecycle Methods

EXEC variables use wire (API) names.

Import an incident from an external system. This endpoint allows you to create incidents with<br />historical data such as custom timestamps for detection, declaration, and resolution.<br />Imported incidents do not execute integrations or notification rules.

EXEC datadog.service_management.incidents.import_incident
@include='{{ include }}'
@@json=
'{
"data": "{{ data }}"
}'
;