Delete an AI Index Experimental

DELETE /api/context_engine/ai_index/{aiIndexId}

Spaces method and path for this operation:

delete /s/{space_id}/api/context_engine/ai_index/{aiIndexId}

Refer to Spaces for more information.

Deletes an AI Index by ID.

By default, the API preserves the backing data stream or index, its Knowledge Indicators, and attached workflow automations. Set delete_knowledge_indicators to true to delete the backing data stream or index and its Knowledge Indicators. Set delete_automations to true to delete the attached workflow automations.

The API does not delete the backing data stream or index when another AI Index uses the same destination.

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:write. Extended privileges (optional, expand functionality when granted): workflowsManagement:delete.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • aiIndexId string Required

    The unique identifier of the AI Index.

    Minimum length is 1, maximum length is 256.

Query parameters

  • delete_knowledge_indicators boolean

    When true, also delete the backing data stream/index, which removes its Knowledge Indicators. Skipped when another AI Index still uses the same dest. Defaults to false.

    Default value is false.

  • delete_automations boolean

    When true, also delete the attached workflow automations. Defaults to false.

    Default value is false.

Responses

  • 200 application/json

    The AI Index entry was deleted. errors lists any best-effort cleanup failures.

    Hide response attributes Show response attributes object
    • acknowledged boolean Required

      Whether the AI Index entry was deleted.

    • errors array[string] Required

      Best-effort cleanup errors after the entry was deleted, if any.

  • 404 application/json

    No AI Index with the given ID exists in the current space, or Context Engine is turned off in this space.

    Hide response attributes Show response attributes object
    • error string

      The HTTP status text.

    • message string Required

      A human-readable error message.

    • statusCode number

      The HTTP status code.

  • 409 application/json

    The AI Index is managed and cannot be deleted.

    Hide response attributes Show response attributes object
    • error string

      The HTTP status text.

    • message string Required

      A human-readable error message.

    • statusCode number

      The HTTP status code.

DELETE /api/context_engine/ai_index/{aiIndexId}
curl \
  -X DELETE "https://${KIBANA_URL}/api/context_engine/ai_index/customer_support?delete_knowledge_indicators=true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true"
DELETE kbn:/api/context_engine/ai_index/customer_support?delete_knowledge_indicators=true
Response examples (200)
The entry was deleted but a best-effort cleanup step failed
{
  "acknowledged": true,
  "errors": [
    "Failed to delete automations: Workflows management is unavailable."
  ]
}
Example response after the AI Index entry is deleted
{
  "acknowledged": true,
  "errors": []
}
Response examples (404)
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
}
Response examples (409)
The AI Index is managed by a plugin and cannot be deleted
{
  "error": "Conflict",
  "message": "AI index 'customer_support' is managed and cannot be modified via the API",
  "statusCode": 409
}