context engine

Query AI Indices

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Runs an ES|QL query as the current user. The server applies a space filter and limits the response to at most 1000 rows.

The query determines which indices it reads. Elasticsearch index privileges limit which indices the current user can access.

The space comes from the request URL (/s/{spaceId}/…) or defaults to the default space. The request body cannot change the space or replace the space filter.

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

For more information, refer to the Context Engine documentation.<br/><br/>[Required authorization] Route required privileges: contextEngine:read.

post/api/context_engine/ai_index/_query

Headers

kbn-xsrfstring required
Example:true

A required header to protect against CSRF attacks

Request body

limitnumber

Maximum rows to return. Defaults to 100; a trailing LIMIT in the query is capped to this value.

paramsobject

Values for ?name placeholders in the query.

querystring required

The ES|QL query to run. Its FROM decides which Elasticsearch indices are read (normally ai-index-*); the server adds the space filter and a row limit.

Response

The columns and rows returned by the ES|QL query.

Changes

No changes recorded. 38 of the 194 revisions have no diff computed, so they could not be searched.