> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Incidents

Search for incidents matching a certain query.

<Note>
  External Documentation

  To learn more, visit the [Datadog documentation](https://docs.datadoghq.com/api/latest/incidents/#search-for-incidents).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Query     | Specifies which incidents should be returned.<br /><br />The query can contain any number of incident facets joined by ANDs, along with multiple values for each of those facets joined by ORs,<br />for instance - "state:active AND severity:(SEV-2 OR SEV-1)".<br />For more information about the query syntax, visit the \[Query Syntax page]<br />([https://docs.datadoghq.com/tracing/trace\_explorer/query\_syntax/](https://docs.datadoghq.com/tracing/trace_explorer/query_syntax/)). |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter | Description                                                                                 |
  | --------- | ------------------------------------------------------------------------------------------- |
  | Include   | Specifies which types of related objects should be included in the response.                |
  | Sort      | Specifies the order of returned incidents (`created` - ascending, `-created` - descending). |
</div>

## Example Output

```json theme={"dark"}
{
	"data": {
		"type": "incidents_search_results",
		"attributes": {
			"total": 1,
			"facets": {
				"time_to_repair": [
					{
						"name": "time_to_repair",
						"aggregates": {
							"min": null,
							"max": null
						}
					}
				],
				"impact": [
					{
						"name": "None",
						"count": 1
					}
				],
				"time_to_resolve": [
					{
						"name": "time_to_resolve",
						"aggregates": {
							"min": null,
							"max": null
						}
					}
				],
				"fields": [
					{
						"name": "detection_method",
						"facets": [
							{
								"name": "unknown",
								"count": 2
							},
							{
								"name": "customer",
								"count": 0
							},
							{
								"name": "employee",
								"count": 0
							},
							{
								"name": "monitor",
								"count": 0
							},
							{
								"name": "other",
								"count": 0
							}
						]
					}
				]
			},
			"incidents": [
				{
					"type": "incidents",
					"attributes": {
						"resolved": null,
						"fields": {
							"severity": {
								"type": "dropdown",
								"value": "UNKNOWN"
							},
							"root_cause": {
								"type": "textbox",
								"value": null
							},
							"teams": {
								"type": "autocomplete",
								"value": null
							},
							"state": {
								"type": "dropdown",
								"value": "active"
							},
							"services": {
								"type": "autocomplete",
								"value": null
							},
							"detection_method": {
								"type": "dropdown",
								"value": "unknown"
							},
							"summary": {
								"type": "textbox",
								"value": null
							}
						},
						"created": "2023-01-15T12:58:22+00:00",
						"customer_impact_scope": "",
						"last_modified_by_uuid": null,
						"time_to_detect": 0,
						"customer_impact_duration": 0,
						"time_to_resolve": 0,
						"customer_impacted": false,
						"title": "something happend",
						"time_to_internal_response": 0,
						"visibility": "organization",
						"commander": {
							"data": {
								"type": "users",
								"attributes": {
									"name": "John Doe",
									"uuid": "d4170d4a-94c7-11ed-bf65-7630e111ac00",
									"handle": "johndoe@gmail.com,",
									"icon": "https://secure.gravatar.com/avatar/d5977080980b9212b5ff014e1cd1641c?s=48&d=retro",
									"email": "johndoe@gmail.com,"
								},
								"id": "d4170d4a-94c7-11ed-bf65-7630e111ac00"
							}
						},
						"non_datadog_creator": null,
						"created_by_uuid": null,
						"customer_impact_end": null,
						"created_by": {
							"data": {
								"type": "users",
								"attributes": {
									"name": "John Doe",
									"uuid": "d4170d4a-94c7-11ed-bf65-7630e111ac00",
									"handle": "johndoe@gmail.com,",
									"icon": "https://secure.gravatar.com/avatar/d5977080980b9212b5ff014e1cd1641c?s=48&d=retro",
									"email": "johndoe@gmail.com,"
								},
								"id": "d4170d4a-94c7-11ed-bf65-7630e111ac00"
							}
						},
						"last_modified_by": {
							"data": {
								"type": "users",
								"attributes": {
									"name": "John Doe",
									"uuid": "d4170d4a-94c7-11ed-bf65-7630e111ac00",
									"handle": "johndoe@gmail.com,",
									"icon": "https://secure.gravatar.com/avatar/d5977080980b9212b5ff014e1cd1641c?s=48&d=retro",
									"email": "johndoe@gmail.com,"
								},
								"id": "d4170d4a-94c7-11ed-bf65-7630e111ac00"
							}
						},
						"field_analytics": {
							"state": {
								"active": {
									"duration": 0,
									"spans": [
										{
											"start": 1673787502,
											"end": null
										}
									]
								}
							}
						},
						"time_to_repair": 0,
						"modified": "2023-01-15T12:58:22+00:00",
						"detected": "2023-01-15T12:58:22+00:00",
						"severity": "UNKNOWN",
						"creation_idempotency_key": null,
						"notification_handles": [
							{
								"display_name": "John Doe",
								"handle": "johndoe@gmail.com,",
								"created_at": "2023-01-15T12:58:22.533787+00:00"
							}
						],
						"state": "active",
						"public_id": 1,
						"customer_impact_start": null
					},
					"relationships": {
						"commander_user": {
							"data": {
								"type": "users",
								"id": "d4170d4a-94c7-11ed-bf65-7630e111ac00"
							}
						},
						"created_by_user": {
							"data": {
								"type": "users",
								"id": "d4170d4a-94c7-11ed-bf65-7630e111ac00"
							}
						},
						"integrations": {
							"data": []
						},
						"last_modified_by_user": {
							"data": {
								"type": "users",
								"id": "d4170d4a-94c7-11ed-bf65-7630e111ac00"
							}
						},
						"responders": {
							"data": [
								{
									"type": "incident_responders",
									"id": "241aa212-ffc0-5a0a-ac8a-d1dd10a8b1b9"
								}
							]
						},
						"impacts": {
							"data": []
						},
						"user_defined_fields": {
							"data": []
						},
						"attachments": {
							"data": []
						}
					},
					"id": "f4f5028c-1409-54f0-ba90-be0a42471b49"
				}
			]
		},
		"relationships": {
			"incidents_relationship": {
				"data": []
			}
		}
	},
	"meta": {
		"pagination": {
			"offset": 0,
			"next_offset": 0,
			"size": 0
		}
	}
}
```

## Workflow Library Example

[Search Incidents with Datadog and Send Results Via Email](https://library.blinkops.com/workflows/search-incidents-with-datadog-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/search-incidents-with-datadog-and-send-results-via-email/canvas" />
</div>
