---
title: "Get an AI Index"
method: GET
path: "/api/context_engine/ai_index/{aiIndexId}"
tags: ["context engine"]
---

# Get an AI Index

`GET /api/context_engine/ai_index/{aiIndexId}`

**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/{aiIndexId}</span></div>

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

Fetches an AI Index by ID from the current space, including the ES|QL query derived from each trace.

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.

## Path parameters

- `aiIndexId` string, required

## Response `200`

The requested AI Index.

- object
  - `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

- `404` — No AI Index with the given ID exists in the current space, or 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)
