---
title: "List AI Indices"
method: GET
path: "/api/context_engine/ai_index"
tags: ["context engine"]
---

# List AI Indices

`GET /api/context_engine/ai_index`

**Spaces method and path for this operation:**

<div><span class="operation-verb get">get</span>&nbsp;<span class="operation-path">/s/{space_id}/api/context_engine/ai_index</span></div>

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.

## Response `200`

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

- object
  - `ai_indices` object[], required — The AI Indices available to the caller in the current space.
    - `automations` object[], required — Automations associated with the AI Index.
      - `type` 'workflow', required
      - `value` string, required — The workflow ID.
    - `date_created` string, required — ISO 8601 timestamp of when the AI Index was created.
    - `date_modified` string, required — ISO 8601 timestamp of when the AI Index was last modified.
    - `description` string — Human-readable description of the AI Index.
    - `dest` object, required — The data stream or index that backs the AI Index.
      - `type` 'data_stream' | 'index', required — The type of the backing store.
      - `value` string, required — 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` string[] — Improvement actions the analysis may propose.
      - `enabled` boolean, required — Whether the recurring feedback analysis is desired to run.
      - `schedule` object — When the analysis runs.
        - `interval` string, required — How often to analyze, for example `1h`.
      - `signal_filter` string — KQL narrowing which signals the analysis reads.
      - `signal_time_range` union
        - object
          - `from` string, required — Date math relative to now, for example `now-30d`.
          - `type` 'relative', required
        - object
          - `from` string, required — ISO 8601 date to analyze signals since.
          - `type` 'absolute', required
    - `id` string, required — The unique identifier of the AI Index.
    - `managed` boolean, required — Whether the AI Index is managed by a plugin and therefore immutable.
    - `sources` object[], required — Additional sources that provide context for the AI Index.
      - `type` 'esql' | 'connector', required — `esql` for an ES|QL query, or `connector` for a data connector.
      - `value` string, required — An ES|QL query for `esql`, or a connector ID for `connector`.
    - `traces` object[], required — Trace sources linked to this AI Index, each with its derived ES|QL query.
      - `query` string, required — The ES|QL query derived from this trace source at read time.
      - `type` 'elastic_agent' | 'index' | 'esql', required — `elastic_agent` for an Agent Builder agent, `index` for an index or data stream name or pattern, or `esql` for an ES|QL query.
      - `value` string, required — The trace source value.

## Other responses

- `403` — The caller has no read privilege on any index, so Elasticsearch rejected the request.
- `404` — Context Engine is turned off in this space.

---

[API](https://skmtc.dev/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.dev/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc.dev/elastic/apis/kibana-apis/revisions/a6aad934034f?raw)
