---
type: api
title: Find and/or aggregate detection alerts
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-searchalerts
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-searchalerts
products:
  - Kibana
---

# Find and/or aggregate detection alerts

Authentication: required

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/detection_engine/signals/search`
- `POST` `/s/{space_id}/api/detection_engine/signals/search`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Description

Find and/or aggregate detection alerts that match the given query.

## Request body

Search and/or aggregation query

`application/json`

- `_source` (union boolean | string | string[]) — optional
- `aggs` (object) — optional
- `fields` (string[]) — optional
- `query` (object) — optional
- `runtime_mappings` (object) — optional
- `size` (integer · min: 0) — optional
- `sort` (union oneOf) — optional
  One of: `(string | object)[]` or `string | object`
- `track_total_hits` (boolean) — optional

## Responses

#### `200`

Successful response

`application/json`

Type: `object`

#### `400`

Invalid input data response

`application/json`

One of:
- **PlatformErrorResponse**
  - `error` (string)
  - `message` (string)
  - `statusCode` (integer)
- **SiemErrorResponse**
  - `message` (string)
  - `status_code` (integer)
#### `401`

Unsuccessful authentication response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `500`

Internal server error response

`application/json`

- `message` (string)
- `status_code` (integer)
## Code examples

#### Console

```console
POST kbn:/api/detection_engine/signals/search
{}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/detection_engine/signals/search" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{}
```

#### 400

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "error": "string",
  "message": "string",
  "statusCode": 0
}
```

#### 401

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "error": "string",
  "message": "string",
  "statusCode": 0
}
```

#### 500

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "message": "string",
  "status_code": 0
}
```

