---
title: "Update a Knowledge Base Entry"
method: PUT
path: "/api/security_ai_assistant/knowledge_base/entries/{id}"
tags: ["Security AI Assistant API"]
---

# Update a Knowledge Base Entry

`PUT /api/security_ai_assistant/knowledge_base/entries/{id}`

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

<div><span class="operation-verb put">put</span>&nbsp;<span class="operation-path">/s/{space_id}/api/security_ai_assistant/knowledge_base/entries/{id}</span></div>

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

Update an existing Knowledge Base Entry by its unique `id`.

## Path parameters

- `id` string, nonempty, required — A string that does not contain only whitespace characters.

## Request body

- union
  - SecurityAIAssistantAPIDocumentEntryCreateFields
    - `global` boolean — Whether this Knowledge Base Entry is global, defaults to false.
    - `name` string, required — Name of the Knowledge Base Entry.
    - `namespace` string — Kibana Space, defaults to 'default' space.
    - `users` SecurityAIAssistantAPIUser[] — Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users.
      - `id` string — User id.
      - `name` string — User name.
    - `kbResource` 'security_labs' | 'defend_insights' | 'user', required — Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc.
    - `source` string, required — Source document name or filepath.
    - `text` string, required — Knowledge Base Entry content.
    - `type` 'document', required — Entry type.
    - `required` boolean — Whether this resource should always be included, defaults to false.
    - `vector` SecurityAIAssistantAPIVector — Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings.
      - `modelId` string, required — ID of the model used to create the embeddings.
      - `tokens` object, required — Tokens with their corresponding values.
  - SecurityAIAssistantAPIIndexEntryCreateFields
    - `global` boolean — Whether this Knowledge Base Entry is global, defaults to false.
    - `name` string, required — Name of the Knowledge Base Entry.
    - `namespace` string — Kibana Space, defaults to 'default' space.
    - `users` SecurityAIAssistantAPIUser[] — Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users.
      - `id` string — User id.
      - `name` string — User name.
    - `description` string, required — Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description.
    - `field` string, required — Field to query for Knowledge Base content.
    - `index` string, required — Index or Data Stream to query for Knowledge Base content.
    - `queryDescription` string, required — Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema.
    - `type` 'index', required — Entry type.
    - `inputSchema` object[] — Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval.
      - `description` string, required — Description of the field.
      - `fieldName` string, required — Name of the field.
      - `fieldType` string, required — Type of the field.
    - `outputFields` string[] — Fields to extract from the query result, defaults to all fields if not provided or empty.

## Response `200`

Successful request returning the updated Knowledge Base Entry.

- union
  - SecurityAIAssistantAPIDocumentEntry
    - `global` boolean, required — Whether this Knowledge Base Entry is global, defaults to false.
    - `name` string, required — Name of the Knowledge Base Entry.
    - `namespace` string, required — Kibana Space, defaults to 'default' space.
    - `users` SecurityAIAssistantAPIUser[], required — Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users.
      - `id` string — User id.
      - `name` string — User name.
    - `createdAt` string, required — Time the Knowledge Base Entry was created.
    - `createdBy` string, required — User who created the Knowledge Base Entry.
    - `id` string, nonempty, required — A string that does not contain only whitespace characters.
    - `updatedAt` string, required — Time the Knowledge Base Entry was last updated.
    - `updatedBy` string, required — User who last updated the Knowledge Base Entry.
    - `kbResource` 'security_labs' | 'defend_insights' | 'user', required — Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc.
    - `source` string, required — Source document name or filepath.
    - `text` string, required — Knowledge Base Entry content.
    - `type` 'document', required — Entry type.
    - `required` boolean — Whether this resource should always be included, defaults to false.
    - `vector` SecurityAIAssistantAPIVector — Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings.
      - `modelId` string, required — ID of the model used to create the embeddings.
      - `tokens` object, required — Tokens with their corresponding values.
  - SecurityAIAssistantAPIIndexEntry
    - `global` boolean, required — Whether this Knowledge Base Entry is global, defaults to false.
    - `name` string, required — Name of the Knowledge Base Entry.
    - `namespace` string, required — Kibana Space, defaults to 'default' space.
    - `users` SecurityAIAssistantAPIUser[], required — Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users.
      - `id` string — User id.
      - `name` string — User name.
    - `createdAt` string, required — Time the Knowledge Base Entry was created.
    - `createdBy` string, required — User who created the Knowledge Base Entry.
    - `id` string, nonempty, required — A string that does not contain only whitespace characters.
    - `updatedAt` string, required — Time the Knowledge Base Entry was last updated.
    - `updatedBy` string, required — User who last updated the Knowledge Base Entry.
    - `description` string, required — Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description.
    - `field` string, required — Field to query for Knowledge Base content.
    - `index` string, required — Index or Data Stream to query for Knowledge Base content.
    - `queryDescription` string, required — Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema.
    - `type` 'index', required — Entry type.
    - `inputSchema` object[] — Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval.
      - `description` string, required — Description of the field.
      - `fieldName` string, required — Name of the field.
      - `fieldType` string, required — Type of the field.
    - `outputFields` string[] — Fields to extract from the query result, defaults to all fields if not provided or empty.

## Other responses

- `400` — Bad Request response.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
