---
type: api
title: List AI Indices
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-context-engine-ai-index
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-context-engine-ai-index
products:
  - Kibana
---

# List AI Indices

Availability: Planned

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

## Paths

- `GET` `/api/context_engine/ai_index`
- `GET` `/s/{space_id}/api/context_engine/ai_index`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Lists up to 100 AI Indices in the current space that the caller can read. The response omits an AI Index when the caller cannot read its backing index. Empty AI Indices are still included. A caller with no read privilege on any index gets a 403 response.

The space comes from the request URL (`/s/{spaceId}/…`) or defaults to the default space. It cannot be specified in any other way.

Returns a 404 response when Context Engine is turned off in this space (`contextEngine:enabled`).

**For more information, refer to the [Context Engine documentation](https://www.elastic.co/docs/explore-analyze/ai-features/context-engine).**<br/><br/>[Required authorization] Route required privileges: contextEngine:read.

## Responses

#### `200`

The AI Indices available to the caller in the current space.

`application/json`

- `ai_indices` ([] object)
  The AI Indices available to the caller in the current space.
  - `automations` ([] object)
    Automations associated with the AI Index.
    - `type` (enum)
      Values: `workflow`
    - `value` (string)
      The workflow ID.
  - `date_created` (string)
    ISO 8601 timestamp of when the AI Index was created.
  - `date_modified` (string)
    ISO 8601 timestamp of when the AI Index was last modified.
  - `description` (string)
    Human-readable description of the AI Index.
  - `dest` (object)
    The data stream or index that backs the AI Index.
    - `type` (enum)
      The type of the backing store.
      Values: `data_stream`, `index`
    - `value` (string)
      The data stream or index the AI Index is attached to.
  - `feedback_analysis` (object)
    The recurring feedback analysis, which reads agent signals and proposes improvement actions for the AI Index.
    - `agent_id` (string)
      Agent Builder agent ID that runs the analysis.
    - `allowed_actions` ([] enum)
      Improvement actions the analysis may propose.
      Values: `add_ki`, `edit_ki`, `remove_ki`, `add_workflow`, `edit_workflow`, `remove_workflow`, `add_source`, `edit_source`, `remove_source`
    - `enabled` (boolean)
      Whether the recurring feedback analysis is desired to run.
    - `schedule` (object)
      When the analysis runs.
      - `interval` (string)
        How often to analyze, for example `1h`.
    - `signal_filter` (string)
      KQL narrowing which signals the analysis reads.
    - `signal_time_range` (union anyOf)
      - **type: relative**
        - `from` (string)
          Date math relative to now, for example `now-30d`.
        - `type` (enum)
          Values: `relative`
      - **type: absolute**
        - `from` (string)
          ISO 8601 date to analyze signals since.
        - `type` (enum)
          Values: `absolute`
  - `id` (string)
    The unique identifier of the AI Index.
  - `managed` (boolean)
    Whether the AI Index is managed by a plugin and therefore immutable.
  - `memory_enabled` (boolean)
    Whether this AI Index accepts memory writes.
  - `sources` ([] object)
    Additional sources that provide context for the AI Index.
    - `type` (enum)
      `esql` for an ES|QL query, or `connector` for a data connector.
      Values: `esql`, `connector`
    - `value` (string)
      An ES|QL query for `esql`, or a connector ID for `connector`.
  - `traces` ([] object)
    Trace sources linked to this AI Index, each with its derived ES|QL query.
    - `query` (string)
      The ES|QL query derived from this trace source at read time.
    - `type` (enum)
      `elastic_agent` for an Agent Builder agent, `index` for an index or data stream name or pattern, or `esql` for an ES|QL query.
      Values: `elastic_agent`, `index`, `esql`
    - `value` (string)
      The trace source value.
#### `403`

The caller has no read privilege on any index, so Elasticsearch rejected the request.

`application/json`

- `error` (string)
  The HTTP status text.
- `message` (string)
  A human-readable error message.
- `statusCode` (number)
  The HTTP status code.
#### `404`

Context Engine is turned off in this space.

`application/json`

- `error` (string)
  The HTTP status text.
- `message` (string)
  A human-readable error message.
- `statusCode` (number)
  The HTTP status code.
## Code Examples

#### Console

```console
GET kbn:/api/context_engine/ai_index
```

#### curl

```curl
curl \
  -X GET "https://${KIBANA_URL}/api/context_engine/ai_index" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response Examples

#### AI Indices the caller can read

Example response listing the AI Indices the caller can read

```json
{
  "ai_indices": [
    {
      "automations": [],
      "date_created": "2026-09-22T12:00:00.000Z",
      "date_modified": "2026-09-22T12:00:00.000Z",
      "description": "Knowledge about customer support cases.",
      "dest": {
        "type": "data_stream",
        "value": "ai-index-ds-customer-support"
      },
      "id": "customer_support",
      "managed": false,
      "memory_enabled": true,
      "sources": [
        {
          "type": "esql",
          "value": "FROM support-cases | LIMIT 100"
        }
      ],
      "traces": []
    }
  ]
}
```

#### No index read privileges

The caller has no read privilege on any index

```json
{
  "error": "Forbidden",
  "message": "security_exception\n\tRoot causes:\n\t\tsecurity_exception: action [indices:data/read/msearch] is unauthorized for user [jdoe] with effective roles [support_reader], this action is granted by the index privileges [read,all]",
  "statusCode": 403
}
```

#### Context Engine turned off

Context Engine is turned off in this space

```json
{
  "error": "Not Found",
  "message": "Not Found",
  "statusCode": 404
}
```

