Spaces method and path for this operation:
get /s/{space_id}/api/context_engine/ai_index/{aiIndexId}
Refer to 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.
[Required authorization] Route required privileges: contextEngine:read.
GET
/api/context_engine/ai_index/{aiIndexId}
curl
curl \
-X GET "https://${KIBANA_URL}/api/context_engine/ai_index/customer_support" \
-H "Authorization: ApiKey ${API_KEY}"
GET kbn:/api/context_engine/ai_index/customer_support
Response examples (200)
Example response returning an AI Index by ID
{
"automations": [
{
"type": "workflow",
"value": "8f1c2d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f"
}
],
"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": [
{
"query": "FROM traces-agent_builder.otel-default\n| WHERE attributes.gen_ai.agent.id IN (\"elastic-ai-agent\")",
"type": "elastic_agent",
"value": "elastic-ai-agent"
}
]
}
Response examples (404)
Context Engine turned off
Context Engine is turned off in this space
{
"error": "Not Found",
"message": "Not Found",
"statusCode": 404
}
No AI Index with the given ID exists in the current space
{
"error": "Not Found",
"message": "AI index 'customer_support' not found",
"statusCode": 404
}