---
type: api
title: Search insights
description: "Returns a paginatable list of insights that were open (active) at any"
url: https://www.elastic.co/elastic/docs-builder/docs/5002/api/cloud-monitoring/operation/operation-searchinsights
resource: https://www.elastic.co/elastic/docs-builder/docs/5002/api/cloud-monitoring/operation/operation-searchinsights
products:
  - Elastic Cloud Hosted
---

# Search insights

Authentication: required

- Server: `https://api.elastic-cloud.com/api` (Elastic Cloud API.)

## Paths

- `POST` `/v1/monitoring/{resourceType}/{resourceId}/insights/_search`

#### Path parameters

- `resourceType` (enum) — required
  The type of the resource.
  Values: `deployments`, `projects`, `clusters`
- `resourceId` (string) — required
  The resource ID (Deployment ID, Serverless project ID, or Connected cluster ID)
to get insights for. It must be a resource of the type given in `resourceType`.
  Example: `deployment-123`

## Description

Returns a paginatable list of insights that were open (active) at any
point during the selected time interval and that match the specified criteria.
An insight matches the time interval when it started at or before `to` and it is
still open, or was closed at or after `from`. By default, only insights that are
currently open are returned; closed insights that overlapped the selected time
interval are included only when `include_closed` is set to `true` in the request body.
Insights of rules that were disabled for the resource are never returned.

The insights are sorted by their start time (`event.start`).

Each criterion narrows the results: an insight is returned only when it matches all
the criteria that are set. Within a criterion that takes a list, an insight matches
when it matches any of the values.

Results are paginated with a cursor: when `return_count` equals the page size, which is
the requested `size` capped at 5000, the response carries a `cursor`; pass it in the next
request to get the next page. Because a full page always carries a cursor, even when no
insights remain, the page that follows the last insight can be empty.

## Required authorization

The caller must be authorized to read AutoOps data for the deployment, project, or
connected cluster named in the path, and the resource must belong to the organization
of the caller. Access is checked for that single resource on every request.

## Request body

The search criteria. When the body is omitted, every default applies.

`application/json`

- `from` (string) — optional
  The start of the time window, either in ISO 8601 format with seconds and a `Z` or
offset time zone, or as a UNIX epoch in milliseconds. The bound is inclusive.
Insights that are still open or that closed at or after this time are included.
Defaults to 24 hours before the time of the request.
- `to` (string) — optional
  The end of the time window, either in ISO 8601 format with seconds and a `Z` or
offset time zone, or as a UNIX epoch in milliseconds. The bound is inclusive.
Only insights that started at or before this time are included.
Defaults to the time of the request. Must not be earlier than `from`.
- `order` (enum · default: desc) — optional
  By default, the most recent insights are returned first.
Use `asc` to return the oldest insights first. The value is case-sensitive.
  Values: `asc`, `desc`
- `cursor` (string) — optional
  When paginating over a list of insights, the cursor found in the previous page
leads to the next page of insights. When this parameter is set, the search
criteria and the order of the request that returned the cursor are used, and all
the other parameters except `size` are validated but otherwise ignored. The cursor is
an opaque value: pass it back exactly as received, and do not parse it or build one
yourself, because its format can change without notice.
- `size` (integer · format: int64 · min: 1 · default: 1000) — optional
  When paginating over a list of insights, the number of insights to return.
Defaults to 1000 when omitted. Values above 5000 are hard capped to 5000.
- `rules` (string[]) — optional
  The IDs of the rules whose insights to return. Values are matched case-insensitively.
The list of rule IDs is available at https://ela.st/autoops-insights.
An unknown rule ID is rejected with a `400` error.
Which rules can raise insights depends on the resource type in the URL.
- `severities` (enum[]) — optional
  The severities of the insights to return. Values are case-sensitive and lowercase.
The severity matched is the one recorded when the insight was raised, which can
differ from `autoops.severity` if the severity of the rule changed afterwards.
  Values: `critical`, `high`, `medium`, `low`, `info`
- `include_closed` (boolean · default: false) — optional
  A boolean indicating whether closed insights should also be returned.
- `actionable_only` (boolean · default: false) — optional
  When true, only insights with at least one recommended action are returned.
- `tags` (string[]) — optional
  The tags to match. A tag matches the whole value of a tag of the insight,
case-insensitively. The available insight tags depend on the rule and on the
resource type in the URL, and they are namespaced, for example
`domain:performance` or `scope:node`. The list of tags is available at
https://ela.st/autoops-insights.
- `modified_only` (boolean · default: false) — optional
  When true, the `from` and `to` time window is matched against the time each insight
was last updated (`event.updated`) instead of its start and end times. Only the latest
update time of the insight is considered, so an insight that was open during the time
window is not returned if it was updated again after `to`. The `include_closed`
setting still applies.

## Responses

#### `200`

The insights that match the search criteria.

`application/json`

- `ok` (boolean)
  Indicates whether the request succeeded. Always `true` for successful responses.
- `match_count` (integer · format: int64)
  The total number of insights that match the search criteria, across all pages. When the
request carries a cursor, it is the total for the criteria of the original search, not
the number of insights that remain.
- `return_count` (integer · format: int64)
  The number of insights that have been returned in the response.
When this number equals the page size, which is the requested `size` capped at 5000,
the response carries a `cursor` and there might be more insights to return.
- `cursor` (string)
  The cursor to the next page of insights. Pass it in the `cursor` field of the
next search request. It is omitted when the page has fewer insights than the page
size, which is the requested `size` capped at 5000. For example, a request with a
`size` of 6000 that returns 5000 insights carries a cursor. The cursor is an opaque
value: do not parse it or build one yourself, because its format can change without
notice.
- `insights` (object[])
  The insights that match the search criteria.
  - `@timestamp` (string · format: date-time)
    The time when the insight was raised, in ISO 8601 format (UTC).
  - `event` (object)
    - `id` (string)
      The public ID of the insight, as a UUID.
    - `start` (string · format: date-time)
      The time when the insight was raised, in ISO 8601 format (UTC).
    - `end` (string · format: date-time)
      The time when the insight was closed, in ISO 8601 format (UTC). Omitted while the insight is open.
    - `duration` (integer · format: int64)
      The duration of the insight in nanoseconds (`end` minus `start`). Omitted while the insight is open.
    - `updated` (string · format: date-time)
      The time when AutoOps last updated the insight, in ISO 8601 format (UTC). It equals `start`
when the insight is raised, AutoOps moves it forward each time it confirms that the insight
is still open, and it equals `end` when the insight is closed.
    - `url` (string)
      The URL that returns this insight.
  - `tags` (string[])
    The tags of the insight, for example `domain:performance` or `scope:node`.
Tag values keep the casing in which they are defined. The list of tags is
available at https://ela.st/autoops-insights.
  - `organization` (object)
    - `id` (string)
      The ID of the organization that owns the resource.
  - `service` (object)
    - `type` (string)
      The service type. Always `elasticsearch`.
    - `id` (string)
      The resource ID (deployment ID, project ID, or connected cluster ID).
    - `name` (string)
      The name of the resource. It can be empty when the resource has no name.
  - `elasticsearch` (object)
    - `cluster` (object)
      - `id` (string)
        The ID of the Elasticsearch cluster.
      - `name` (string)
        The name of the Elasticsearch cluster. It can be empty when the cluster has no name.
    - `node` (object)
      - `name` (string[])
        The node name(s). Always an array, even when only a single node is affected.
      - `id` (string[])
        The node ID(s). Always an array, even when only a single node is affected.
      - `tier` (string)
        The data tier of the nodes, for example `hot`, `warm`, or `cold`.
    - `index` (object)
      - `name` (string[])
        The index name(s). Always an array, even when only a single index is affected.
  - `observer` (object)
    - `name` (string)
      The observer name. Always `autoops`.
  - `rule` (object)
    - `id` (string)
      The ID of the rule that raised the insight, in lowercase. Use it in the `rules` field
of a search request. The list of rule IDs is available at
https://ela.st/autoops-insights.
    - `name` (string)
      The short, human-readable name of the rule.
    - `description` (string)
      The description of the rule and an explanation of its potential impact, as plain text.
  - `message` (string)
    The context and conditions that led to the insight being raised, as plain text.
  - `autoops` (object)
    - `title` (string)
      The human-readable title of the insight, as plain text.
    - `severity` (enum)
      The severity level of an insight.
      Values: `critical`, `high`, `medium`, `low`, `info`
    - `actions` (object[])
      The recommended actions to troubleshoot the insight, in the order to carry them out.
      - `type` (string)
        The identifier of the action type, in lowercase.
      - `title` (string)
        The human-readable title of the action.
      - `description` (string)
        A description of the action and its purpose. It can contain HTML markup, such as
`<code>` tags, and it can be empty.
      - `command` (string)
        A command that carries out the action. Omitted when the action has no command.
#### `400`

Bad request: a malformed body, a value that cannot be read as the type of its field,
an unknown enumeration value, an unknown rule ID, a date that is not valid, a `size`
lower than 1, an invalid cursor, or a `to` date earlier than `from`.

`application/json`

- `ok` (boolean)
  Always `false` for error responses.
- `error` (object)
  - `type` (string)
    The error type, the name of the HTTP status (for example `BAD_REQUEST`).
  - `details` (object)
    Optional additional context about the error, for diagnosis only. It is omitted for most errors, and its structure and wording are not part of the contract and can change.
#### `401`

Unauthorized: the credentials are missing, invalid, or expired, the organization
they belong to has no AutoOps account, or the credentials could not be verified.

`application/json`

- `ok` (boolean)
  Always `false` for error responses.
- `error` (object)
  - `type` (string)
    The error type, the name of the HTTP status (for example `BAD_REQUEST`).
  - `details` (object)
    Optional additional context about the error, for diagnosis only. It is omitted for most errors, and its structure and wording are not part of the contract and can change.
#### `403`

Forbidden: the caller is not authorized to read AutoOps data for the resource
named in the path, or `resourceType` is not one of the supported values.

`application/json`

- `ok` (boolean)
  Always `false` for error responses.
- `error` (object)
  - `type` (string)
    The error type, the name of the HTTP status (for example `BAD_REQUEST`).
  - `details` (object)
    Optional additional context about the error, for diagnosis only. It is omitted for most errors, and its structure and wording are not part of the contract and can change.
#### `404`

Not found: AutoOps has no resource with that ID for the organization of the caller,
or the resource is not of the type given in `resourceType`.

`application/json`

- `ok` (boolean)
  Always `false` for error responses.
- `error` (object)
  - `type` (string)
    The error type, the name of the HTTP status (for example `BAD_REQUEST`).
  - `details` (object)
    Optional additional context about the error, for diagnosis only. It is omitted for most errors, and its structure and wording are not part of the contract and can change.
#### `429`

Too many requests: the organization exceeded the request rate limit of the API,
which is applied per organization. Retry after a few seconds. Responses from this
API don't include `Retry-After` or `x-ratelimit-*` headers.

`application/json`

- `status` (string)
  The reason phrase of the HTTP status.
- `code` (string)
  The error code.
- `message` (string)
  A human-readable explanation of the error.
#### `500`

An unexpected error occurred on the server. Retry the request later.
When AutoOps is temporarily unavailable, the response has no body.

`application/json`

- `ok` (boolean)
  Always `false` for error responses.
- `error` (object)
  - `type` (string)
    The error type, the name of the HTTP status (for example `BAD_REQUEST`).
  - `details` (object)
    Optional additional context about the error, for diagnosis only. It is omitted for most errors, and its structure and wording are not part of the contract and can change.
## Code examples

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/monitoring/deployments/deployment-123/insights/_search" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "2025-08-01T00:00:00.000Z",
    "to": "2025-08-15T23:59:59.999Z",
    "size": 10,
    "order": "desc"
  }'
```

## Response examples

#### Response containing two insights (one closed, one open)

`application/json`

```json
{
  "ok": true,
  "match_count": 2,
  "return_count": 2,
  "insights": [
    {
      "@timestamp": "2025-08-05T14:20:00.000Z",
      "event": {
        "id": "5f4f3e2d-1c0b-0a09-0000-aabbcc110002",
        "start": "2025-08-05T14:20:00.000Z",
        "end": "2025-08-05T14:35:00.000Z",
        "duration": 900000000000,
        "updated": "2025-08-05T14:35:00.000Z",
        "url": "https://api.elastic-cloud.com/api/v1/monitoring/deployments/deployment-abc123/insights/5f4f3e2d-1c0b-0a09-0000-aabbcc110002"
      },
      "tags": [
        "deployment:hosted",
        "deployment:self-managed-ccm",
        "component:elasticsearch",
        "scope:node",
        "domain:cpu",
        "domain:performance",
        "domain:stability"
      ],
      "organization": {
        "id": "org-456"
      },
      "service": {
        "type": "elasticsearch",
        "id": "deployment-abc123",
        "name": "my-production-cluster"
      },
      "elasticsearch": {
        "cluster": {
          "id": "cluster-xyz789",
          "name": "my-production-cluster"
        },
        "node": {
          "name": [
            "instance-0000000002"
          ],
          "id": [
            "node-id-456"
          ],
          "tier": "hot"
        }
      },
      "observer": {
        "name": "autoops"
      },
      "rule": {
        "id": "high_cpu_utilization",
        "name": "High CPU utilization",
        "description": "High CPU usage can lead to slower response times, reduced throughput, increased error rates, and instability or crashing of the cluster. It can also indicate inefficient resource usage, leading to higher costs. Lastly, if Elasticsearch shares hardware with other applications, its high CPU usage can negatively impact their performance. To avoid these problems, it\u0027s crucial to appropriately configure the cluster, optimize operations, monitor performance, and scale resources as necessary."
      },
      "message": "The CPU utilization on node instance-0000000002 has crossed the defined threshold of 80 % usage.",
      "autoops": {
        "title": "The CPU utilization on node instance-0000000002 is high",
        "severity": "medium",
        "actions": [
          {
            "type": "check_slow_log_for_cpu_intensive_queries",
            "title": "Enable and review search slow logs",
            "description": "Enable search slow logs with the action below, then review logs on instance-0000000002 for long-running or repeatedly executed queries. Tune or rewrite expensive queries to reduce CPU load. On 8.14\u002B, set \u003Ccode\u003Eindex.search.slowlog.include.user\u003C/code\u003E to \u003Ccode\u003Etrue\u003C/code\u003E to identify which user triggered slow searches.",
            "command": "// this command requires the manage index privilege\ncurl -X PUT \u0022https://my-production-cluster.es.example.com:9243/my-index/_settings\u0022 -H \u0022Content-Type: application/json\u0022 --data @- \u003C\u003C\u0027JSON\u0027\n{ \u0022index.search.slowlog.threshold.query.warn\u0022: \u002210s\u0022, \u0022index.search.slowlog.threshold.query.info\u0022: \u00225s\u0022, \u0022index.search.slowlog.threshold.query.debug\u0022: \u00222s\u0022, \u0022index.search.slowlog.threshold.query.trace\u0022: \u0022500ms\u0022, \u0022index.search.slowlog.threshold.fetch.warn\u0022: \u00221s\u0022, \u0022index.search.slowlog.threshold.fetch.info\u0022: \u0022800ms\u0022, \u0022index.search.slowlog.threshold.fetch.debug\u0022: \u0022500ms\u0022, \u0022index.search.slowlog.threshold.fetch.trace\u0022: \u0022200ms\u0022 }\nJSON"
          }
        ]
      }
    },
    {
      "@timestamp": "2025-08-01T10:34:00.000Z",
      "event": {
        "id": "5f4f3e2d-1c0b-0a09-0000-aabbcc110001",
        "start": "2025-08-01T10:34:00.000Z",
        "updated": "2025-08-01T10:49:00.000Z",
        "url": "https://api.elastic-cloud.com/api/v1/monitoring/deployments/deployment-abc123/insights/5f4f3e2d-1c0b-0a09-0000-aabbcc110001"
      },
      "tags": [
        "deployment:hosted",
        "deployment:self-managed-ccm",
        "component:elasticsearch",
        "scope:node",
        "domain:cpu",
        "domain:performance",
        "domain:stability"
      ],
      "organization": {
        "id": "org-456"
      },
      "service": {
        "type": "elasticsearch",
        "id": "deployment-abc123",
        "name": "my-production-cluster"
      },
      "elasticsearch": {
        "cluster": {
          "id": "cluster-xyz789",
          "name": "my-production-cluster"
        },
        "node": {
          "name": [
            "instance-0000000001"
          ],
          "id": [
            "node-id-123"
          ],
          "tier": "hot"
        }
      },
      "observer": {
        "name": "autoops"
      },
      "rule": {
        "id": "high_cpu_utilization",
        "name": "High CPU utilization",
        "description": "High CPU usage can lead to slower response times, reduced throughput, increased error rates, and instability or crashing of the cluster. It can also indicate inefficient resource usage, leading to higher costs. Lastly, if Elasticsearch shares hardware with other applications, its high CPU usage can negatively impact their performance. To avoid these problems, it\u0027s crucial to appropriately configure the cluster, optimize operations, monitor performance, and scale resources as necessary."
      },
      "message": "The CPU utilization on node instance-0000000001 has crossed the defined threshold of 80 % usage.",
      "autoops": {
        "title": "The CPU utilization on node instance-0000000001 is high",
        "severity": "medium",
        "actions": [
          {
            "type": "check_slow_log_for_cpu_intensive_queries",
            "title": "Enable and review search slow logs",
            "description": "Enable search slow logs with the action below, then review logs on instance-0000000001 for long-running or repeatedly executed queries. Tune or rewrite expensive queries to reduce CPU load. On 8.14\u002B, set \u003Ccode\u003Eindex.search.slowlog.include.user\u003C/code\u003E to \u003Ccode\u003Etrue\u003C/code\u003E to identify which user triggered slow searches.",
            "command": "// this command requires the manage index privilege\ncurl -X PUT \u0022https://my-production-cluster.es.example.com:9243/my-index/_settings\u0022 -H \u0022Content-Type: application/json\u0022 --data @- \u003C\u003C\u0027JSON\u0027\n{ \u0022index.search.slowlog.threshold.query.warn\u0022: \u002210s\u0022, \u0022index.search.slowlog.threshold.query.info\u0022: \u00225s\u0022, \u0022index.search.slowlog.threshold.query.debug\u0022: \u00222s\u0022, \u0022index.search.slowlog.threshold.query.trace\u0022: \u0022500ms\u0022, \u0022index.search.slowlog.threshold.fetch.warn\u0022: \u00221s\u0022, \u0022index.search.slowlog.threshold.fetch.info\u0022: \u0022800ms\u0022, \u0022index.search.slowlog.threshold.fetch.debug\u0022: \u0022500ms\u0022, \u0022index.search.slowlog.threshold.fetch.trace\u0022: \u0022200ms\u0022 }\nJSON"
          }
        ]
      }
    }
  ]
}
```

#### Rejected criteria, such as an unknown rule ID

`application/json`

```json
{
  "ok": false,
  "error": {
    "type": "BAD_REQUEST"
  }
}
```

#### Invalid value in a field of the body

`application/json`

```json
{
  "ok": false,
  "error": {
    "type": "BAD_REQUEST",
    "details": {
      "size": [
        "must be greater than or equal to 1"
      ]
    }
  }
}
```

#### Unauthorized

`application/json`

```json
{
  "ok": false,
  "error": {
    "type": "UNAUTHORIZED"
  }
}
```

#### Forbidden

`application/json`

```json
{
  "ok": false,
  "error": {
    "type": "FORBIDDEN"
  }
}
```

#### Not found

`application/json`

```json
{
  "ok": false,
  "error": {
    "type": "NOT_FOUND"
  }
}
```

#### Rate limited

`application/json`

```json
{
  "status": "Too Many Requests",
  "code": "429",
  "message": "Rate limit reached. Please try again in few seconds"
}
```

#### Server error

`application/json`

```json
{
  "ok": false,
  "error": {
    "type": "INTERNAL_SERVER_ERROR"
  }
}
```

