diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 3f37d3db4d2e7..2450381cf44a2 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -20466,25 +20466,52 @@ paths: content: application/json: schema: + example: + create: + - allowed: true + anonymized: false + field: host.name + - allowed: false + anonymized: true + field: user.name + delete: + ids: + - field5 + - field6 + query: 'field: host.name' + update: + - allowed: true + anonymized: false + id: field8 + - allowed: false + anonymized: true + id: field9 type: object properties: create: + description: Array of anonymization fields to create. items: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldCreateProps' type: array delete: + description: Object containing the query to filter anonymization fields and/or an array of anonymization field IDs to delete. type: object properties: ids: - description: Array of anonymization fields IDs + description: Array of IDs to apply the action to. + example: + - '1234' + - '5678' items: type: string minItems: 1 type: array query: - description: Query to filter anonymization fields + description: Query to filter the bulk action. + example: 'status: ''inactive''' type: string update: + description: Array of anonymization fields to update. items: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldUpdateProps' type: array @@ -20492,20 +20519,67 @@ paths: '200': content: application/json: + example: + anonymization_fields_count: 5 + attributes: + results: + created: + - allowed: false + anonymized: true + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: host.name + id: field2 + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + deleted: + - field3 + skipped: + - id: field4 + name: user.name + skip_reason: ANONYMIZATION_FIELD_NOT_MODIFIED + updated: + - allowed: true + anonymized: false + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: url.domain + id: field8 + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + summary: + failed: 1 + skipped: 1 + succeeded: 2 + total: 5 + message: Bulk action completed successfully + status_code: 200 + success: true schema: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkCrudActionResponse' description: Indicates a successful call. '400': content: application/json: + example: + error: Bad Request + message: Invalid request body + statusCode: 400 schema: type: object properties: error: + description: Error type or name. type: string message: + description: Detailed error message. type: string statusCode: + description: Status code of the response. type: number description: Generic Error summary: Apply a bulk action to anonymization fields @@ -20516,7 +20590,13 @@ paths: description: Get a list of all anonymization fields. operationId: FindAnonymizationFields parameters: - - in: query + - description: Fields to return + example: + - id + - field + - anonymized + - allowed + in: query name: fields required: false schema: @@ -20524,24 +20604,28 @@ paths: type: string type: array - description: Search query + example: 'field: "user.name"' in: query name: filter required: false schema: type: string - description: Field to sort by + example: created_at in: query name: sort_field required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_FindAnonymizationFieldsSortField' - description: Sort order + example: asc in: query name: sort_order required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - description: Page number + example: 1 in: query name: page required: false @@ -20550,6 +20634,7 @@ paths: minimum: 1 type: integer - description: AnonymizationFields per page + example: 20 in: query name: per_page required: false @@ -20561,6 +20646,21 @@ paths: '200': content: application/json: + example: + data: + - allowed: true + anonymized: true + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: user.name + id: '1' + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + page: 1 + perPage: 20 + total: 100 schema: type: object properties: @@ -20583,6 +20683,10 @@ paths: '400': content: application/json: + example: + error: Bad Request + message: Invalid request parameters + statusCode: 400 schema: type: object properties: @@ -20602,6 +20706,7 @@ paths: operationId: ChatComplete parameters: - description: If true, the response will not include content references. + example: false in: query name: content_references_disabled required: false @@ -20611,6 +20716,24 @@ paths: requestBody: content: application/json: + example: + connectorId: conn-001 + conversationId: abc123 + isStream: true + langSmithApiKey: sk-abc123 + langSmithProject: security_ai_project + messages: + - content: What are some common phishing techniques? + data: + user_id: user_789 + fields_to_anonymize: + - user.name + - source.ip + role: user + model: gpt-4 + persist: true + promptId: prompt_456 + responseLanguage: en schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ChatCompleteProps' required: true @@ -20621,7 +20744,7 @@ paths: schema: format: binary type: string - description: Indicates a successful call. + description: Indicates a successful model response call. '400': content: application/json: @@ -20629,10 +20752,16 @@ paths: type: object properties: error: + description: Error type. + example: Bad Request type: string message: + description: Human-readable error message. + example: Invalid request payload. type: string statusCode: + description: HTTP status code. + example: 400 type: number description: Generic Error summary: Create a model response @@ -20640,11 +20769,23 @@ paths: - Security AI Assistant API /api/security_ai_assistant/current_user/conversations: post: - description: Create a new Security AI Assistant conversation. + description: Create a new Security AI Assistant conversation. This endpoint allows the user to initiate a conversation with the Security AI Assistant by providing the required parameters. operationId: CreateConversation requestBody: content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + excludeFromLastConversationStorage: false + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCreateProps' required: true @@ -20652,9 +20793,27 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationResponse' - description: Indicates a successful call. + description: Indicates a successful call. The conversation was created successfully. '400': content: application/json: @@ -20662,59 +20821,72 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: 'Missing required parameter: title' type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. This response indicates an issue with the request, such as missing required parameters or incorrect data. summary: Create a conversation tags: - Security AI Assistant API /api/security_ai_assistant/current_user/conversations/_find: get: - description: Get a list of all conversations for the current user. + description: Get a list of all conversations for the current user. This endpoint allows users to search, filter, sort, and paginate through their conversations. operationId: FindConversations parameters: - - in: query + - description: A list of fields to include in the response. If omitted, all fields are returned. + in: query name: fields required: false schema: + example: + - id + - title + - createdAt items: type: string type: array - - description: Search query + - description: A search query to filter the conversations. Can match against titles, messages, or other conversation attributes. in: query name: filter required: false schema: + example: Security Issue type: string - - description: Field to sort by + - description: The field by which to sort the results. Valid fields are `created_at`, `title`, and `updated_at`. in: query name: sort_field required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_FindConversationsSortField' - - description: Sort order + example: created_at + - description: The order in which to sort the results. Can be either `asc` for ascending or `desc` for descending. in: query name: sort_order required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number + example: desc + - description: The page number of the results to retrieve. Default is 1. in: query name: page required: false schema: default: 1 + example: 1 minimum: 1 type: integer - - description: Conversations per page + - description: The number of conversations to return per page. Default is 20. in: query name: per_page required: false schema: default: 20 + example: 20 minimum: 0 type: integer responses: @@ -20725,21 +20897,28 @@ paths: type: object properties: data: + description: A list of conversations. items: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationResponse' type: array page: + description: The current page of the results. + example: 1 type: integer perPage: + description: The number of results returned per page. + example: 20 type: integer total: + description: The total number of conversations matching the filter criteria. + example: 100 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response, returns a paginated list of conversations matching the specified criteria. '400': content: application/json: @@ -20747,21 +20926,25 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid filter query parameter type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. The request could not be processed due to an invalid query parameter or other issue. summary: Get conversations tags: - Security AI Assistant API /api/security_ai_assistant/current_user/conversations/{id}: delete: - description: Delete an existing conversation using the conversation ID. + description: Delete an existing conversation using the conversation ID. This endpoint allows users to permanently delete a conversation. operationId: DeleteConversation parameters: - description: The conversation's `id` value. + example: abc123 in: path name: id required: true @@ -20771,9 +20954,27 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: The conversation has been deleted. + role: system + timestamp: '2023-10-31T12:35:00Z' + replacements: {} + title: Deleted Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationResponse' - description: Indicates a successful call. + description: Indicates a successful call. The conversation was deleted successfully. '400': content: application/json: @@ -20781,20 +20982,24 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid conversation ID type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. This response indicates an issue with the request. summary: Delete a conversation tags: - Security AI Assistant API get: - description: Get the details of an existing conversation using the conversation ID. + description: Get the details of an existing conversation using the conversation ID. This allows users to fetch the specific conversation data by its unique ID. operationId: ReadConversation parameters: - - description: The conversation's `id` value. + - description: The conversation's `id` value, a unique identifier for the conversation. + example: abc123 in: path name: id required: true @@ -20804,9 +21009,27 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationResponse' - description: Indicates a successful call. + description: Indicates a successful call. The conversation details are returned. '400': content: application/json: @@ -20814,20 +21037,24 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid conversation ID type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. The request could not be processed due to an error. summary: Get a conversation tags: - Security AI Assistant API put: - description: Update an existing conversation using the conversation ID. + description: Update an existing conversation using the conversation ID. This endpoint allows users to modify the details of an existing conversation. operationId: UpdateConversation parameters: - description: The conversation's `id` value. + example: abc123 in: path name: id required: true @@ -20836,6 +21063,18 @@ paths: requestBody: content: application/json: + example: + apiConfig: + actionTypeId: '09876' + connectorId: '54321' + category: insights + excludeFromLastConversationStorage: true + messages: + - content: The issue was resolved. + role: assistant + timestamp: '2023-10-31T12:30:00Z' + replacements: {} + title: Updated Security Discussion schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationUpdateProps' required: true @@ -20843,9 +21082,27 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '09876' + connectorId: '54321' + category: insights + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: true + id: abc123 + messages: + - content: The issue was resolved. + role: assistant + timestamp: '2023-10-31T12:30:00Z' + replacements: {} + title: Updated Security Discussion + updatedAt: '2023-10-31T12:31:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationResponse' - description: Indicates a successful call. + description: Indicates a successful call. The conversation was updated successfully. '400': content: application/json: @@ -20853,12 +21110,15 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: 'Missing required field: title' type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. This response indicates an issue with the request, such as missing required parameters or incorrect data. summary: Update a conversation tags: - Security AI Assistant API @@ -20868,6 +21128,7 @@ paths: operationId: ReadKnowledgeBase parameters: - description: The KnowledgeBase `resource` value. + example: kb12345 in: path name: resource schema: @@ -20880,16 +21141,28 @@ paths: type: object properties: elser_exists: + description: Indicates if the ELSER model exists for the KnowledgeBase. + example: true type: boolean is_setup_available: + description: Indicates if the setup process is available for the KnowledgeBase. + example: true type: boolean is_setup_in_progress: + description: Indicates if the setup process is currently in progress. + example: false type: boolean product_documentation_status: + description: The status of the product documentation in the KnowledgeBase. + example: complete type: string security_labs_exists: + description: Indicates if Security Labs documentation exists in the KnowledgeBase. + example: true type: boolean user_data_exists: + description: Indicates if user data exists in the KnowledgeBase. + example: false type: boolean description: Indicates a successful call. '400': @@ -20899,10 +21172,16 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid resource ID provided. type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number description: Generic Error summary: Read a KnowledgeBase @@ -20913,17 +21192,20 @@ paths: operationId: CreateKnowledgeBase parameters: - description: The KnowledgeBase `resource` value. + example: kb12345 in: path name: resource schema: type: string - - description: Optional ELSER modelId to use when setting up the Knowledge Base + - description: ELSER modelId to use when setting up the Knowledge Base. If not provided, a default model will be used. + example: elser-model-001 in: query name: modelId required: false schema: type: string - - description: Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base + - description: Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base. Defaults to `false`. + example: true in: query name: ignoreSecurityLabs required: false @@ -20944,10 +21226,16 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid resource ID provided. type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number description: Generic Error summary: Create a KnowledgeBase @@ -20960,6 +21248,13 @@ paths: requestBody: content: application/json: + example: + content: To reset your password, go to the settings page and click 'Reset Password'. + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps' required: true @@ -20967,21 +21262,32 @@ paths: '200': content: application/json: + example: + content: To reset your password, go to the settings page and click 'Reset Password'. + id: '12345' + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' description: Successful request returning Knowledge Base Entries '400': content: application/json: + example: + error: Invalid input + message: The 'title' field is required. schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: A generic error occurred, such as invalid input or missing required fields. summary: Create a Knowledge Base Entry tags: - Security AI Assistant API /api/security_ai_assistant/knowledge_base/entries/_bulk_action: post: - description: The bulk action is applied to all Knowledge Base Entries that match the filter or to the list of Knowledge Base Entries by their IDs + description: The bulk action is applied to all Knowledge Base Entries that match the filter or to the list of Knowledge Base Entries by their IDs. operationId: PerformKnowledgeBaseEntryBulkAction requestBody: content: @@ -20990,6 +21296,10 @@ paths: type: object properties: create: + description: List of Knowledge Base Entries to create. + example: + - content: This is the content of the new entry. + title: New Entry items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps' type: array @@ -20997,15 +21307,25 @@ paths: type: object properties: ids: - description: Array of Knowledge base Entry IDs + description: Array of Knowledge Base Entry IDs. + example: + - '123' + - '456' + - '789' items: type: string minItems: 1 type: array query: - description: Query to filter Knowledge Base Entries + description: Query to filter Knowledge Base Entries. + example: status:active AND category:technology type: string update: + description: List of Knowledge Base Entries to update. + example: + - content: Updated content. + id: '123' + title: Updated Entry items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps' type: array @@ -21030,45 +21350,54 @@ paths: description: Finds Knowledge Base Entries that match the given query. operationId: FindKnowledgeBaseEntries parameters: - - in: query + - description: A list of fields to include in the response. If not provided, all fields will be included. + in: query name: fields required: false schema: + example: + - title + - created_at items: type: string type: array - - description: Search query + - description: Search query to filter Knowledge Base Entries by specific criteria. in: query name: filter required: false schema: + example: error handling type: string - - description: Field to sort by + - description: Field to sort the Knowledge Base Entries by. in: query name: sort_field required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_FindKnowledgeBaseEntriesSortField' - - description: Sort order + example: created_at + - description: Sort order for the results, either asc or desc. in: query name: sort_order required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number + example: asc + - description: Page number for paginated results. Defaults to 1. in: query name: page required: false schema: default: 1 + example: 2 minimum: 1 type: integer - - description: Knowledge Base Entries per page + - description: Number of Knowledge Base Entries to return per page. Defaults to 20. in: query name: per_page required: false schema: default: 20 + example: 10 minimum: 0 type: integer responses: @@ -21079,21 +21408,28 @@ paths: type: object properties: data: + description: The list of Knowledge Base Entries for the current page. items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' type: array page: + description: The current page number. + example: 1 type: integer perPage: + description: The number of Knowledge Base Entries returned per page. + example: 20 type: integer total: + description: The total number of Knowledge Base Entries available. + example: 100 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response containing the paginated Knowledge Base Entries. '400': content: application/json: @@ -21101,21 +21437,28 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed message explaining the error. + example: 'Invalid query parameter: sort_order' type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number - description: Generic Error + description: Generic Error indicating an issue with the request. summary: Finds Knowledge Base Entries that match the given query. tags: - Security AI Assistant API /api/security_ai_assistant/knowledge_base/entries/{id}: delete: - description: Deletes a single Knowledge Base Entry using the `id` field + description: Delete a Knowledge Base Entry by its unique `id`. operationId: DeleteKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value + - description: The unique identifier (`id`) of the Knowledge Base Entry to delete. + example: '12345' in: path name: id required: true @@ -21125,23 +21468,30 @@ paths: '200': content: application/json: + example: + id: '12345' + message: Knowledge Base Entry successfully deleted. schema: $ref: '#/components/schemas/Security_AI_Assistant_API_DeleteResponseFields' - description: Successful request returning the deleted Knowledge Base Entry's ID + description: Successful request returning the `id` of the deleted Knowledge Base Entry. '400': content: application/json: + example: + error: Not Found + message: No Knowledge Base Entry found with the provided `id`. schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: A generic error occurred, such as an invalid `id` or the entry not being found. summary: Deletes a single Knowledge Base Entry using the `id` field tags: - Security AI Assistant API get: - description: Read a Knowledge Base Entry + description: Retrieve a Knowledge Base Entry by its unique `id`. operationId: ReadKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value. + - description: The unique identifier (`id`) of the Knowledge Base Entry to retrieve. + example: '12345' in: path name: id required: true @@ -21151,23 +21501,35 @@ paths: '200': content: application/json: + example: + content: To reset your password, go to the settings page and click 'Reset Password'. + id: '12345' + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' - description: Successful request returning a Knowledge Base Entry + description: Successful request returning the requested Knowledge Base Entry. '400': content: application/json: + example: + error: Not Found + message: No Knowledge Base Entry found with the provided `id`. schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: A generic error occurred, such as an invalid `id` or the entry not being found. summary: Read a Knowledge Base Entry tags: - Security AI Assistant API put: - description: Update a Knowledge Base Entry + description: Update an existing Knowledge Base Entry by its unique `id`. operationId: UpdateKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value + - description: The unique identifier (`id`) of the Knowledge Base Entry to update. + example: '12345' in: path name: id required: true @@ -21176,6 +21538,14 @@ paths: requestBody: content: application/json: + example: + content: To reset your password, go to the settings page, click 'Reset Password', and follow the instructions. + tags: + - password + - reset + - help + - update + title: How to reset a password (updated) schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryUpdateRouteProps' required: true @@ -21183,45 +21553,76 @@ paths: '200': content: application/json: + example: + content: To reset your password, go to the settings page, click 'Reset Password', and follow the instructions. + id: '12345' + tags: + - password + - reset + - help + - update + title: How to reset a password (updated) schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' - description: Successful request returning the updated Knowledge Base Entry + description: Successful request returning the updated Knowledge Base Entry. '400': content: application/json: + example: + error: Invalid input + message: The 'content' field cannot be empty. schema: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: A generic error occurred, such as invalid input or the entry not being found. summary: Update a Knowledge Base Entry tags: - Security AI Assistant API /api/security_ai_assistant/prompts/_bulk_action: post: - description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. + description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. This action allows for bulk create, update, or delete operations. operationId: PerformPromptsBulkAction requestBody: content: application/json: + example: + create: + - content: Please verify the security settings. + name: New Security Prompt + promptType: system + delete: + ids: + - prompt1 + - prompt2 + update: + - content: Updated content for security prompt. + id: prompt123 schema: type: object properties: create: + description: List of prompts to be created. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptCreateProps' type: array delete: + description: Criteria for deleting prompts in bulk. type: object properties: ids: - description: Array of prompts IDs + description: Array of IDs to apply the action to. + example: + - '1234' + - '5678' items: type: string minItems: 1 type: array query: - description: Query to filter promps + description: Query to filter the bulk action. + example: 'status: ''inactive''' type: string update: + description: List of prompts to be updated. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptUpdateProps' type: array @@ -21229,9 +21630,41 @@ paths: '200': content: application/json: + examples: + success: + value: + attributes: + errors: [] + results: + created: + - content: Please verify the security settings. + id: prompt6 + name: New Security Prompt + promptType: system + deleted: + - prompt2 + - prompt3 + skipped: + - id: prompt4 + name: Security Prompt + skip_reason: PROMPT_FIELD_NOT_MODIFIED + updated: + - content: Updated security settings prompt + id: prompt1 + name: Security Prompt + promptType: system + summary: + failed: 0 + skipped: 1 + succeeded: 4 + total: 5 + message: Bulk action completed successfully. + prompts_count: 5 + status_code: 200 + success: true schema: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse' - description: Indicates a successful call. + description: Indicates a successful call with the results of the bulk action. '400': content: application/json: @@ -21239,59 +21672,73 @@ paths: type: object properties: error: + description: A short error message. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid prompt ID or missing required fields. type: string statusCode: + description: The HTTP status code for the error. + example: 400 type: number - description: Generic Error + description: Indicates a generic error due to a bad request. summary: Apply a bulk action to prompts tags: - Security AI Assistant API /api/security_ai_assistant/prompts/_find: get: - description: Get a list of all prompts. + description: Get a list of all prompts based on optional filters, sorting, and pagination. operationId: FindPrompts parameters: - - in: query + - description: List of specific fields to include in each returned prompt. + in: query name: fields required: false schema: + example: + - id + - name + - content items: type: string type: array - - description: Search query + - description: Search query string to filter prompts by matching fields. in: query name: filter required: false schema: + example: error handling type: string - - description: Field to sort by + - description: Field to sort prompts by. in: query name: sort_field required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_FindPromptsSortField' - - description: Sort order + - description: Sort order, either asc or desc. in: query name: sort_order required: false schema: $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' - - description: Page number + - description: Page number for pagination. in: query name: page required: false schema: default: 1 + example: 1 minimum: 1 type: integer - - description: Prompts per page + - description: Number of prompts per page. in: query name: per_page required: false schema: default: 20 + example: 20 minimum: 0 type: integer responses: @@ -21299,24 +21746,56 @@ paths: content: application/json: schema: + example: + data: + - categories: + - troubleshooting + - logging + color: '#FF5733' + consumer: security + content: If you encounter an error, check the logs and retry. + createdAt: '2025-04-20T21:00:00Z' + createdBy: jdoe + id: prompt-123 + isDefault: true + isNewConversationDefault: false + name: Error Troubleshooting Prompt + namespace: default + promptType: standard + timestamp: '2025-04-30T22:30:00Z' + updatedAt: '2025-04-30T22:45:00Z' + updatedBy: jdoe + users: + - full_name: John Doe + username: jdoe + page: 1 + perPage: 20 + total: 142 type: object properties: data: + description: The list of prompts returned based on the search query, sorting, and pagination. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' type: array page: + description: Current page number. + example: 1 type: integer perPage: + description: Number of prompts per page. + example: 20 type: integer total: + description: Total number of prompts matching the query. + example: 142 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response containing a list of prompts. '400': content: application/json: @@ -21324,12 +21803,18 @@ paths: type: object properties: error: + description: Short error message. + example: Bad Request type: string message: + description: Detailed description of the error. + example: Invalid sort order value provided. type: string statusCode: + description: HTTP status code for the error. + example: 400 type: number - description: Generic Error + description: Bad request due to invalid parameters or malformed query. summary: Get prompts tags: - Security AI Assistant API @@ -34524,10 +35009,16 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean field: + description: Name of the anonymization field to create. + example: host.name type: string required: - field @@ -34535,8 +35026,12 @@ components: type: object properties: id: + description: The ID of the anonymization field. + example: field12 type: string name: + description: Name of the anonymization field. + example: host.name type: string required: - id @@ -34544,30 +35039,48 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean createdAt: + description: Timestamp of when the anonymization field was created. + example: '2023-10-31T12:00:00Z' type: string createdBy: + description: Username of the person who created the anonymization field. + example: user1 type: string field: + description: Name of the anonymization field. + example: url.domain type: string id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + description: The ID of the anonymization field. namespace: - description: Kibana space + description: Kibana space in which this anonymization field exists. + example: default type: string timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp' + description: Timestamp when the anonymization field was initially created. updatedAt: + description: Timestamp of the last update. + example: '2023-10-31T12:00:00Z' type: string updatedBy: + description: Username of the person who last updated the field. + example: user1 type: string required: - id - field Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipReason: + description: Reason why the anonymization field was not modified. enum: - ANONYMIZATION_FIELD_NOT_MODIFIED type: string @@ -34575,11 +35088,16 @@ components: type: object properties: id: + description: The ID of the anonymization field that was not modified. + example: field4 type: string name: + description: Name of the anonymization field that was not modified. + example: user.name type: string skip_reason: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipReason' + description: Reason why the anonymization field was not modified. required: - id - skip_reason @@ -34587,11 +35105,14 @@ components: type: object properties: anonymization_fields_count: + description: Total number of anonymization fields processed. + example: 5 type: integer attributes: type: object properties: errors: + description: List of errors that occurred during the bulk operation. items: $ref: '#/components/schemas/Security_AI_Assistant_API_NormalizedAnonymizationFieldError' type: array @@ -34603,10 +35124,16 @@ components: - results - summary message: + description: Message providing information about the bulk action result. + example: Bulk action completed successfully type: string status_code: + description: HTTP status code returned. + example: 200 type: integer success: + description: Indicates if the bulk action was successful. + example: true type: boolean required: - attributes @@ -34614,18 +35141,23 @@ components: type: object properties: created: + description: List of anonymization fields successfully created. items: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse' type: array deleted: items: + description: Array of IDs of anonymization fields that were deleted. + example: field3 type: string type: array skipped: + description: List of anonymization fields that were skipped during the operation. items: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldsBulkActionSkipResult' type: array updated: + description: List of anonymization fields successfully updated. items: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldResponse' type: array @@ -34638,10 +35170,16 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean id: + description: The ID of the anonymization field to update. + example: field8 type: string required: - id @@ -34649,20 +35187,25 @@ components: type: object properties: actionTypeId: - description: action type id + description: Action type ID + example: actionType456 type: string connectorId: - description: connector id + description: Connector ID + example: connector123 type: string defaultSystemPromptId: - description: defaultSystemPromptId + description: Default system prompt ID + example: systemPrompt001 type: string model: - description: model + description: Model + example: gpt-4 type: string provider: $ref: '#/components/schemas/Security_AI_Assistant_API_Provider' description: Provider + example: OpenAI required: - connectorId - actionTypeId @@ -34672,9 +35215,11 @@ components: properties: id: description: Id of the content reference + example: content123 type: string type: description: Type of the content reference + example: SecurityAlert type: string required: - id @@ -34683,12 +35228,20 @@ components: type: object properties: failed: + description: The number of failed actions. + example: 0 type: integer skipped: + description: The number of skipped actions. + example: 1 type: integer succeeded: + description: The number of successfully performed actions. + example: 10 type: integer total: + description: The total number of actions attempted. + example: 12 type: integer required: - failed @@ -34696,59 +35249,102 @@ components: - succeeded - total Security_AI_Assistant_API_ChatCompleteProps: + description: The request payload for creating a chat completion. + example: + connectorId: conn-001 + conversationId: abc123 + isStream: true + langSmithApiKey: sk-abc123 + langSmithProject: security_ai_project + messages: + - content: How do I detect ransomware on my endpoints? + data: + device_id: device-567 + fields_to_anonymize: + - device.name + - file.path + role: user + model: gpt-4 + persist: true + promptId: prompt_456 + responseLanguage: en type: object properties: connectorId: + description: Required connector identifier to route the request. + example: conn-001 type: string conversationId: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + description: Existing conversation ID to continue. isStream: + description: If true, the response will be streamed in chunks. + example: true type: boolean langSmithApiKey: + description: API key for LangSmith integration. + example: sk-abc123 type: string langSmithProject: + description: LangSmith project name for tracing. + example: security_ai_project type: string messages: + description: List of chat messages exchanged so far. items: $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' type: array model: + description: Model ID or name to use for the response. + example: gpt-4 type: string persist: + description: Whether to persist the chat and response to storage. + example: true type: boolean promptId: + description: Prompt template identifier. + example: prompt_001 type: string responseLanguage: + description: ISO language code for the assistant's response. + example: en type: string required: - messages - persist - connectorId Security_AI_Assistant_API_ChatMessage: - description: AI assistant message. + description: A message exchanged within the AI chat conversation. type: object properties: content: - description: Message content. + description: The textual content of the message. + example: What security incidents have been reported today? type: string data: $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' - description: ECS object to attach to the context of the message. + description: Metadata to attach to the context of the message. fields_to_anonymize: + description: List of field names within the data object that should be anonymized. + example: + - user.name + - source.ip items: type: string type: array role: $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' - description: Message role. + description: The sender role of the message. required: - role Security_AI_Assistant_API_ChatMessageRole: - description: Message role. + description: The role associated with the message in the chat. enum: - system - user - assistant + example: user type: string Security_AI_Assistant_API_ContentReferences: additionalProperties: @@ -34766,6 +35362,7 @@ components: enum: - assistant - insights + example: assistant type: string Security_AI_Assistant_API_ConversationConfidence: description: The conversation confidence. @@ -34773,6 +35370,7 @@ components: - low - medium - high + example: high type: string Security_AI_Assistant_API_ConversationCreateProps: type: object @@ -34783,11 +35381,13 @@ components: category: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' description: The conversation category. + example: assistant excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: description: The conversation id. + example: conversation123 type: string messages: description: The conversation messages. @@ -34798,6 +35398,7 @@ components: $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' title: description: The conversation title. + example: Security AI Assistant Setup type: string required: - title @@ -34810,11 +35411,13 @@ components: category: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' description: The conversation category. + example: assistant createdAt: description: The time conversation was created. + example: '2025-04-30T14:00:00Z' type: string excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' @@ -34825,18 +35428,21 @@ components: type: array namespace: description: Kibana space + example: default type: string replacements: $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' summary: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp' title: description: The conversation title. + example: Security AI Assistant Setup type: string updatedAt: description: The last time conversation was updated. + example: '2025-04-30T16:30:00Z' type: string users: items: @@ -34855,15 +35461,19 @@ components: confidence: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationConfidence' description: How confident you are about this being a correct and useful learning. + example: high content: description: Summary text of the conversation over time. + example: This conversation covered how to configure the Security AI Assistant. type: string public: description: Define if summary is marked as publicly available. + example: true type: boolean timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp' description: The timestamp summary was updated. + example: '2025-04-30T16:00:00Z' Security_AI_Assistant_API_ConversationUpdateProps: type: object properties: @@ -34873,8 +35483,9 @@ components: category: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' description: The conversation category. + example: assistant excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' @@ -34889,6 +35500,7 @@ components: $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' title: description: The conversation title. + example: Updated Security AI Assistant Setup type: string required: - id @@ -34904,13 +35516,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -34929,13 +35544,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -34950,7 +35568,8 @@ components: type: object properties: required: - description: Whether this resource should always be included, defaults to false + description: Whether this resource should always be included, defaults to false. + example: false type: boolean vector: $ref: '#/components/schemas/Security_AI_Assistant_API_Vector' @@ -34960,15 +35579,18 @@ components: kbResource: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseResource' source: - description: Source document name or filepath + description: Source document name or filepath. + example: /documents/example.txt type: string text: - description: Knowledge Base Entry content + description: Knowledge Base Entry content. + example: This is the content of the document. type: string type: - description: Entry type + description: Entry type. enum: - document + example: document type: string required: - type @@ -34984,15 +35606,18 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -35009,17 +35634,21 @@ components: properties: label: description: Label of the query + example: High Severity Alerts type: string query: description: An ESQL query + example: SELECT * FROM alerts WHERE severity = "high" type: string timerange: description: Time range to select in the time picker. type: object properties: from: + example: '2025-04-01T00:00:00Z' type: string to: + example: '2025-04-30T23:59:59Z' type: string required: - from @@ -35027,6 +35656,7 @@ components: type: enum: - EsqlQuery + example: EsqlQuery type: string required: - type @@ -35042,37 +35672,46 @@ components: - updated_at type: string Security_AI_Assistant_API_FindConversationsSortField: + description: The field by which to sort the conversations. Possible values are `created_at`, `title`, and `updated_at`. enum: - created_at - title - updated_at + example: created_at type: string Security_AI_Assistant_API_FindKnowledgeBaseEntriesSortField: + description: Fields available for sorting Knowledge Base Entries. enum: - created_at - is_default - title - updated_at + example: title type: string Security_AI_Assistant_API_FindPromptsSortField: + description: Field by which to sort the prompts. enum: - created_at - is_default - name - updated_at + example: created_at type: string Security_AI_Assistant_API_IndexEntry: allOf: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -35091,13 +35730,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -35114,7 +35756,10 @@ components: inputSchema: $ref: '#/components/schemas/Security_AI_Assistant_API_InputSchema' outputFields: - description: Fields to extract from the query result, defaults to all fields if not provided or empty + description: Fields to extract from the query result, defaults to all fields if not provided or empty. + example: + - title + - author items: type: string type: array @@ -35122,21 +35767,26 @@ components: type: object properties: description: - description: Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description + description: Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description. + example: Query this index for general knowledge base content. type: string field: - description: Field to query for Knowledge Base content + description: Field to query for Knowledge Base content. + example: content type: string index: - description: Index or Data Stream to query for Knowledge Base content + description: Index or Data Stream to query for Knowledge Base content. + example: knowledge_base_index type: string queryDescription: - description: Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema + description: Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema. + example: Search for documents containing the specified keywords. type: string type: - description: Entry type + description: Entry type. enum: - index + example: index type: string required: - type @@ -35153,15 +35803,18 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -35172,18 +35825,21 @@ components: - id - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryCreateFields' Security_AI_Assistant_API_InputSchema: - description: Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval + description: Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval. items: type: object properties: description: - description: Description of the field + description: Description of the field. + example: The title of the document. type: string fieldName: - description: Name of the field + description: Name of the field. + example: title type: string fieldType: - description: Type of the field + description: Type of the field. + example: string type: string required: - fieldName @@ -35191,6 +35847,7 @@ components: - description type: array Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipReason: + description: Reason why a Knowledge Base Entry was skipped during the bulk action. enum: - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED type: string @@ -35198,8 +35855,12 @@ components: type: object properties: id: + description: ID of the skipped Knowledge Base Entry. + example: '123' type: string name: + description: Name of the skipped Knowledge Base Entry. + example: Skipped Entry type: string skip_reason: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipReason' @@ -35213,6 +35874,14 @@ components: type: object properties: errors: + description: List of errors encountered during the bulk action. + example: + - err_code: UPDATE_FAILED + knowledgeBaseEntries: + - id: '456' + name: Error Entry + message: Failed to update entry. + statusCode: 400 items: $ref: '#/components/schemas/Security_AI_Assistant_API_NormalizedKnowledgeBaseEntryError' type: array @@ -35224,12 +35893,20 @@ components: - results - summary knowledgeBaseEntriesCount: + description: Total number of Knowledge Base Entries processed. + example: 8 type: integer message: + description: Message describing the result of the bulk action. + example: Bulk action completed successfully. type: string statusCode: + description: HTTP status code of the response. + example: 200 type: integer success: + description: Indicates whether the bulk action was successful. + example: true type: boolean required: - attributes @@ -35237,18 +35914,36 @@ components: type: object properties: created: + description: List of Knowledge Base Entries that were successfully created. + example: + - content: This is the content of the new entry. + id: '456' + title: New Entry items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' type: array deleted: + description: List of IDs of Knowledge Base Entries that were successfully deleted. + example: + - '789' items: type: string type: array skipped: + description: List of Knowledge Base Entries that were skipped during the bulk action. + example: + - id: '123' + name: Skipped Entry + skip_reason: KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipResult' type: array updated: + description: List of Knowledge Base Entries that were successfully updated. + example: + - content: Updated content. + id: '123' + title: Updated Entry items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' type: array @@ -35261,12 +35956,20 @@ components: type: object properties: failed: + description: Number of Knowledge Base Entries that failed during the bulk action. + example: 2 type: integer skipped: + description: Number of Knowledge Base Entries that were skipped during the bulk action. + example: 1 type: integer succeeded: + description: Number of Knowledge Base Entries that were successfully processed during the bulk action. + example: 5 type: integer total: + description: Total number of Knowledge Base Entries involved in the bulk action. + example: 8 type: integer required: - failed @@ -35280,13 +35983,16 @@ components: properties: knowledgeBaseEntryId: description: Id of the Knowledge Base Entry + example: kbentry456 type: string knowledgeBaseEntryName: description: Name of the knowledge base entry + example: Network Security Best Practices type: string type: enum: - KnowledgeBaseEntry + example: KnowledgeBaseEntry type: string required: - type @@ -35303,8 +36009,12 @@ components: type: object properties: id: + description: ID of the Knowledge Base Entry that encountered an error. + example: '456' type: string name: + description: Name of the Knowledge Base Entry that encountered an error. + example: Error Entry type: string required: - id @@ -35313,10 +36023,16 @@ components: type: object properties: error: + description: Error type or category. + example: Not Found type: string message: + description: Detailed error message. + example: The requested Knowledge Base Entry was not found. type: string statusCode: + description: HTTP status code of the error. + example: 404 type: number required: - statusCode @@ -35341,10 +36057,11 @@ components: discriminator: propertyName: type Security_AI_Assistant_API_KnowledgeBaseResource: - description: Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc + description: Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc. enum: - security_labs - user + example: security_labs type: string Security_AI_Assistant_API_KnowledgeBaseResponse: description: AI assistant KnowledgeBase. @@ -35352,6 +36069,7 @@ components: properties: success: description: Identify the success of the method execution. + example: true type: boolean Security_AI_Assistant_API_Message: description: AI assistant conversation message. @@ -35359,31 +36077,39 @@ components: properties: content: description: Message content. + example: Hello, how can I assist you today? type: string isError: description: Is error message. + example: false type: boolean metadata: $ref: '#/components/schemas/Security_AI_Assistant_API_MessageMetadata' - description: metadata + description: Metadata reader: $ref: '#/components/schemas/Security_AI_Assistant_API_Reader' description: Message content. role: $ref: '#/components/schemas/Security_AI_Assistant_API_MessageRole' description: Message role. + example: assistant timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp' description: The timestamp message was sent or received. + example: '2025-04-30T15:30:00Z' traceData: $ref: '#/components/schemas/Security_AI_Assistant_API_TraceData' - description: trace Data + description: Trace data required: - timestamp - content - role Security_AI_Assistant_API_MessageData: additionalProperties: true + description: ECS-style metadata attached to the message. + example: + alert_id: alert-456 + user_id: abc123 type: object Security_AI_Assistant_API_MessageMetadata: description: Message metadata @@ -35391,16 +36117,24 @@ components: properties: contentReferences: $ref: '#/components/schemas/Security_AI_Assistant_API_ContentReferences' - description: Data refered to by the message content. + description: Data referred to by the message content. Security_AI_Assistant_API_MessageRole: description: Message role. enum: - system - user - assistant + example: assistant type: string Security_AI_Assistant_API_NonEmptyString: - description: A string that does not contain only whitespace characters + description: A string that does not contain only whitespace characters. + example: I am a string + format: nonempty + minLength: 1 + type: string + Security_AI_Assistant_API_NonEmptyTimestamp: + description: A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters. + example: '2023-10-31T12:00:00Z' format: nonempty minLength: 1 type: string @@ -35408,14 +36142,21 @@ components: type: object properties: anonymization_fields: + description: Array of anonymization fields that caused the error. items: $ref: '#/components/schemas/Security_AI_Assistant_API_AnonymizationFieldDetailsInError' type: array err_code: + description: Error code indicating the type of failure. + example: UPDATE_FAILED type: string message: + description: Error message. + example: Failed to update anonymization field. type: string status_code: + description: Status code of the response. + example: 400 type: integer required: - message @@ -35425,14 +36166,21 @@ components: type: object properties: err_code: + description: Specific error code for the issue. + example: UPDATE_FAILED type: string knowledgeBaseEntries: + description: List of Knowledge Base Entries that encountered the error. items: $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryDetailsInError' type: array message: + description: Error message describing the issue. + example: Failed to update entry. type: string statusCode: + description: HTTP status code associated with the error. + example: 400 type: integer required: - message @@ -35442,14 +36190,18 @@ components: type: object properties: err_code: + description: A code representing the error type. type: string message: + description: A message describing the error encountered. type: string prompts: + description: List of prompts that encountered errors. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptDetailsInError' type: array status_code: + description: The HTTP status code associated with the error. type: integer required: - message @@ -35462,13 +36214,16 @@ components: properties: title: description: Title of the documentation + example: Getting Started with Security AI Assistant type: string type: enum: - ProductDocumentation + example: ProductDocumentation type: string url: description: URL to the documentation + example: https://docs.example.com/security-ai-assistant type: string required: - type @@ -35479,23 +36234,41 @@ components: type: object properties: categories: + description: List of categories for the prompt. + example: + - security + - verification items: type: string type: array color: + description: The color associated with the prompt. + example: blue type: string consumer: + description: The consumer associated with the prompt. + example: admin type: string content: + description: The content of the prompt. + example: Please verify the security settings. type: string isDefault: + description: Whether this prompt should be the default. + example: false type: boolean isNewConversationDefault: + description: Whether this prompt should be the default for new conversations. + example: true type: boolean name: + description: The name of the prompt. + example: New Security Prompt type: string promptType: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptType' + description: The type of the prompt. + example: system required: - name - content @@ -35504,8 +36277,10 @@ components: type: object properties: id: + description: The ID of the prompt that encountered an error. type: string name: + description: The name of the prompt that encountered an error. type: string required: - id @@ -35513,39 +36288,52 @@ components: type: object properties: categories: + description: Categories associated with the prompt. items: type: string type: array color: + description: The color associated with the prompt. type: string consumer: + description: The consumer that the prompt is associated with. type: string content: + description: The content of the prompt. type: string createdAt: + description: The timestamp of when the prompt was created. type: string createdBy: + description: The user who created the prompt. type: string id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' isDefault: + description: Whether this prompt is the default. type: boolean isNewConversationDefault: + description: Whether this prompt is the default for new conversations. type: boolean name: + description: The name of the prompt. type: string namespace: - description: Kibana space + description: Kibana space where the prompt is located. type: string promptType: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptType' + description: The type of the prompt. timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyTimestamp' updatedAt: + description: The timestamp of when the prompt was last updated. type: string updatedBy: + description: The user who last updated the prompt. type: string users: + description: List of users associated with the prompt. items: $ref: '#/components/schemas/Security_AI_Assistant_API_User' type: array @@ -35555,6 +36343,7 @@ components: - promptType - content Security_AI_Assistant_API_PromptsBulkActionSkipReason: + description: Reason why a prompt was skipped during the bulk action. enum: - PROMPT_FIELD_NOT_MODIFIED type: string @@ -35562,11 +36351,14 @@ components: type: object properties: id: + description: The ID of the prompt that was skipped. type: string name: + description: The name of the prompt that was skipped. type: string skip_reason: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkActionSkipReason' + description: The reason for skipping the prompt. required: - id - skip_reason @@ -35588,12 +36380,20 @@ components: - results - summary message: + description: A message describing the result of the bulk action. + example: Bulk action completed successfully. type: string prompts_count: + description: The number of prompts processed in the bulk action. + example: 6 type: integer status_code: + description: The HTTP status code of the response. + example: 200 type: integer success: + description: Indicates if the bulk action was successful. + example: true type: boolean required: - attributes @@ -35601,18 +36401,22 @@ components: type: object properties: created: + description: List of prompts that were created. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' type: array deleted: + description: List of IDs of prompts that were deleted. items: type: string type: array skipped: + description: List of prompts that were skipped. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkActionSkipResult' type: array updated: + description: List of prompts that were updated. items: $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' type: array @@ -35622,7 +36426,7 @@ components: - deleted - skipped Security_AI_Assistant_API_PromptType: - description: Prompt type + description: Type of the prompt (either system or quick). enum: - system - quick @@ -35631,20 +36435,36 @@ components: type: object properties: categories: + description: The updated categories for the prompt. + example: + - security + - alert items: type: string type: array color: + description: The updated color associated with the prompt. + example: green type: string consumer: + description: The updated consumer for the prompt. + example: user123 type: string content: + description: The updated content for the prompt. + example: Updated content for security prompt. type: string id: + description: The ID of the prompt to update. + example: prompt123 type: string isDefault: + description: Whether this prompt should be the default. + example: true type: boolean isNewConversationDefault: + description: Whether the prompt should be the default for new conversations. + example: false type: boolean required: - id @@ -35654,6 +36474,7 @@ components: - OpenAI - Azure OpenAI - Other + example: OpenAI type: string Security_AI_Assistant_API_Reader: additionalProperties: true @@ -35661,24 +36482,28 @@ components: Security_AI_Assistant_API_Replacements: additionalProperties: type: string - description: Replacements object used to anonymize/deanomymize messsages + description: Replacements object used to anonymize/deanonymize messages type: object Security_AI_Assistant_API_ResponseFields: type: object properties: createdAt: - description: Time the Knowledge Base Entry was created + description: Time the Knowledge Base Entry was created. + example: '2023-01-01T12:00:00Z' type: string createdBy: - description: User who created the Knowledge Base Entry + description: User who created the Knowledge Base Entry. + example: admin type: string id: $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' updatedAt: - description: Time the Knowledge Base Entry was last updated + description: Time the Knowledge Base Entry was last updated. + example: '2023-01-02T12:00:00Z' type: string updatedBy: - description: User who last updated the Knowledge Base Entry + description: User who last updated the Knowledge Base Entry. + example: editor type: string required: - id @@ -35693,10 +36518,12 @@ components: properties: alertId: description: ID of the Alert + example: alert789 type: string type: enum: - SecurityAlert + example: SecurityAlert type: string required: - type @@ -35710,46 +36537,57 @@ components: type: enum: - SecurityAlertsPage + example: SecurityAlertsPage type: string required: - type description: References the security alerts page Security_AI_Assistant_API_SortOrder: + description: The order in which results are sorted. enum: - asc - desc + example: asc type: string Security_AI_Assistant_API_TraceData: - description: trace Data + description: Trace Data type: object properties: traceId: description: Could be any string, not necessarily a UUID + example: d9876543-f0a1-2345-6789-abcdef123456 type: string transactionId: description: Could be any string, not necessarily a UUID + example: a1234567-bc89-0def-1234-56789abcdef0 type: string Security_AI_Assistant_API_User: - description: Could be any string, not necessarily a UUID + description: Could be any string, not necessarily a UUID. type: object properties: id: - description: User id + description: User id. + example: user123 type: string name: - description: User name + description: User name. + example: John Doe type: string Security_AI_Assistant_API_Vector: - description: Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings + description: Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings. type: object properties: modelId: - description: ID of the model used to create the embeddings + description: ID of the model used to create the embeddings. + example: bert-base-uncased type: string tokens: additionalProperties: type: number - description: Tokens with their corresponding values + description: Tokens with their corresponding values. + example: + token1: 0.123 + token2: 0.456 type: object required: - modelId diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 1acc3360684fc..666d6e47e5a5a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -22,25 +22,54 @@ paths: content: application/json: schema: + example: + create: + - allowed: true + anonymized: false + field: host.name + - allowed: false + anonymized: true + field: user.name + delete: + ids: + - field5 + - field6 + query: 'field: host.name' + update: + - allowed: true + anonymized: false + id: field8 + - allowed: false + anonymized: true + id: field9 type: object properties: create: + description: Array of anonymization fields to create. items: $ref: '#/components/schemas/AnonymizationFieldCreateProps' type: array delete: + description: >- + Object containing the query to filter anonymization fields + and/or an array of anonymization field IDs to delete. type: object properties: ids: - description: Array of anonymization fields IDs + description: Array of IDs to apply the action to. + example: + - '1234' + - '5678' items: type: string minItems: 1 type: array query: - description: Query to filter anonymization fields + description: Query to filter the bulk action. + example: 'status: ''inactive''' type: string update: + description: Array of anonymization fields to update. items: $ref: '#/components/schemas/AnonymizationFieldUpdateProps' type: array @@ -48,20 +77,67 @@ paths: '200': content: application/json: + example: + anonymization_fields_count: 5 + attributes: + results: + created: + - allowed: false + anonymized: true + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: host.name + id: field2 + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + deleted: + - field3 + skipped: + - id: field4 + name: user.name + skip_reason: ANONYMIZATION_FIELD_NOT_MODIFIED + updated: + - allowed: true + anonymized: false + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: url.domain + id: field8 + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + summary: + failed: 1 + skipped: 1 + succeeded: 2 + total: 5 + message: Bulk action completed successfully + status_code: 200 + success: true schema: $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' description: Indicates a successful call. '400': content: application/json: + example: + error: Bad Request + message: Invalid request body + statusCode: 400 schema: type: object properties: error: + description: Error type or name. type: string message: + description: Detailed error message. type: string statusCode: + description: Status code of the response. type: number description: Generic Error summary: Apply a bulk action to anonymization fields @@ -73,7 +149,13 @@ paths: description: Get a list of all anonymization fields. operationId: FindAnonymizationFields parameters: - - in: query + - description: Fields to return + example: + - id + - field + - anonymized + - allowed + in: query name: fields required: false schema: @@ -81,24 +163,28 @@ paths: type: string type: array - description: Search query + example: 'field: "user.name"' in: query name: filter required: false schema: type: string - description: Field to sort by + example: created_at in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindAnonymizationFieldsSortField' - description: Sort order + example: asc in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - description: Page number + example: 1 in: query name: page required: false @@ -107,6 +193,7 @@ paths: minimum: 1 type: integer - description: AnonymizationFields per page + example: 20 in: query name: per_page required: false @@ -118,6 +205,21 @@ paths: '200': content: application/json: + example: + data: + - allowed: true + anonymized: true + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: user.name + id: '1' + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + page: 1 + perPage: 20 + total: 100 schema: type: object properties: @@ -140,6 +242,10 @@ paths: '400': content: application/json: + example: + error: Bad Request + message: Invalid request parameters + statusCode: 400 schema: type: object properties: @@ -160,6 +266,7 @@ paths: operationId: ChatComplete parameters: - description: If true, the response will not include content references. + example: false in: query name: content_references_disabled required: false @@ -169,6 +276,24 @@ paths: requestBody: content: application/json: + example: + connectorId: conn-001 + conversationId: abc123 + isStream: true + langSmithApiKey: sk-abc123 + langSmithProject: security_ai_project + messages: + - content: What are some common phishing techniques? + data: + user_id: user_789 + fields_to_anonymize: + - user.name + - source.ip + role: user + model: gpt-4 + persist: true + promptId: prompt_456 + responseLanguage: en schema: $ref: '#/components/schemas/ChatCompleteProps' required: true @@ -179,7 +304,7 @@ paths: schema: format: binary type: string - description: Indicates a successful call. + description: Indicates a successful model response call. '400': content: application/json: @@ -187,10 +312,16 @@ paths: type: object properties: error: + description: Error type. + example: Bad Request type: string message: + description: Human-readable error message. + example: Invalid request payload. type: string statusCode: + description: HTTP status code. + example: 400 type: number description: Generic Error summary: Create a model response @@ -199,11 +330,26 @@ paths: - Chat Complete API /api/security_ai_assistant/current_user/conversations: post: - description: Create a new Security AI Assistant conversation. + description: >- + Create a new Security AI Assistant conversation. This endpoint allows + the user to initiate a conversation with the Security AI Assistant by + providing the required parameters. operationId: CreateConversation requestBody: content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + excludeFromLastConversationStorage: false + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion schema: $ref: '#/components/schemas/ConversationCreateProps' required: true @@ -211,9 +357,29 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: >- + Indicates a successful call. The conversation was created + successfully. '400': content: application/json: @@ -221,60 +387,86 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: 'Missing required parameter: title' type: string statusCode: + example: 400 type: number - description: Generic Error + description: >- + Generic Error. This response indicates an issue with the request, + such as missing required parameters or incorrect data. summary: Create a conversation tags: - Security AI Assistant API - Conversation API /api/security_ai_assistant/current_user/conversations/_find: get: - description: Get a list of all conversations for the current user. + description: >- + Get a list of all conversations for the current user. This endpoint + allows users to search, filter, sort, and paginate through their + conversations. operationId: FindConversations parameters: - - in: query + - description: >- + A list of fields to include in the response. If omitted, all fields + are returned. + in: query name: fields required: false schema: + example: + - id + - title + - createdAt items: type: string type: array - - description: Search query + - description: >- + A search query to filter the conversations. Can match against + titles, messages, or other conversation attributes. in: query name: filter required: false schema: + example: Security Issue type: string - - description: Field to sort by + - description: >- + The field by which to sort the results. Valid fields are + `created_at`, `title`, and `updated_at`. in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindConversationsSortField' - - description: Sort order + example: created_at + - description: >- + The order in which to sort the results. Can be either `asc` for + ascending or `desc` for descending. in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - - description: Page number + example: desc + - description: The page number of the results to retrieve. Default is 1. in: query name: page required: false schema: default: 1 + example: 1 minimum: 1 type: integer - - description: Conversations per page + - description: The number of conversations to return per page. Default is 20. in: query name: per_page required: false schema: default: 20 + example: 20 minimum: 0 type: integer responses: @@ -285,21 +477,32 @@ paths: type: object properties: data: + description: A list of conversations. items: $ref: '#/components/schemas/ConversationResponse' type: array page: + description: The current page of the results. + example: 1 type: integer perPage: + description: The number of results returned per page. + example: 20 type: integer total: + description: >- + The total number of conversations matching the filter + criteria. + example: 100 type: integer required: - page - perPage - total - data - description: Successful response + description: >- + Successful response, returns a paginated list of conversations + matching the specified criteria. '400': content: application/json: @@ -307,22 +510,30 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid filter query parameter type: string statusCode: + example: 400 type: number - description: Generic Error + description: >- + Generic Error. The request could not be processed due to an invalid + query parameter or other issue. summary: Get conversations tags: - Security AI Assistant API - Conversations API /api/security_ai_assistant/current_user/conversations/{id}: delete: - description: Delete an existing conversation using the conversation ID. + description: >- + Delete an existing conversation using the conversation ID. This endpoint + allows users to permanently delete a conversation. operationId: DeleteConversation parameters: - description: The conversation's `id` value. + example: abc123 in: path name: id required: true @@ -332,9 +543,29 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: The conversation has been deleted. + role: system + timestamp: '2023-10-31T12:35:00Z' + replacements: {} + title: Deleted Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: >- + Indicates a successful call. The conversation was deleted + successfully. '400': content: application/json: @@ -342,21 +573,30 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid conversation ID type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. This response indicates an issue with the request. summary: Delete a conversation tags: - Security AI Assistant API - Conversation API get: - description: Get the details of an existing conversation using the conversation ID. + description: >- + Get the details of an existing conversation using the conversation ID. + This allows users to fetch the specific conversation data by its unique + ID. operationId: ReadConversation parameters: - - description: The conversation's `id` value. + - description: >- + The conversation's `id` value, a unique identifier for the + conversation. + example: abc123 in: path name: id required: true @@ -366,9 +606,27 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: Indicates a successful call. The conversation details are returned. '400': content: application/json: @@ -376,21 +634,27 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid conversation ID type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. The request could not be processed due to an error. summary: Get a conversation tags: - Security AI Assistant API - Conversations API put: - description: Update an existing conversation using the conversation ID. + description: >- + Update an existing conversation using the conversation ID. This endpoint + allows users to modify the details of an existing conversation. operationId: UpdateConversation parameters: - description: The conversation's `id` value. + example: abc123 in: path name: id required: true @@ -399,6 +663,18 @@ paths: requestBody: content: application/json: + example: + apiConfig: + actionTypeId: '09876' + connectorId: '54321' + category: insights + excludeFromLastConversationStorage: true + messages: + - content: The issue was resolved. + role: assistant + timestamp: '2023-10-31T12:30:00Z' + replacements: {} + title: Updated Security Discussion schema: $ref: '#/components/schemas/ConversationUpdateProps' required: true @@ -406,9 +682,29 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '09876' + connectorId: '54321' + category: insights + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: true + id: abc123 + messages: + - content: The issue was resolved. + role: assistant + timestamp: '2023-10-31T12:30:00Z' + replacements: {} + title: Updated Security Discussion + updatedAt: '2023-10-31T12:31:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: >- + Indicates a successful call. The conversation was updated + successfully. '400': content: application/json: @@ -416,12 +712,17 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: 'Missing required field: title' type: string statusCode: + example: 400 type: number - description: Generic Error + description: >- + Generic Error. This response indicates an issue with the request, + such as missing required parameters or incorrect data. summary: Update a conversation tags: - Security AI Assistant API @@ -432,6 +733,7 @@ paths: operationId: ReadKnowledgeBase parameters: - description: The KnowledgeBase `resource` value. + example: kb12345 in: path name: resource schema: @@ -444,16 +746,34 @@ paths: type: object properties: elser_exists: + description: Indicates if the ELSER model exists for the KnowledgeBase. + example: true type: boolean is_setup_available: + description: >- + Indicates if the setup process is available for the + KnowledgeBase. + example: true type: boolean is_setup_in_progress: + description: Indicates if the setup process is currently in progress. + example: false type: boolean product_documentation_status: + description: >- + The status of the product documentation in the + KnowledgeBase. + example: complete type: string security_labs_exists: + description: >- + Indicates if Security Labs documentation exists in the + KnowledgeBase. + example: true type: boolean user_data_exists: + description: Indicates if user data exists in the KnowledgeBase. + example: false type: boolean description: Indicates a successful call. '400': @@ -463,10 +783,16 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid resource ID provided. type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number description: Generic Error summary: Read a KnowledgeBase @@ -478,11 +804,15 @@ paths: operationId: CreateKnowledgeBase parameters: - description: The KnowledgeBase `resource` value. + example: kb12345 in: path name: resource schema: type: string - - description: Optional ELSER modelId to use when setting up the Knowledge Base + - description: >- + ELSER modelId to use when setting up the Knowledge Base. If not + provided, a default model will be used. + example: elser-model-001 in: query name: modelId required: false @@ -490,7 +820,8 @@ paths: type: string - description: >- Indicates whether we should or should not install Security Labs docs - when setting up the Knowledge Base + when setting up the Knowledge Base. Defaults to `false`. + example: true in: query name: ignoreSecurityLabs required: false @@ -511,10 +842,16 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid resource ID provided. type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number description: Generic Error summary: Create a KnowledgeBase @@ -528,6 +865,15 @@ paths: requestBody: content: application/json: + example: + content: >- + To reset your password, go to the settings page and click 'Reset + Password'. + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' required: true @@ -535,15 +881,30 @@ paths: '200': content: application/json: + example: + content: >- + To reset your password, go to the settings page and click + 'Reset Password'. + id: '12345' + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' description: Successful request returning Knowledge Base Entries '400': content: application/json: + example: + error: Invalid input + message: The 'title' field is required. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as invalid input or missing required + fields. summary: Create a Knowledge Base Entry tags: - Security AI Assistant API @@ -552,7 +913,7 @@ paths: post: description: >- The bulk action is applied to all Knowledge Base Entries that match the - filter or to the list of Knowledge Base Entries by their IDs + filter or to the list of Knowledge Base Entries by their IDs. operationId: PerformKnowledgeBaseEntryBulkAction requestBody: content: @@ -561,6 +922,10 @@ paths: type: object properties: create: + description: List of Knowledge Base Entries to create. + example: + - content: This is the content of the new entry. + title: New Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' type: array @@ -568,15 +933,25 @@ paths: type: object properties: ids: - description: Array of Knowledge base Entry IDs + description: Array of Knowledge Base Entry IDs. + example: + - '123' + - '456' + - '789' items: type: string minItems: 1 type: array query: - description: Query to filter Knowledge Base Entries + description: Query to filter Knowledge Base Entries. + example: status:active AND category:technology type: string update: + description: List of Knowledge Base Entries to update. + example: + - content: Updated content. + id: '123' + title: Updated Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' type: array @@ -602,45 +977,56 @@ paths: description: Finds Knowledge Base Entries that match the given query. operationId: FindKnowledgeBaseEntries parameters: - - in: query + - description: >- + A list of fields to include in the response. If not provided, all + fields will be included. + in: query name: fields required: false schema: + example: + - title + - created_at items: type: string type: array - - description: Search query + - description: Search query to filter Knowledge Base Entries by specific criteria. in: query name: filter required: false schema: + example: error handling type: string - - description: Field to sort by + - description: Field to sort the Knowledge Base Entries by. in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindKnowledgeBaseEntriesSortField' - - description: Sort order + example: created_at + - description: Sort order for the results, either asc or desc. in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - - description: Page number + example: asc + - description: Page number for paginated results. Defaults to 1. in: query name: page required: false schema: default: 1 + example: 2 minimum: 1 type: integer - - description: Knowledge Base Entries per page + - description: Number of Knowledge Base Entries to return per page. Defaults to 20. in: query name: per_page required: false schema: default: 20 + example: 10 minimum: 0 type: integer responses: @@ -651,21 +1037,28 @@ paths: type: object properties: data: + description: The list of Knowledge Base Entries for the current page. items: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' type: array page: + description: The current page number. + example: 1 type: integer perPage: + description: The number of Knowledge Base Entries returned per page. + example: 20 type: integer total: + description: The total number of Knowledge Base Entries available. + example: 100 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response containing the paginated Knowledge Base Entries. '400': content: application/json: @@ -673,22 +1066,29 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed message explaining the error. + example: 'Invalid query parameter: sort_order' type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number - description: Generic Error + description: Generic Error indicating an issue with the request. summary: Finds Knowledge Base Entries that match the given query. tags: - Security AI Assistant API - Knowledge Base Entries API /api/security_ai_assistant/knowledge_base/entries/{id}: delete: - description: Deletes a single Knowledge Base Entry using the `id` field + description: Delete a Knowledge Base Entry by its unique `id`. operationId: DeleteKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value + - description: The unique identifier (`id`) of the Knowledge Base Entry to delete. + example: '12345' in: path name: id required: true @@ -698,24 +1098,37 @@ paths: '200': content: application/json: + example: + id: '12345' + message: Knowledge Base Entry successfully deleted. schema: $ref: '#/components/schemas/DeleteResponseFields' - description: Successful request returning the deleted Knowledge Base Entry's ID + description: >- + Successful request returning the `id` of the deleted Knowledge Base + Entry. '400': content: application/json: + example: + error: Not Found + message: No Knowledge Base Entry found with the provided `id`. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as an invalid `id` or the entry not + being found. summary: Deletes a single Knowledge Base Entry using the `id` field tags: - Security AI Assistant API - Knowledge Base Entries API get: - description: Read a Knowledge Base Entry + description: Retrieve a Knowledge Base Entry by its unique `id`. operationId: ReadKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value. + - description: >- + The unique identifier (`id`) of the Knowledge Base Entry to + retrieve. + example: '12345' in: path name: id required: true @@ -725,24 +1138,40 @@ paths: '200': content: application/json: + example: + content: >- + To reset your password, go to the settings page and click + 'Reset Password'. + id: '12345' + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning a Knowledge Base Entry + description: Successful request returning the requested Knowledge Base Entry. '400': content: application/json: + example: + error: Not Found + message: No Knowledge Base Entry found with the provided `id`. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as an invalid `id` or the entry not + being found. summary: Read a Knowledge Base Entry tags: - Security AI Assistant API - Knowledge Base Entries API put: - description: Update a Knowledge Base Entry + description: Update an existing Knowledge Base Entry by its unique `id`. operationId: UpdateKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value + - description: The unique identifier (`id`) of the Knowledge Base Entry to update. + example: '12345' in: path name: id required: true @@ -751,6 +1180,16 @@ paths: requestBody: content: application/json: + example: + content: >- + To reset your password, go to the settings page, click 'Reset + Password', and follow the instructions. + tags: + - password + - reset + - help + - update + title: How to reset a password (updated) schema: $ref: '#/components/schemas/KnowledgeBaseEntryUpdateRouteProps' required: true @@ -758,15 +1197,31 @@ paths: '200': content: application/json: + example: + content: >- + To reset your password, go to the settings page, click 'Reset + Password', and follow the instructions. + id: '12345' + tags: + - password + - reset + - help + - update + title: How to reset a password (updated) schema: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning the updated Knowledge Base Entry + description: Successful request returning the updated Knowledge Base Entry. '400': content: application/json: + example: + error: Invalid input + message: The 'content' field cannot be empty. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as invalid input or the entry not + being found. summary: Update a Knowledge Base Entry tags: - Security AI Assistant API @@ -776,31 +1231,50 @@ paths: description: >- Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their - IDs. + IDs. This action allows for bulk create, update, or delete operations. operationId: PerformPromptsBulkAction requestBody: content: application/json: + example: + create: + - content: Please verify the security settings. + name: New Security Prompt + promptType: system + delete: + ids: + - prompt1 + - prompt2 + update: + - content: Updated content for security prompt. + id: prompt123 schema: type: object properties: create: + description: List of prompts to be created. items: $ref: '#/components/schemas/PromptCreateProps' type: array delete: + description: Criteria for deleting prompts in bulk. type: object properties: ids: - description: Array of prompts IDs + description: Array of IDs to apply the action to. + example: + - '1234' + - '5678' items: type: string minItems: 1 type: array query: - description: Query to filter promps + description: Query to filter the bulk action. + example: 'status: ''inactive''' type: string update: + description: List of prompts to be updated. items: $ref: '#/components/schemas/PromptUpdateProps' type: array @@ -808,9 +1282,41 @@ paths: '200': content: application/json: + examples: + success: + value: + attributes: + errors: [] + results: + created: + - content: Please verify the security settings. + id: prompt6 + name: New Security Prompt + promptType: system + deleted: + - prompt2 + - prompt3 + skipped: + - id: prompt4 + name: Security Prompt + skip_reason: PROMPT_FIELD_NOT_MODIFIED + updated: + - content: Updated security settings prompt + id: prompt1 + name: Security Prompt + promptType: system + summary: + failed: 0 + skipped: 1 + succeeded: 4 + total: 5 + message: Bulk action completed successfully. + prompts_count: 5 + status_code: 200 + success: true schema: $ref: '#/components/schemas/PromptsBulkCrudActionResponse' - description: Indicates a successful call. + description: Indicates a successful call with the results of the bulk action. '400': content: application/json: @@ -818,60 +1324,76 @@ paths: type: object properties: error: + description: A short error message. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid prompt ID or missing required fields. type: string statusCode: + description: The HTTP status code for the error. + example: 400 type: number - description: Generic Error + description: Indicates a generic error due to a bad request. summary: Apply a bulk action to prompts tags: - Security AI Assistant API - Bulk API /api/security_ai_assistant/prompts/_find: get: - description: Get a list of all prompts. + description: >- + Get a list of all prompts based on optional filters, sorting, and + pagination. operationId: FindPrompts parameters: - - in: query + - description: List of specific fields to include in each returned prompt. + in: query name: fields required: false schema: + example: + - id + - name + - content items: type: string type: array - - description: Search query + - description: Search query string to filter prompts by matching fields. in: query name: filter required: false schema: + example: error handling type: string - - description: Field to sort by + - description: Field to sort prompts by. in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindPromptsSortField' - - description: Sort order + - description: Sort order, either asc or desc. in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - - description: Page number + - description: Page number for pagination. in: query name: page required: false schema: default: 1 + example: 1 minimum: 1 type: integer - - description: Prompts per page + - description: Number of prompts per page. in: query name: per_page required: false schema: default: 20 + example: 20 minimum: 0 type: integer responses: @@ -879,24 +1401,58 @@ paths: content: application/json: schema: + example: + data: + - categories: + - troubleshooting + - logging + color: '#FF5733' + consumer: security + content: If you encounter an error, check the logs and retry. + createdAt: '2025-04-20T21:00:00Z' + createdBy: jdoe + id: prompt-123 + isDefault: true + isNewConversationDefault: false + name: Error Troubleshooting Prompt + namespace: default + promptType: standard + timestamp: '2025-04-30T22:30:00Z' + updatedAt: '2025-04-30T22:45:00Z' + updatedBy: jdoe + users: + - full_name: John Doe + username: jdoe + page: 1 + perPage: 20 + total: 142 type: object properties: data: + description: >- + The list of prompts returned based on the search query, + sorting, and pagination. items: $ref: '#/components/schemas/PromptResponse' type: array page: + description: Current page number. + example: 1 type: integer perPage: + description: Number of prompts per page. + example: 20 type: integer total: + description: Total number of prompts matching the query. + example: 142 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response containing a list of prompts. '400': content: application/json: @@ -904,12 +1460,18 @@ paths: type: object properties: error: + description: Short error message. + example: Bad Request type: string message: + description: Detailed description of the error. + example: Invalid sort order value provided. type: string statusCode: + description: HTTP status code for the error. + example: 400 type: number - description: Generic Error + description: Bad request due to invalid parameters or malformed query. summary: Get prompts tags: - Security AI Assistant API @@ -920,10 +1482,16 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean field: + description: Name of the anonymization field to create. + example: host.name type: string required: - field @@ -931,8 +1499,12 @@ components: type: object properties: id: + description: The ID of the anonymization field. + example: field12 type: string name: + description: Name of the anonymization field. + example: host.name type: string required: - id @@ -940,30 +1512,48 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean createdAt: + description: Timestamp of when the anonymization field was created. + example: '2023-10-31T12:00:00Z' type: string createdBy: + description: Username of the person who created the anonymization field. + example: user1 type: string field: + description: Name of the anonymization field. + example: url.domain type: string id: $ref: '#/components/schemas/NonEmptyString' + description: The ID of the anonymization field. namespace: - description: Kibana space + description: Kibana space in which this anonymization field exists. + example: default type: string timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' + description: Timestamp when the anonymization field was initially created. updatedAt: + description: Timestamp of the last update. + example: '2023-10-31T12:00:00Z' type: string updatedBy: + description: Username of the person who last updated the field. + example: user1 type: string required: - id - field AnonymizationFieldsBulkActionSkipReason: + description: Reason why the anonymization field was not modified. enum: - ANONYMIZATION_FIELD_NOT_MODIFIED type: string @@ -971,11 +1561,16 @@ components: type: object properties: id: + description: The ID of the anonymization field that was not modified. + example: field4 type: string name: + description: Name of the anonymization field that was not modified. + example: user.name type: string skip_reason: $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' + description: Reason why the anonymization field was not modified. required: - id - skip_reason @@ -983,11 +1578,14 @@ components: type: object properties: anonymization_fields_count: + description: Total number of anonymization fields processed. + example: 5 type: integer attributes: type: object properties: errors: + description: List of errors that occurred during the bulk operation. items: $ref: '#/components/schemas/NormalizedAnonymizationFieldError' type: array @@ -999,10 +1597,16 @@ components: - results - summary message: + description: Message providing information about the bulk action result. + example: Bulk action completed successfully type: string status_code: + description: HTTP status code returned. + example: 200 type: integer success: + description: Indicates if the bulk action was successful. + example: true type: boolean required: - attributes @@ -1010,18 +1614,23 @@ components: type: object properties: created: + description: List of anonymization fields successfully created. items: $ref: '#/components/schemas/AnonymizationFieldResponse' type: array deleted: items: + description: Array of IDs of anonymization fields that were deleted. + example: field3 type: string type: array skipped: + description: List of anonymization fields that were skipped during the operation. items: $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' type: array updated: + description: List of anonymization fields successfully updated. items: $ref: '#/components/schemas/AnonymizationFieldResponse' type: array @@ -1034,10 +1643,16 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean id: + description: The ID of the anonymization field to update. + example: field8 type: string required: - id @@ -1045,20 +1660,25 @@ components: type: object properties: actionTypeId: - description: action type id + description: Action type ID + example: actionType456 type: string connectorId: - description: connector id + description: Connector ID + example: connector123 type: string defaultSystemPromptId: - description: defaultSystemPromptId + description: Default system prompt ID + example: systemPrompt001 type: string model: - description: model + description: Model + example: gpt-4 type: string provider: $ref: '#/components/schemas/Provider' description: Provider + example: OpenAI required: - connectorId - actionTypeId @@ -1068,9 +1688,11 @@ components: properties: id: description: Id of the content reference + example: content123 type: string type: description: Type of the content reference + example: SecurityAlert type: string required: - id @@ -1079,12 +1701,20 @@ components: type: object properties: failed: + description: The number of failed actions. + example: 0 type: integer skipped: + description: The number of skipped actions. + example: 1 type: integer succeeded: + description: The number of successfully performed actions. + example: 10 type: integer total: + description: The total number of actions attempted. + example: 12 type: integer required: - failed @@ -1092,59 +1722,104 @@ components: - succeeded - total ChatCompleteProps: + description: The request payload for creating a chat completion. + example: + connectorId: conn-001 + conversationId: abc123 + isStream: true + langSmithApiKey: sk-abc123 + langSmithProject: security_ai_project + messages: + - content: How do I detect ransomware on my endpoints? + data: + device_id: device-567 + fields_to_anonymize: + - device.name + - file.path + role: user + model: gpt-4 + persist: true + promptId: prompt_456 + responseLanguage: en type: object properties: connectorId: + description: Required connector identifier to route the request. + example: conn-001 type: string conversationId: $ref: '#/components/schemas/NonEmptyString' + description: Existing conversation ID to continue. isStream: + description: If true, the response will be streamed in chunks. + example: true type: boolean langSmithApiKey: + description: API key for LangSmith integration. + example: sk-abc123 type: string langSmithProject: + description: LangSmith project name for tracing. + example: security_ai_project type: string messages: + description: List of chat messages exchanged so far. items: $ref: '#/components/schemas/ChatMessage' type: array model: + description: Model ID or name to use for the response. + example: gpt-4 type: string persist: + description: Whether to persist the chat and response to storage. + example: true type: boolean promptId: + description: Prompt template identifier. + example: prompt_001 type: string responseLanguage: + description: ISO language code for the assistant's response. + example: en type: string required: - messages - persist - connectorId ChatMessage: - description: AI assistant message. + description: A message exchanged within the AI chat conversation. type: object properties: content: - description: Message content. + description: The textual content of the message. + example: What security incidents have been reported today? type: string data: $ref: '#/components/schemas/MessageData' - description: ECS object to attach to the context of the message. + description: Metadata to attach to the context of the message. fields_to_anonymize: + description: >- + List of field names within the data object that should be + anonymized. + example: + - user.name + - source.ip items: type: string type: array role: $ref: '#/components/schemas/ChatMessageRole' - description: Message role. + description: The sender role of the message. required: - role ChatMessageRole: - description: Message role. + description: The role associated with the message in the chat. enum: - system - user - assistant + example: user type: string ContentReferences: additionalProperties: @@ -1162,6 +1837,7 @@ components: enum: - assistant - insights + example: assistant type: string ConversationConfidence: description: The conversation confidence. @@ -1169,6 +1845,7 @@ components: - low - medium - high + example: high type: string ConversationCreateProps: type: object @@ -1179,11 +1856,13 @@ components: category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: assistant excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: description: The conversation id. + example: conversation123 type: string messages: description: The conversation messages. @@ -1194,6 +1873,7 @@ components: $ref: '#/components/schemas/Replacements' title: description: The conversation title. + example: Security AI Assistant Setup type: string required: - title @@ -1206,11 +1886,13 @@ components: category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: assistant createdAt: description: The time conversation was created. + example: '2025-04-30T14:00:00Z' type: string excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: $ref: '#/components/schemas/NonEmptyString' @@ -1221,18 +1903,21 @@ components: type: array namespace: description: Kibana space + example: default type: string replacements: $ref: '#/components/schemas/Replacements' summary: $ref: '#/components/schemas/ConversationSummary' timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' title: description: The conversation title. + example: Security AI Assistant Setup type: string updatedAt: description: The last time conversation was updated. + example: '2025-04-30T16:30:00Z' type: string users: items: @@ -1253,15 +1938,21 @@ components: description: >- How confident you are about this being a correct and useful learning. + example: high content: description: Summary text of the conversation over time. + example: >- + This conversation covered how to configure the Security AI + Assistant. type: string public: description: Define if summary is marked as publicly available. + example: true type: boolean timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' description: The timestamp summary was updated. + example: '2025-04-30T16:00:00Z' ConversationUpdateProps: type: object properties: @@ -1271,8 +1962,9 @@ components: category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: assistant excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: $ref: '#/components/schemas/NonEmptyString' @@ -1287,6 +1979,7 @@ components: $ref: '#/components/schemas/ConversationSummary' title: description: The conversation title. + example: Updated Security AI Assistant Setup type: string required: - id @@ -1302,13 +1995,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1329,13 +2025,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1352,7 +2051,8 @@ components: type: object properties: required: - description: Whether this resource should always be included, defaults to false + description: Whether this resource should always be included, defaults to false. + example: false type: boolean vector: $ref: '#/components/schemas/Vector' @@ -1362,15 +2062,18 @@ components: kbResource: $ref: '#/components/schemas/KnowledgeBaseResource' source: - description: Source document name or filepath + description: Source document name or filepath. + example: /documents/example.txt type: string text: - description: Knowledge Base Entry content + description: Knowledge Base Entry content. + example: This is the content of the document. type: string type: - description: Entry type + description: Entry type. enum: - document + example: document type: string required: - type @@ -1386,15 +2089,18 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean id: $ref: '#/components/schemas/NonEmptyString' name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1413,17 +2119,21 @@ components: properties: label: description: Label of the query + example: High Severity Alerts type: string query: description: An ESQL query + example: SELECT * FROM alerts WHERE severity = "high" type: string timerange: description: Time range to select in the time picker. type: object properties: from: + example: '2025-04-01T00:00:00Z' type: string to: + example: '2025-04-30T23:59:59Z' type: string required: - from @@ -1431,6 +2141,7 @@ components: type: enum: - EsqlQuery + example: EsqlQuery type: string required: - type @@ -1446,37 +2157,48 @@ components: - updated_at type: string FindConversationsSortField: + description: >- + The field by which to sort the conversations. Possible values are + `created_at`, `title`, and `updated_at`. enum: - created_at - title - updated_at + example: created_at type: string FindKnowledgeBaseEntriesSortField: + description: Fields available for sorting Knowledge Base Entries. enum: - created_at - is_default - title - updated_at + example: title type: string FindPromptsSortField: + description: Field by which to sort the prompts. enum: - created_at - is_default - name - updated_at + example: created_at type: string IndexEntry: allOf: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1497,13 +2219,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1524,7 +2249,10 @@ components: outputFields: description: >- Fields to extract from the query result, defaults to all fields if - not provided or empty + not provided or empty. + example: + - title + - author items: type: string type: array @@ -1534,23 +2262,28 @@ components: description: description: >- Description for when this index or data stream should be queried for - Knowledge Base content. Passed to the LLM as a tool description + Knowledge Base content. Passed to the LLM as a tool description. + example: Query this index for general knowledge base content. type: string field: - description: Field to query for Knowledge Base content + description: Field to query for Knowledge Base content. + example: content type: string index: - description: Index or Data Stream to query for Knowledge Base content + description: Index or Data Stream to query for Knowledge Base content. + example: knowledge_base_index type: string queryDescription: description: >- Description of query field used to fetch Knowledge Base content. - Passed to the LLM as part of the tool input schema + Passed to the LLM as part of the tool input schema. + example: Search for documents containing the specified keywords. type: string type: - description: Entry type + description: Entry type. enum: - index + example: index type: string required: - type @@ -1567,15 +2300,18 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean id: $ref: '#/components/schemas/NonEmptyString' name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1590,18 +2326,21 @@ components: InputSchema: description: >- Array of objects defining the input schema, allowing the LLM to extract - structured data to be used in retrieval + structured data to be used in retrieval. items: type: object properties: description: - description: Description of the field + description: Description of the field. + example: The title of the document. type: string fieldName: - description: Name of the field + description: Name of the field. + example: title type: string fieldType: - description: Type of the field + description: Type of the field. + example: string type: string required: - fieldName @@ -1609,6 +2348,7 @@ components: - description type: array KnowledgeBaseEntryBulkActionSkipReason: + description: Reason why a Knowledge Base Entry was skipped during the bulk action. enum: - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED type: string @@ -1616,8 +2356,12 @@ components: type: object properties: id: + description: ID of the skipped Knowledge Base Entry. + example: '123' type: string name: + description: Name of the skipped Knowledge Base Entry. + example: Skipped Entry type: string skip_reason: $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' @@ -1631,6 +2375,14 @@ components: type: object properties: errors: + description: List of errors encountered during the bulk action. + example: + - err_code: UPDATE_FAILED + knowledgeBaseEntries: + - id: '456' + name: Error Entry + message: Failed to update entry. + statusCode: 400 items: $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' type: array @@ -1642,12 +2394,20 @@ components: - results - summary knowledgeBaseEntriesCount: + description: Total number of Knowledge Base Entries processed. + example: 8 type: integer message: + description: Message describing the result of the bulk action. + example: Bulk action completed successfully. type: string statusCode: + description: HTTP status code of the response. + example: 200 type: integer success: + description: Indicates whether the bulk action was successful. + example: true type: boolean required: - attributes @@ -1655,18 +2415,40 @@ components: type: object properties: created: + description: List of Knowledge Base Entries that were successfully created. + example: + - content: This is the content of the new entry. + id: '456' + title: New Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' type: array deleted: + description: >- + List of IDs of Knowledge Base Entries that were successfully + deleted. + example: + - '789' items: type: string type: array skipped: + description: >- + List of Knowledge Base Entries that were skipped during the bulk + action. + example: + - id: '123' + name: Skipped Entry + skip_reason: KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED items: $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' type: array updated: + description: List of Knowledge Base Entries that were successfully updated. + example: + - content: Updated content. + id: '123' + title: Updated Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' type: array @@ -1679,12 +2461,24 @@ components: type: object properties: failed: + description: Number of Knowledge Base Entries that failed during the bulk action. + example: 2 type: integer skipped: + description: >- + Number of Knowledge Base Entries that were skipped during the bulk + action. + example: 1 type: integer succeeded: + description: >- + Number of Knowledge Base Entries that were successfully processed + during the bulk action. + example: 5 type: integer total: + description: Total number of Knowledge Base Entries involved in the bulk action. + example: 8 type: integer required: - failed @@ -1698,13 +2492,16 @@ components: properties: knowledgeBaseEntryId: description: Id of the Knowledge Base Entry + example: kbentry456 type: string knowledgeBaseEntryName: description: Name of the knowledge base entry + example: Network Security Best Practices type: string type: enum: - KnowledgeBaseEntry + example: KnowledgeBaseEntry type: string required: - type @@ -1721,8 +2518,12 @@ components: type: object properties: id: + description: ID of the Knowledge Base Entry that encountered an error. + example: '456' type: string name: + description: Name of the Knowledge Base Entry that encountered an error. + example: Error Entry type: string required: - id @@ -1731,10 +2532,16 @@ components: type: object properties: error: + description: Error type or category. + example: Not Found type: string message: + description: Detailed error message. + example: The requested Knowledge Base Entry was not found. type: string statusCode: + description: HTTP status code of the error. + example: 404 type: number required: - statusCode @@ -1761,10 +2568,11 @@ components: KnowledgeBaseResource: description: >- Knowledge Base resource name for grouping entries, e.g. 'security_labs', - 'user', etc + 'user', etc. enum: - security_labs - user + example: security_labs type: string KnowledgeBaseResponse: description: AI assistant KnowledgeBase. @@ -1772,6 +2580,7 @@ components: properties: success: description: Identify the success of the method execution. + example: true type: boolean Message: description: AI assistant conversation message. @@ -1779,31 +2588,39 @@ components: properties: content: description: Message content. + example: Hello, how can I assist you today? type: string isError: description: Is error message. + example: false type: boolean metadata: $ref: '#/components/schemas/MessageMetadata' - description: metadata + description: Metadata reader: $ref: '#/components/schemas/Reader' description: Message content. role: $ref: '#/components/schemas/MessageRole' description: Message role. + example: assistant timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' description: The timestamp message was sent or received. + example: '2025-04-30T15:30:00Z' traceData: $ref: '#/components/schemas/TraceData' - description: trace Data + description: Trace data required: - timestamp - content - role MessageData: additionalProperties: true + description: ECS-style metadata attached to the message. + example: + alert_id: alert-456 + user_id: abc123 type: object MessageMetadata: description: Message metadata @@ -1811,16 +2628,26 @@ components: properties: contentReferences: $ref: '#/components/schemas/ContentReferences' - description: Data refered to by the message content. + description: Data referred to by the message content. MessageRole: description: Message role. enum: - system - user - assistant + example: assistant type: string NonEmptyString: - description: A string that does not contain only whitespace characters + description: A string that does not contain only whitespace characters. + example: I am a string + format: nonempty + minLength: 1 + type: string + NonEmptyTimestamp: + description: >- + A string that represents a timestamp in ISO 8601 format and does not + contain only whitespace characters. + example: '2023-10-31T12:00:00Z' format: nonempty minLength: 1 type: string @@ -1828,14 +2655,21 @@ components: type: object properties: anonymization_fields: + description: Array of anonymization fields that caused the error. items: $ref: '#/components/schemas/AnonymizationFieldDetailsInError' type: array err_code: + description: Error code indicating the type of failure. + example: UPDATE_FAILED type: string message: + description: Error message. + example: Failed to update anonymization field. type: string status_code: + description: Status code of the response. + example: 400 type: integer required: - message @@ -1845,14 +2679,21 @@ components: type: object properties: err_code: + description: Specific error code for the issue. + example: UPDATE_FAILED type: string knowledgeBaseEntries: + description: List of Knowledge Base Entries that encountered the error. items: $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' type: array message: + description: Error message describing the issue. + example: Failed to update entry. type: string statusCode: + description: HTTP status code associated with the error. + example: 400 type: integer required: - message @@ -1862,14 +2703,18 @@ components: type: object properties: err_code: + description: A code representing the error type. type: string message: + description: A message describing the error encountered. type: string prompts: + description: List of prompts that encountered errors. items: $ref: '#/components/schemas/PromptDetailsInError' type: array status_code: + description: The HTTP status code associated with the error. type: integer required: - message @@ -1882,13 +2727,16 @@ components: properties: title: description: Title of the documentation + example: Getting Started with Security AI Assistant type: string type: enum: - ProductDocumentation + example: ProductDocumentation type: string url: description: URL to the documentation + example: https://docs.example.com/security-ai-assistant type: string required: - type @@ -1899,23 +2747,41 @@ components: type: object properties: categories: + description: List of categories for the prompt. + example: + - security + - verification items: type: string type: array color: + description: The color associated with the prompt. + example: blue type: string consumer: + description: The consumer associated with the prompt. + example: admin type: string content: + description: The content of the prompt. + example: Please verify the security settings. type: string isDefault: + description: Whether this prompt should be the default. + example: false type: boolean isNewConversationDefault: + description: Whether this prompt should be the default for new conversations. + example: true type: boolean name: + description: The name of the prompt. + example: New Security Prompt type: string promptType: $ref: '#/components/schemas/PromptType' + description: The type of the prompt. + example: system required: - name - content @@ -1924,8 +2790,10 @@ components: type: object properties: id: + description: The ID of the prompt that encountered an error. type: string name: + description: The name of the prompt that encountered an error. type: string required: - id @@ -1933,39 +2801,52 @@ components: type: object properties: categories: + description: Categories associated with the prompt. items: type: string type: array color: + description: The color associated with the prompt. type: string consumer: + description: The consumer that the prompt is associated with. type: string content: + description: The content of the prompt. type: string createdAt: + description: The timestamp of when the prompt was created. type: string createdBy: + description: The user who created the prompt. type: string id: $ref: '#/components/schemas/NonEmptyString' isDefault: + description: Whether this prompt is the default. type: boolean isNewConversationDefault: + description: Whether this prompt is the default for new conversations. type: boolean name: + description: The name of the prompt. type: string namespace: - description: Kibana space + description: Kibana space where the prompt is located. type: string promptType: $ref: '#/components/schemas/PromptType' + description: The type of the prompt. timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' updatedAt: + description: The timestamp of when the prompt was last updated. type: string updatedBy: + description: The user who last updated the prompt. type: string users: + description: List of users associated with the prompt. items: $ref: '#/components/schemas/User' type: array @@ -1975,6 +2856,7 @@ components: - promptType - content PromptsBulkActionSkipReason: + description: Reason why a prompt was skipped during the bulk action. enum: - PROMPT_FIELD_NOT_MODIFIED type: string @@ -1982,11 +2864,14 @@ components: type: object properties: id: + description: The ID of the prompt that was skipped. type: string name: + description: The name of the prompt that was skipped. type: string skip_reason: $ref: '#/components/schemas/PromptsBulkActionSkipReason' + description: The reason for skipping the prompt. required: - id - skip_reason @@ -2008,12 +2893,20 @@ components: - results - summary message: + description: A message describing the result of the bulk action. + example: Bulk action completed successfully. type: string prompts_count: + description: The number of prompts processed in the bulk action. + example: 6 type: integer status_code: + description: The HTTP status code of the response. + example: 200 type: integer success: + description: Indicates if the bulk action was successful. + example: true type: boolean required: - attributes @@ -2021,18 +2914,22 @@ components: type: object properties: created: + description: List of prompts that were created. items: $ref: '#/components/schemas/PromptResponse' type: array deleted: + description: List of IDs of prompts that were deleted. items: type: string type: array skipped: + description: List of prompts that were skipped. items: $ref: '#/components/schemas/PromptsBulkActionSkipResult' type: array updated: + description: List of prompts that were updated. items: $ref: '#/components/schemas/PromptResponse' type: array @@ -2042,7 +2939,7 @@ components: - deleted - skipped PromptType: - description: Prompt type + description: Type of the prompt (either system or quick). enum: - system - quick @@ -2051,20 +2948,36 @@ components: type: object properties: categories: + description: The updated categories for the prompt. + example: + - security + - alert items: type: string type: array color: + description: The updated color associated with the prompt. + example: green type: string consumer: + description: The updated consumer for the prompt. + example: user123 type: string content: + description: The updated content for the prompt. + example: Updated content for security prompt. type: string id: + description: The ID of the prompt to update. + example: prompt123 type: string isDefault: + description: Whether this prompt should be the default. + example: true type: boolean isNewConversationDefault: + description: Whether the prompt should be the default for new conversations. + example: false type: boolean required: - id @@ -2074,6 +2987,7 @@ components: - OpenAI - Azure OpenAI - Other + example: OpenAI type: string Reader: additionalProperties: true @@ -2081,24 +2995,28 @@ components: Replacements: additionalProperties: type: string - description: Replacements object used to anonymize/deanomymize messsages + description: Replacements object used to anonymize/deanonymize messages type: object ResponseFields: type: object properties: createdAt: - description: Time the Knowledge Base Entry was created + description: Time the Knowledge Base Entry was created. + example: '2023-01-01T12:00:00Z' type: string createdBy: - description: User who created the Knowledge Base Entry + description: User who created the Knowledge Base Entry. + example: admin type: string id: $ref: '#/components/schemas/NonEmptyString' updatedAt: - description: Time the Knowledge Base Entry was last updated + description: Time the Knowledge Base Entry was last updated. + example: '2023-01-02T12:00:00Z' type: string updatedBy: - description: User who last updated the Knowledge Base Entry + description: User who last updated the Knowledge Base Entry. + example: editor type: string required: - id @@ -2113,10 +3031,12 @@ components: properties: alertId: description: ID of the Alert + example: alert789 type: string type: enum: - SecurityAlert + example: SecurityAlert type: string required: - type @@ -2130,48 +3050,59 @@ components: type: enum: - SecurityAlertsPage + example: SecurityAlertsPage type: string required: - type description: References the security alerts page SortOrder: + description: The order in which results are sorted. enum: - asc - desc + example: asc type: string TraceData: - description: trace Data + description: Trace Data type: object properties: traceId: description: Could be any string, not necessarily a UUID + example: d9876543-f0a1-2345-6789-abcdef123456 type: string transactionId: description: Could be any string, not necessarily a UUID + example: a1234567-bc89-0def-1234-56789abcdef0 type: string User: - description: Could be any string, not necessarily a UUID + description: Could be any string, not necessarily a UUID. type: object properties: id: - description: User id + description: User id. + example: user123 type: string name: - description: User name + description: User name. + example: John Doe type: string Vector: description: >- Object containing Knowledge Base Entry text embeddings and modelId used - to create the embeddings + to create the embeddings. type: object properties: modelId: - description: ID of the model used to create the embeddings + description: ID of the model used to create the embeddings. + example: bert-base-uncased type: string tokens: additionalProperties: type: number - description: Tokens with their corresponding values + description: Tokens with their corresponding values. + example: + token1: 0.123 + token2: 0.456 type: object required: - modelId diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 2411f50324c2b..67ce332d05e29 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -22,25 +22,54 @@ paths: content: application/json: schema: + example: + create: + - allowed: true + anonymized: false + field: host.name + - allowed: false + anonymized: true + field: user.name + delete: + ids: + - field5 + - field6 + query: 'field: host.name' + update: + - allowed: true + anonymized: false + id: field8 + - allowed: false + anonymized: true + id: field9 type: object properties: create: + description: Array of anonymization fields to create. items: $ref: '#/components/schemas/AnonymizationFieldCreateProps' type: array delete: + description: >- + Object containing the query to filter anonymization fields + and/or an array of anonymization field IDs to delete. type: object properties: ids: - description: Array of anonymization fields IDs + description: Array of IDs to apply the action to. + example: + - '1234' + - '5678' items: type: string minItems: 1 type: array query: - description: Query to filter anonymization fields + description: Query to filter the bulk action. + example: 'status: ''inactive''' type: string update: + description: Array of anonymization fields to update. items: $ref: '#/components/schemas/AnonymizationFieldUpdateProps' type: array @@ -48,20 +77,67 @@ paths: '200': content: application/json: + example: + anonymization_fields_count: 5 + attributes: + results: + created: + - allowed: false + anonymized: true + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: host.name + id: field2 + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + deleted: + - field3 + skipped: + - id: field4 + name: user.name + skip_reason: ANONYMIZATION_FIELD_NOT_MODIFIED + updated: + - allowed: true + anonymized: false + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: url.domain + id: field8 + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + summary: + failed: 1 + skipped: 1 + succeeded: 2 + total: 5 + message: Bulk action completed successfully + status_code: 200 + success: true schema: $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' description: Indicates a successful call. '400': content: application/json: + example: + error: Bad Request + message: Invalid request body + statusCode: 400 schema: type: object properties: error: + description: Error type or name. type: string message: + description: Detailed error message. type: string statusCode: + description: Status code of the response. type: number description: Generic Error summary: Apply a bulk action to anonymization fields @@ -73,7 +149,13 @@ paths: description: Get a list of all anonymization fields. operationId: FindAnonymizationFields parameters: - - in: query + - description: Fields to return + example: + - id + - field + - anonymized + - allowed + in: query name: fields required: false schema: @@ -81,24 +163,28 @@ paths: type: string type: array - description: Search query + example: 'field: "user.name"' in: query name: filter required: false schema: type: string - description: Field to sort by + example: created_at in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindAnonymizationFieldsSortField' - description: Sort order + example: asc in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - description: Page number + example: 1 in: query name: page required: false @@ -107,6 +193,7 @@ paths: minimum: 1 type: integer - description: AnonymizationFields per page + example: 20 in: query name: per_page required: false @@ -118,6 +205,21 @@ paths: '200': content: application/json: + example: + data: + - allowed: true + anonymized: true + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + field: user.name + id: '1' + namespace: default + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + page: 1 + perPage: 20 + total: 100 schema: type: object properties: @@ -140,6 +242,10 @@ paths: '400': content: application/json: + example: + error: Bad Request + message: Invalid request parameters + statusCode: 400 schema: type: object properties: @@ -160,6 +266,7 @@ paths: operationId: ChatComplete parameters: - description: If true, the response will not include content references. + example: false in: query name: content_references_disabled required: false @@ -169,6 +276,24 @@ paths: requestBody: content: application/json: + example: + connectorId: conn-001 + conversationId: abc123 + isStream: true + langSmithApiKey: sk-abc123 + langSmithProject: security_ai_project + messages: + - content: What are some common phishing techniques? + data: + user_id: user_789 + fields_to_anonymize: + - user.name + - source.ip + role: user + model: gpt-4 + persist: true + promptId: prompt_456 + responseLanguage: en schema: $ref: '#/components/schemas/ChatCompleteProps' required: true @@ -179,7 +304,7 @@ paths: schema: format: binary type: string - description: Indicates a successful call. + description: Indicates a successful model response call. '400': content: application/json: @@ -187,10 +312,16 @@ paths: type: object properties: error: + description: Error type. + example: Bad Request type: string message: + description: Human-readable error message. + example: Invalid request payload. type: string statusCode: + description: HTTP status code. + example: 400 type: number description: Generic Error summary: Create a model response @@ -199,11 +330,26 @@ paths: - Chat Complete API /api/security_ai_assistant/current_user/conversations: post: - description: Create a new Security AI Assistant conversation. + description: >- + Create a new Security AI Assistant conversation. This endpoint allows + the user to initiate a conversation with the Security AI Assistant by + providing the required parameters. operationId: CreateConversation requestBody: content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + excludeFromLastConversationStorage: false + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion schema: $ref: '#/components/schemas/ConversationCreateProps' required: true @@ -211,9 +357,29 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: >- + Indicates a successful call. The conversation was created + successfully. '400': content: application/json: @@ -221,60 +387,86 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: 'Missing required parameter: title' type: string statusCode: + example: 400 type: number - description: Generic Error + description: >- + Generic Error. This response indicates an issue with the request, + such as missing required parameters or incorrect data. summary: Create a conversation tags: - Security AI Assistant API - Conversation API /api/security_ai_assistant/current_user/conversations/_find: get: - description: Get a list of all conversations for the current user. + description: >- + Get a list of all conversations for the current user. This endpoint + allows users to search, filter, sort, and paginate through their + conversations. operationId: FindConversations parameters: - - in: query + - description: >- + A list of fields to include in the response. If omitted, all fields + are returned. + in: query name: fields required: false schema: + example: + - id + - title + - createdAt items: type: string type: array - - description: Search query + - description: >- + A search query to filter the conversations. Can match against + titles, messages, or other conversation attributes. in: query name: filter required: false schema: + example: Security Issue type: string - - description: Field to sort by + - description: >- + The field by which to sort the results. Valid fields are + `created_at`, `title`, and `updated_at`. in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindConversationsSortField' - - description: Sort order + example: created_at + - description: >- + The order in which to sort the results. Can be either `asc` for + ascending or `desc` for descending. in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - - description: Page number + example: desc + - description: The page number of the results to retrieve. Default is 1. in: query name: page required: false schema: default: 1 + example: 1 minimum: 1 type: integer - - description: Conversations per page + - description: The number of conversations to return per page. Default is 20. in: query name: per_page required: false schema: default: 20 + example: 20 minimum: 0 type: integer responses: @@ -285,21 +477,32 @@ paths: type: object properties: data: + description: A list of conversations. items: $ref: '#/components/schemas/ConversationResponse' type: array page: + description: The current page of the results. + example: 1 type: integer perPage: + description: The number of results returned per page. + example: 20 type: integer total: + description: >- + The total number of conversations matching the filter + criteria. + example: 100 type: integer required: - page - perPage - total - data - description: Successful response + description: >- + Successful response, returns a paginated list of conversations + matching the specified criteria. '400': content: application/json: @@ -307,22 +510,30 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid filter query parameter type: string statusCode: + example: 400 type: number - description: Generic Error + description: >- + Generic Error. The request could not be processed due to an invalid + query parameter or other issue. summary: Get conversations tags: - Security AI Assistant API - Conversations API /api/security_ai_assistant/current_user/conversations/{id}: delete: - description: Delete an existing conversation using the conversation ID. + description: >- + Delete an existing conversation using the conversation ID. This endpoint + allows users to permanently delete a conversation. operationId: DeleteConversation parameters: - description: The conversation's `id` value. + example: abc123 in: path name: id required: true @@ -332,9 +543,29 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: The conversation has been deleted. + role: system + timestamp: '2023-10-31T12:35:00Z' + replacements: {} + title: Deleted Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: >- + Indicates a successful call. The conversation was deleted + successfully. '400': content: application/json: @@ -342,21 +573,30 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid conversation ID type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. This response indicates an issue with the request. summary: Delete a conversation tags: - Security AI Assistant API - Conversation API get: - description: Get the details of an existing conversation using the conversation ID. + description: >- + Get the details of an existing conversation using the conversation ID. + This allows users to fetch the specific conversation data by its unique + ID. operationId: ReadConversation parameters: - - description: The conversation's `id` value. + - description: >- + The conversation's `id` value, a unique identifier for the + conversation. + example: abc123 in: path name: id required: true @@ -366,9 +606,27 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '67890' + connectorId: '12345' + category: assistant + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: false + id: abc123 + messages: + - content: Hello, how can I assist you today? + role: system + timestamp: '2023-10-31T12:00:00Z' + replacements: {} + title: Security Discussion + updatedAt: '2023-10-31T12:01:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: Indicates a successful call. The conversation details are returned. '400': content: application/json: @@ -376,21 +634,27 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: Invalid conversation ID type: string statusCode: + example: 400 type: number - description: Generic Error + description: Generic Error. The request could not be processed due to an error. summary: Get a conversation tags: - Security AI Assistant API - Conversations API put: - description: Update an existing conversation using the conversation ID. + description: >- + Update an existing conversation using the conversation ID. This endpoint + allows users to modify the details of an existing conversation. operationId: UpdateConversation parameters: - description: The conversation's `id` value. + example: abc123 in: path name: id required: true @@ -399,6 +663,18 @@ paths: requestBody: content: application/json: + example: + apiConfig: + actionTypeId: '09876' + connectorId: '54321' + category: insights + excludeFromLastConversationStorage: true + messages: + - content: The issue was resolved. + role: assistant + timestamp: '2023-10-31T12:30:00Z' + replacements: {} + title: Updated Security Discussion schema: $ref: '#/components/schemas/ConversationUpdateProps' required: true @@ -406,9 +682,29 @@ paths: '200': content: application/json: + example: + apiConfig: + actionTypeId: '09876' + connectorId: '54321' + category: insights + createdAt: '2023-10-31T12:01:00Z' + excludeFromLastConversationStorage: true + id: abc123 + messages: + - content: The issue was resolved. + role: assistant + timestamp: '2023-10-31T12:30:00Z' + replacements: {} + title: Updated Security Discussion + updatedAt: '2023-10-31T12:31:00Z' + users: + - id: user1 + name: John Doe schema: $ref: '#/components/schemas/ConversationResponse' - description: Indicates a successful call. + description: >- + Indicates a successful call. The conversation was updated + successfully. '400': content: application/json: @@ -416,12 +712,17 @@ paths: type: object properties: error: + example: Bad Request type: string message: + example: 'Missing required field: title' type: string statusCode: + example: 400 type: number - description: Generic Error + description: >- + Generic Error. This response indicates an issue with the request, + such as missing required parameters or incorrect data. summary: Update a conversation tags: - Security AI Assistant API @@ -432,6 +733,7 @@ paths: operationId: ReadKnowledgeBase parameters: - description: The KnowledgeBase `resource` value. + example: kb12345 in: path name: resource schema: @@ -444,16 +746,34 @@ paths: type: object properties: elser_exists: + description: Indicates if the ELSER model exists for the KnowledgeBase. + example: true type: boolean is_setup_available: + description: >- + Indicates if the setup process is available for the + KnowledgeBase. + example: true type: boolean is_setup_in_progress: + description: Indicates if the setup process is currently in progress. + example: false type: boolean product_documentation_status: + description: >- + The status of the product documentation in the + KnowledgeBase. + example: complete type: string security_labs_exists: + description: >- + Indicates if Security Labs documentation exists in the + KnowledgeBase. + example: true type: boolean user_data_exists: + description: Indicates if user data exists in the KnowledgeBase. + example: false type: boolean description: Indicates a successful call. '400': @@ -463,10 +783,16 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid resource ID provided. type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number description: Generic Error summary: Read a KnowledgeBase @@ -478,11 +804,15 @@ paths: operationId: CreateKnowledgeBase parameters: - description: The KnowledgeBase `resource` value. + example: kb12345 in: path name: resource schema: type: string - - description: Optional ELSER modelId to use when setting up the Knowledge Base + - description: >- + ELSER modelId to use when setting up the Knowledge Base. If not + provided, a default model will be used. + example: elser-model-001 in: query name: modelId required: false @@ -490,7 +820,8 @@ paths: type: string - description: >- Indicates whether we should or should not install Security Labs docs - when setting up the Knowledge Base + when setting up the Knowledge Base. Defaults to `false`. + example: true in: query name: ignoreSecurityLabs required: false @@ -511,10 +842,16 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid resource ID provided. type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number description: Generic Error summary: Create a KnowledgeBase @@ -528,6 +865,15 @@ paths: requestBody: content: application/json: + example: + content: >- + To reset your password, go to the settings page and click 'Reset + Password'. + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' required: true @@ -535,15 +881,30 @@ paths: '200': content: application/json: + example: + content: >- + To reset your password, go to the settings page and click + 'Reset Password'. + id: '12345' + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' description: Successful request returning Knowledge Base Entries '400': content: application/json: + example: + error: Invalid input + message: The 'title' field is required. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as invalid input or missing required + fields. summary: Create a Knowledge Base Entry tags: - Security AI Assistant API @@ -552,7 +913,7 @@ paths: post: description: >- The bulk action is applied to all Knowledge Base Entries that match the - filter or to the list of Knowledge Base Entries by their IDs + filter or to the list of Knowledge Base Entries by their IDs. operationId: PerformKnowledgeBaseEntryBulkAction requestBody: content: @@ -561,6 +922,10 @@ paths: type: object properties: create: + description: List of Knowledge Base Entries to create. + example: + - content: This is the content of the new entry. + title: New Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' type: array @@ -568,15 +933,25 @@ paths: type: object properties: ids: - description: Array of Knowledge base Entry IDs + description: Array of Knowledge Base Entry IDs. + example: + - '123' + - '456' + - '789' items: type: string minItems: 1 type: array query: - description: Query to filter Knowledge Base Entries + description: Query to filter Knowledge Base Entries. + example: status:active AND category:technology type: string update: + description: List of Knowledge Base Entries to update. + example: + - content: Updated content. + id: '123' + title: Updated Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' type: array @@ -602,45 +977,56 @@ paths: description: Finds Knowledge Base Entries that match the given query. operationId: FindKnowledgeBaseEntries parameters: - - in: query + - description: >- + A list of fields to include in the response. If not provided, all + fields will be included. + in: query name: fields required: false schema: + example: + - title + - created_at items: type: string type: array - - description: Search query + - description: Search query to filter Knowledge Base Entries by specific criteria. in: query name: filter required: false schema: + example: error handling type: string - - description: Field to sort by + - description: Field to sort the Knowledge Base Entries by. in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindKnowledgeBaseEntriesSortField' - - description: Sort order + example: created_at + - description: Sort order for the results, either asc or desc. in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - - description: Page number + example: asc + - description: Page number for paginated results. Defaults to 1. in: query name: page required: false schema: default: 1 + example: 2 minimum: 1 type: integer - - description: Knowledge Base Entries per page + - description: Number of Knowledge Base Entries to return per page. Defaults to 20. in: query name: per_page required: false schema: default: 20 + example: 10 minimum: 0 type: integer responses: @@ -651,21 +1037,28 @@ paths: type: object properties: data: + description: The list of Knowledge Base Entries for the current page. items: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' type: array page: + description: The current page number. + example: 1 type: integer perPage: + description: The number of Knowledge Base Entries returned per page. + example: 20 type: integer total: + description: The total number of Knowledge Base Entries available. + example: 100 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response containing the paginated Knowledge Base Entries. '400': content: application/json: @@ -673,22 +1066,29 @@ paths: type: object properties: error: + description: A short description of the error. + example: Bad Request type: string message: + description: A detailed message explaining the error. + example: 'Invalid query parameter: sort_order' type: string statusCode: + description: The HTTP status code of the error. + example: 400 type: number - description: Generic Error + description: Generic Error indicating an issue with the request. summary: Finds Knowledge Base Entries that match the given query. tags: - Security AI Assistant API - Knowledge Base Entries API /api/security_ai_assistant/knowledge_base/entries/{id}: delete: - description: Deletes a single Knowledge Base Entry using the `id` field + description: Delete a Knowledge Base Entry by its unique `id`. operationId: DeleteKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value + - description: The unique identifier (`id`) of the Knowledge Base Entry to delete. + example: '12345' in: path name: id required: true @@ -698,24 +1098,37 @@ paths: '200': content: application/json: + example: + id: '12345' + message: Knowledge Base Entry successfully deleted. schema: $ref: '#/components/schemas/DeleteResponseFields' - description: Successful request returning the deleted Knowledge Base Entry's ID + description: >- + Successful request returning the `id` of the deleted Knowledge Base + Entry. '400': content: application/json: + example: + error: Not Found + message: No Knowledge Base Entry found with the provided `id`. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as an invalid `id` or the entry not + being found. summary: Deletes a single Knowledge Base Entry using the `id` field tags: - Security AI Assistant API - Knowledge Base Entries API get: - description: Read a Knowledge Base Entry + description: Retrieve a Knowledge Base Entry by its unique `id`. operationId: ReadKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value. + - description: >- + The unique identifier (`id`) of the Knowledge Base Entry to + retrieve. + example: '12345' in: path name: id required: true @@ -725,24 +1138,40 @@ paths: '200': content: application/json: + example: + content: >- + To reset your password, go to the settings page and click + 'Reset Password'. + id: '12345' + tags: + - password + - reset + - help + title: How to reset a password schema: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning a Knowledge Base Entry + description: Successful request returning the requested Knowledge Base Entry. '400': content: application/json: + example: + error: Not Found + message: No Knowledge Base Entry found with the provided `id`. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as an invalid `id` or the entry not + being found. summary: Read a Knowledge Base Entry tags: - Security AI Assistant API - Knowledge Base Entries API put: - description: Update a Knowledge Base Entry + description: Update an existing Knowledge Base Entry by its unique `id`. operationId: UpdateKnowledgeBaseEntry parameters: - - description: The Knowledge Base Entry's `id` value + - description: The unique identifier (`id`) of the Knowledge Base Entry to update. + example: '12345' in: path name: id required: true @@ -751,6 +1180,16 @@ paths: requestBody: content: application/json: + example: + content: >- + To reset your password, go to the settings page, click 'Reset + Password', and follow the instructions. + tags: + - password + - reset + - help + - update + title: How to reset a password (updated) schema: $ref: '#/components/schemas/KnowledgeBaseEntryUpdateRouteProps' required: true @@ -758,15 +1197,31 @@ paths: '200': content: application/json: + example: + content: >- + To reset your password, go to the settings page, click 'Reset + Password', and follow the instructions. + id: '12345' + tags: + - password + - reset + - help + - update + title: How to reset a password (updated) schema: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' - description: Successful request returning the updated Knowledge Base Entry + description: Successful request returning the updated Knowledge Base Entry. '400': content: application/json: + example: + error: Invalid input + message: The 'content' field cannot be empty. schema: $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' - description: Generic Error + description: >- + A generic error occurred, such as invalid input or the entry not + being found. summary: Update a Knowledge Base Entry tags: - Security AI Assistant API @@ -776,31 +1231,50 @@ paths: description: >- Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their - IDs. + IDs. This action allows for bulk create, update, or delete operations. operationId: PerformPromptsBulkAction requestBody: content: application/json: + example: + create: + - content: Please verify the security settings. + name: New Security Prompt + promptType: system + delete: + ids: + - prompt1 + - prompt2 + update: + - content: Updated content for security prompt. + id: prompt123 schema: type: object properties: create: + description: List of prompts to be created. items: $ref: '#/components/schemas/PromptCreateProps' type: array delete: + description: Criteria for deleting prompts in bulk. type: object properties: ids: - description: Array of prompts IDs + description: Array of IDs to apply the action to. + example: + - '1234' + - '5678' items: type: string minItems: 1 type: array query: - description: Query to filter promps + description: Query to filter the bulk action. + example: 'status: ''inactive''' type: string update: + description: List of prompts to be updated. items: $ref: '#/components/schemas/PromptUpdateProps' type: array @@ -808,9 +1282,41 @@ paths: '200': content: application/json: + examples: + success: + value: + attributes: + errors: [] + results: + created: + - content: Please verify the security settings. + id: prompt6 + name: New Security Prompt + promptType: system + deleted: + - prompt2 + - prompt3 + skipped: + - id: prompt4 + name: Security Prompt + skip_reason: PROMPT_FIELD_NOT_MODIFIED + updated: + - content: Updated security settings prompt + id: prompt1 + name: Security Prompt + promptType: system + summary: + failed: 0 + skipped: 1 + succeeded: 4 + total: 5 + message: Bulk action completed successfully. + prompts_count: 5 + status_code: 200 + success: true schema: $ref: '#/components/schemas/PromptsBulkCrudActionResponse' - description: Indicates a successful call. + description: Indicates a successful call with the results of the bulk action. '400': content: application/json: @@ -818,60 +1324,76 @@ paths: type: object properties: error: + description: A short error message. + example: Bad Request type: string message: + description: A detailed error message. + example: Invalid prompt ID or missing required fields. type: string statusCode: + description: The HTTP status code for the error. + example: 400 type: number - description: Generic Error + description: Indicates a generic error due to a bad request. summary: Apply a bulk action to prompts tags: - Security AI Assistant API - Bulk API /api/security_ai_assistant/prompts/_find: get: - description: Get a list of all prompts. + description: >- + Get a list of all prompts based on optional filters, sorting, and + pagination. operationId: FindPrompts parameters: - - in: query + - description: List of specific fields to include in each returned prompt. + in: query name: fields required: false schema: + example: + - id + - name + - content items: type: string type: array - - description: Search query + - description: Search query string to filter prompts by matching fields. in: query name: filter required: false schema: + example: error handling type: string - - description: Field to sort by + - description: Field to sort prompts by. in: query name: sort_field required: false schema: $ref: '#/components/schemas/FindPromptsSortField' - - description: Sort order + - description: Sort order, either asc or desc. in: query name: sort_order required: false schema: $ref: '#/components/schemas/SortOrder' - - description: Page number + - description: Page number for pagination. in: query name: page required: false schema: default: 1 + example: 1 minimum: 1 type: integer - - description: Prompts per page + - description: Number of prompts per page. in: query name: per_page required: false schema: default: 20 + example: 20 minimum: 0 type: integer responses: @@ -879,24 +1401,58 @@ paths: content: application/json: schema: + example: + data: + - categories: + - troubleshooting + - logging + color: '#FF5733' + consumer: security + content: If you encounter an error, check the logs and retry. + createdAt: '2025-04-20T21:00:00Z' + createdBy: jdoe + id: prompt-123 + isDefault: true + isNewConversationDefault: false + name: Error Troubleshooting Prompt + namespace: default + promptType: standard + timestamp: '2025-04-30T22:30:00Z' + updatedAt: '2025-04-30T22:45:00Z' + updatedBy: jdoe + users: + - full_name: John Doe + username: jdoe + page: 1 + perPage: 20 + total: 142 type: object properties: data: + description: >- + The list of prompts returned based on the search query, + sorting, and pagination. items: $ref: '#/components/schemas/PromptResponse' type: array page: + description: Current page number. + example: 1 type: integer perPage: + description: Number of prompts per page. + example: 20 type: integer total: + description: Total number of prompts matching the query. + example: 142 type: integer required: - page - perPage - total - data - description: Successful response + description: Successful response containing a list of prompts. '400': content: application/json: @@ -904,12 +1460,18 @@ paths: type: object properties: error: + description: Short error message. + example: Bad Request type: string message: + description: Detailed description of the error. + example: Invalid sort order value provided. type: string statusCode: + description: HTTP status code for the error. + example: 400 type: number - description: Generic Error + description: Bad request due to invalid parameters or malformed query. summary: Get prompts tags: - Security AI Assistant API @@ -920,10 +1482,16 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean field: + description: Name of the anonymization field to create. + example: host.name type: string required: - field @@ -931,8 +1499,12 @@ components: type: object properties: id: + description: The ID of the anonymization field. + example: field12 type: string name: + description: Name of the anonymization field. + example: host.name type: string required: - id @@ -940,30 +1512,48 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean createdAt: + description: Timestamp of when the anonymization field was created. + example: '2023-10-31T12:00:00Z' type: string createdBy: + description: Username of the person who created the anonymization field. + example: user1 type: string field: + description: Name of the anonymization field. + example: url.domain type: string id: $ref: '#/components/schemas/NonEmptyString' + description: The ID of the anonymization field. namespace: - description: Kibana space + description: Kibana space in which this anonymization field exists. + example: default type: string timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' + description: Timestamp when the anonymization field was initially created. updatedAt: + description: Timestamp of the last update. + example: '2023-10-31T12:00:00Z' type: string updatedBy: + description: Username of the person who last updated the field. + example: user1 type: string required: - id - field AnonymizationFieldsBulkActionSkipReason: + description: Reason why the anonymization field was not modified. enum: - ANONYMIZATION_FIELD_NOT_MODIFIED type: string @@ -971,11 +1561,16 @@ components: type: object properties: id: + description: The ID of the anonymization field that was not modified. + example: field4 type: string name: + description: Name of the anonymization field that was not modified. + example: user.name type: string skip_reason: $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' + description: Reason why the anonymization field was not modified. required: - id - skip_reason @@ -983,11 +1578,14 @@ components: type: object properties: anonymization_fields_count: + description: Total number of anonymization fields processed. + example: 5 type: integer attributes: type: object properties: errors: + description: List of errors that occurred during the bulk operation. items: $ref: '#/components/schemas/NormalizedAnonymizationFieldError' type: array @@ -999,10 +1597,16 @@ components: - results - summary message: + description: Message providing information about the bulk action result. + example: Bulk action completed successfully type: string status_code: + description: HTTP status code returned. + example: 200 type: integer success: + description: Indicates if the bulk action was successful. + example: true type: boolean required: - attributes @@ -1010,18 +1614,23 @@ components: type: object properties: created: + description: List of anonymization fields successfully created. items: $ref: '#/components/schemas/AnonymizationFieldResponse' type: array deleted: items: + description: Array of IDs of anonymization fields that were deleted. + example: field3 type: string type: array skipped: + description: List of anonymization fields that were skipped during the operation. items: $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' type: array updated: + description: List of anonymization fields successfully updated. items: $ref: '#/components/schemas/AnonymizationFieldResponse' type: array @@ -1034,10 +1643,16 @@ components: type: object properties: allowed: + description: Whether this field is allowed to be sent to the model. + example: true type: boolean anonymized: + description: Whether this field should be anonymized. + example: false type: boolean id: + description: The ID of the anonymization field to update. + example: field8 type: string required: - id @@ -1045,20 +1660,25 @@ components: type: object properties: actionTypeId: - description: action type id + description: Action type ID + example: actionType456 type: string connectorId: - description: connector id + description: Connector ID + example: connector123 type: string defaultSystemPromptId: - description: defaultSystemPromptId + description: Default system prompt ID + example: systemPrompt001 type: string model: - description: model + description: Model + example: gpt-4 type: string provider: $ref: '#/components/schemas/Provider' description: Provider + example: OpenAI required: - connectorId - actionTypeId @@ -1068,9 +1688,11 @@ components: properties: id: description: Id of the content reference + example: content123 type: string type: description: Type of the content reference + example: SecurityAlert type: string required: - id @@ -1079,12 +1701,20 @@ components: type: object properties: failed: + description: The number of failed actions. + example: 0 type: integer skipped: + description: The number of skipped actions. + example: 1 type: integer succeeded: + description: The number of successfully performed actions. + example: 10 type: integer total: + description: The total number of actions attempted. + example: 12 type: integer required: - failed @@ -1092,59 +1722,104 @@ components: - succeeded - total ChatCompleteProps: + description: The request payload for creating a chat completion. + example: + connectorId: conn-001 + conversationId: abc123 + isStream: true + langSmithApiKey: sk-abc123 + langSmithProject: security_ai_project + messages: + - content: How do I detect ransomware on my endpoints? + data: + device_id: device-567 + fields_to_anonymize: + - device.name + - file.path + role: user + model: gpt-4 + persist: true + promptId: prompt_456 + responseLanguage: en type: object properties: connectorId: + description: Required connector identifier to route the request. + example: conn-001 type: string conversationId: $ref: '#/components/schemas/NonEmptyString' + description: Existing conversation ID to continue. isStream: + description: If true, the response will be streamed in chunks. + example: true type: boolean langSmithApiKey: + description: API key for LangSmith integration. + example: sk-abc123 type: string langSmithProject: + description: LangSmith project name for tracing. + example: security_ai_project type: string messages: + description: List of chat messages exchanged so far. items: $ref: '#/components/schemas/ChatMessage' type: array model: + description: Model ID or name to use for the response. + example: gpt-4 type: string persist: + description: Whether to persist the chat and response to storage. + example: true type: boolean promptId: + description: Prompt template identifier. + example: prompt_001 type: string responseLanguage: + description: ISO language code for the assistant's response. + example: en type: string required: - messages - persist - connectorId ChatMessage: - description: AI assistant message. + description: A message exchanged within the AI chat conversation. type: object properties: content: - description: Message content. + description: The textual content of the message. + example: What security incidents have been reported today? type: string data: $ref: '#/components/schemas/MessageData' - description: ECS object to attach to the context of the message. + description: Metadata to attach to the context of the message. fields_to_anonymize: + description: >- + List of field names within the data object that should be + anonymized. + example: + - user.name + - source.ip items: type: string type: array role: $ref: '#/components/schemas/ChatMessageRole' - description: Message role. + description: The sender role of the message. required: - role ChatMessageRole: - description: Message role. + description: The role associated with the message in the chat. enum: - system - user - assistant + example: user type: string ContentReferences: additionalProperties: @@ -1162,6 +1837,7 @@ components: enum: - assistant - insights + example: assistant type: string ConversationConfidence: description: The conversation confidence. @@ -1169,6 +1845,7 @@ components: - low - medium - high + example: high type: string ConversationCreateProps: type: object @@ -1179,11 +1856,13 @@ components: category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: assistant excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: description: The conversation id. + example: conversation123 type: string messages: description: The conversation messages. @@ -1194,6 +1873,7 @@ components: $ref: '#/components/schemas/Replacements' title: description: The conversation title. + example: Security AI Assistant Setup type: string required: - title @@ -1206,11 +1886,13 @@ components: category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: assistant createdAt: description: The time conversation was created. + example: '2025-04-30T14:00:00Z' type: string excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: $ref: '#/components/schemas/NonEmptyString' @@ -1221,18 +1903,21 @@ components: type: array namespace: description: Kibana space + example: default type: string replacements: $ref: '#/components/schemas/Replacements' summary: $ref: '#/components/schemas/ConversationSummary' timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' title: description: The conversation title. + example: Security AI Assistant Setup type: string updatedAt: description: The last time conversation was updated. + example: '2025-04-30T16:30:00Z' type: string users: items: @@ -1253,15 +1938,21 @@ components: description: >- How confident you are about this being a correct and useful learning. + example: high content: description: Summary text of the conversation over time. + example: >- + This conversation covered how to configure the Security AI + Assistant. type: string public: description: Define if summary is marked as publicly available. + example: true type: boolean timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' description: The timestamp summary was updated. + example: '2025-04-30T16:00:00Z' ConversationUpdateProps: type: object properties: @@ -1271,8 +1962,9 @@ components: category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: assistant excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean id: $ref: '#/components/schemas/NonEmptyString' @@ -1287,6 +1979,7 @@ components: $ref: '#/components/schemas/ConversationSummary' title: description: The conversation title. + example: Updated Security AI Assistant Setup type: string required: - id @@ -1302,13 +1995,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1329,13 +2025,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1352,7 +2051,8 @@ components: type: object properties: required: - description: Whether this resource should always be included, defaults to false + description: Whether this resource should always be included, defaults to false. + example: false type: boolean vector: $ref: '#/components/schemas/Vector' @@ -1362,15 +2062,18 @@ components: kbResource: $ref: '#/components/schemas/KnowledgeBaseResource' source: - description: Source document name or filepath + description: Source document name or filepath. + example: /documents/example.txt type: string text: - description: Knowledge Base Entry content + description: Knowledge Base Entry content. + example: This is the content of the document. type: string type: - description: Entry type + description: Entry type. enum: - document + example: document type: string required: - type @@ -1386,15 +2089,18 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean id: $ref: '#/components/schemas/NonEmptyString' name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1413,17 +2119,21 @@ components: properties: label: description: Label of the query + example: High Severity Alerts type: string query: description: An ESQL query + example: SELECT * FROM alerts WHERE severity = "high" type: string timerange: description: Time range to select in the time picker. type: object properties: from: + example: '2025-04-01T00:00:00Z' type: string to: + example: '2025-04-30T23:59:59Z' type: string required: - from @@ -1431,6 +2141,7 @@ components: type: enum: - EsqlQuery + example: EsqlQuery type: string required: - type @@ -1446,37 +2157,48 @@ components: - updated_at type: string FindConversationsSortField: + description: >- + The field by which to sort the conversations. Possible values are + `created_at`, `title`, and `updated_at`. enum: - created_at - title - updated_at + example: created_at type: string FindKnowledgeBaseEntriesSortField: + description: Fields available for sorting Knowledge Base Entries. enum: - created_at - is_default - title - updated_at + example: title type: string FindPromptsSortField: + description: Field by which to sort the prompts. enum: - created_at - is_default - name - updated_at + example: created_at type: string IndexEntry: allOf: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1497,13 +2219,16 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1524,7 +2249,10 @@ components: outputFields: description: >- Fields to extract from the query result, defaults to all fields if - not provided or empty + not provided or empty. + example: + - title + - author items: type: string type: array @@ -1534,23 +2262,28 @@ components: description: description: >- Description for when this index or data stream should be queried for - Knowledge Base content. Passed to the LLM as a tool description + Knowledge Base content. Passed to the LLM as a tool description. + example: Query this index for general knowledge base content. type: string field: - description: Field to query for Knowledge Base content + description: Field to query for Knowledge Base content. + example: content type: string index: - description: Index or Data Stream to query for Knowledge Base content + description: Index or Data Stream to query for Knowledge Base content. + example: knowledge_base_index type: string queryDescription: description: >- Description of query field used to fetch Knowledge Base content. - Passed to the LLM as part of the tool input schema + Passed to the LLM as part of the tool input schema. + example: Search for documents containing the specified keywords. type: string type: - description: Entry type + description: Entry type. enum: - index + example: index type: string required: - type @@ -1567,15 +2300,18 @@ components: - type: object properties: global: - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false type: boolean id: $ref: '#/components/schemas/NonEmptyString' name: - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: Example Entry type: string namespace: - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: default type: string users: description: >- @@ -1590,18 +2326,21 @@ components: InputSchema: description: >- Array of objects defining the input schema, allowing the LLM to extract - structured data to be used in retrieval + structured data to be used in retrieval. items: type: object properties: description: - description: Description of the field + description: Description of the field. + example: The title of the document. type: string fieldName: - description: Name of the field + description: Name of the field. + example: title type: string fieldType: - description: Type of the field + description: Type of the field. + example: string type: string required: - fieldName @@ -1609,6 +2348,7 @@ components: - description type: array KnowledgeBaseEntryBulkActionSkipReason: + description: Reason why a Knowledge Base Entry was skipped during the bulk action. enum: - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED type: string @@ -1616,8 +2356,12 @@ components: type: object properties: id: + description: ID of the skipped Knowledge Base Entry. + example: '123' type: string name: + description: Name of the skipped Knowledge Base Entry. + example: Skipped Entry type: string skip_reason: $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' @@ -1631,6 +2375,14 @@ components: type: object properties: errors: + description: List of errors encountered during the bulk action. + example: + - err_code: UPDATE_FAILED + knowledgeBaseEntries: + - id: '456' + name: Error Entry + message: Failed to update entry. + statusCode: 400 items: $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' type: array @@ -1642,12 +2394,20 @@ components: - results - summary knowledgeBaseEntriesCount: + description: Total number of Knowledge Base Entries processed. + example: 8 type: integer message: + description: Message describing the result of the bulk action. + example: Bulk action completed successfully. type: string statusCode: + description: HTTP status code of the response. + example: 200 type: integer success: + description: Indicates whether the bulk action was successful. + example: true type: boolean required: - attributes @@ -1655,18 +2415,40 @@ components: type: object properties: created: + description: List of Knowledge Base Entries that were successfully created. + example: + - content: This is the content of the new entry. + id: '456' + title: New Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' type: array deleted: + description: >- + List of IDs of Knowledge Base Entries that were successfully + deleted. + example: + - '789' items: type: string type: array skipped: + description: >- + List of Knowledge Base Entries that were skipped during the bulk + action. + example: + - id: '123' + name: Skipped Entry + skip_reason: KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED items: $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' type: array updated: + description: List of Knowledge Base Entries that were successfully updated. + example: + - content: Updated content. + id: '123' + title: Updated Entry items: $ref: '#/components/schemas/KnowledgeBaseEntryResponse' type: array @@ -1679,12 +2461,24 @@ components: type: object properties: failed: + description: Number of Knowledge Base Entries that failed during the bulk action. + example: 2 type: integer skipped: + description: >- + Number of Knowledge Base Entries that were skipped during the bulk + action. + example: 1 type: integer succeeded: + description: >- + Number of Knowledge Base Entries that were successfully processed + during the bulk action. + example: 5 type: integer total: + description: Total number of Knowledge Base Entries involved in the bulk action. + example: 8 type: integer required: - failed @@ -1698,13 +2492,16 @@ components: properties: knowledgeBaseEntryId: description: Id of the Knowledge Base Entry + example: kbentry456 type: string knowledgeBaseEntryName: description: Name of the knowledge base entry + example: Network Security Best Practices type: string type: enum: - KnowledgeBaseEntry + example: KnowledgeBaseEntry type: string required: - type @@ -1721,8 +2518,12 @@ components: type: object properties: id: + description: ID of the Knowledge Base Entry that encountered an error. + example: '456' type: string name: + description: Name of the Knowledge Base Entry that encountered an error. + example: Error Entry type: string required: - id @@ -1731,10 +2532,16 @@ components: type: object properties: error: + description: Error type or category. + example: Not Found type: string message: + description: Detailed error message. + example: The requested Knowledge Base Entry was not found. type: string statusCode: + description: HTTP status code of the error. + example: 404 type: number required: - statusCode @@ -1761,10 +2568,11 @@ components: KnowledgeBaseResource: description: >- Knowledge Base resource name for grouping entries, e.g. 'security_labs', - 'user', etc + 'user', etc. enum: - security_labs - user + example: security_labs type: string KnowledgeBaseResponse: description: AI assistant KnowledgeBase. @@ -1772,6 +2580,7 @@ components: properties: success: description: Identify the success of the method execution. + example: true type: boolean Message: description: AI assistant conversation message. @@ -1779,31 +2588,39 @@ components: properties: content: description: Message content. + example: Hello, how can I assist you today? type: string isError: description: Is error message. + example: false type: boolean metadata: $ref: '#/components/schemas/MessageMetadata' - description: metadata + description: Metadata reader: $ref: '#/components/schemas/Reader' description: Message content. role: $ref: '#/components/schemas/MessageRole' description: Message role. + example: assistant timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' description: The timestamp message was sent or received. + example: '2025-04-30T15:30:00Z' traceData: $ref: '#/components/schemas/TraceData' - description: trace Data + description: Trace data required: - timestamp - content - role MessageData: additionalProperties: true + description: ECS-style metadata attached to the message. + example: + alert_id: alert-456 + user_id: abc123 type: object MessageMetadata: description: Message metadata @@ -1811,16 +2628,26 @@ components: properties: contentReferences: $ref: '#/components/schemas/ContentReferences' - description: Data refered to by the message content. + description: Data referred to by the message content. MessageRole: description: Message role. enum: - system - user - assistant + example: assistant type: string NonEmptyString: - description: A string that does not contain only whitespace characters + description: A string that does not contain only whitespace characters. + example: I am a string + format: nonempty + minLength: 1 + type: string + NonEmptyTimestamp: + description: >- + A string that represents a timestamp in ISO 8601 format and does not + contain only whitespace characters. + example: '2023-10-31T12:00:00Z' format: nonempty minLength: 1 type: string @@ -1828,14 +2655,21 @@ components: type: object properties: anonymization_fields: + description: Array of anonymization fields that caused the error. items: $ref: '#/components/schemas/AnonymizationFieldDetailsInError' type: array err_code: + description: Error code indicating the type of failure. + example: UPDATE_FAILED type: string message: + description: Error message. + example: Failed to update anonymization field. type: string status_code: + description: Status code of the response. + example: 400 type: integer required: - message @@ -1845,14 +2679,21 @@ components: type: object properties: err_code: + description: Specific error code for the issue. + example: UPDATE_FAILED type: string knowledgeBaseEntries: + description: List of Knowledge Base Entries that encountered the error. items: $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' type: array message: + description: Error message describing the issue. + example: Failed to update entry. type: string statusCode: + description: HTTP status code associated with the error. + example: 400 type: integer required: - message @@ -1862,14 +2703,18 @@ components: type: object properties: err_code: + description: A code representing the error type. type: string message: + description: A message describing the error encountered. type: string prompts: + description: List of prompts that encountered errors. items: $ref: '#/components/schemas/PromptDetailsInError' type: array status_code: + description: The HTTP status code associated with the error. type: integer required: - message @@ -1882,13 +2727,16 @@ components: properties: title: description: Title of the documentation + example: Getting Started with Security AI Assistant type: string type: enum: - ProductDocumentation + example: ProductDocumentation type: string url: description: URL to the documentation + example: https://docs.example.com/security-ai-assistant type: string required: - type @@ -1899,23 +2747,41 @@ components: type: object properties: categories: + description: List of categories for the prompt. + example: + - security + - verification items: type: string type: array color: + description: The color associated with the prompt. + example: blue type: string consumer: + description: The consumer associated with the prompt. + example: admin type: string content: + description: The content of the prompt. + example: Please verify the security settings. type: string isDefault: + description: Whether this prompt should be the default. + example: false type: boolean isNewConversationDefault: + description: Whether this prompt should be the default for new conversations. + example: true type: boolean name: + description: The name of the prompt. + example: New Security Prompt type: string promptType: $ref: '#/components/schemas/PromptType' + description: The type of the prompt. + example: system required: - name - content @@ -1924,8 +2790,10 @@ components: type: object properties: id: + description: The ID of the prompt that encountered an error. type: string name: + description: The name of the prompt that encountered an error. type: string required: - id @@ -1933,39 +2801,52 @@ components: type: object properties: categories: + description: Categories associated with the prompt. items: type: string type: array color: + description: The color associated with the prompt. type: string consumer: + description: The consumer that the prompt is associated with. type: string content: + description: The content of the prompt. type: string createdAt: + description: The timestamp of when the prompt was created. type: string createdBy: + description: The user who created the prompt. type: string id: $ref: '#/components/schemas/NonEmptyString' isDefault: + description: Whether this prompt is the default. type: boolean isNewConversationDefault: + description: Whether this prompt is the default for new conversations. type: boolean name: + description: The name of the prompt. type: string namespace: - description: Kibana space + description: Kibana space where the prompt is located. type: string promptType: $ref: '#/components/schemas/PromptType' + description: The type of the prompt. timestamp: - $ref: '#/components/schemas/NonEmptyString' + $ref: '#/components/schemas/NonEmptyTimestamp' updatedAt: + description: The timestamp of when the prompt was last updated. type: string updatedBy: + description: The user who last updated the prompt. type: string users: + description: List of users associated with the prompt. items: $ref: '#/components/schemas/User' type: array @@ -1975,6 +2856,7 @@ components: - promptType - content PromptsBulkActionSkipReason: + description: Reason why a prompt was skipped during the bulk action. enum: - PROMPT_FIELD_NOT_MODIFIED type: string @@ -1982,11 +2864,14 @@ components: type: object properties: id: + description: The ID of the prompt that was skipped. type: string name: + description: The name of the prompt that was skipped. type: string skip_reason: $ref: '#/components/schemas/PromptsBulkActionSkipReason' + description: The reason for skipping the prompt. required: - id - skip_reason @@ -2008,12 +2893,20 @@ components: - results - summary message: + description: A message describing the result of the bulk action. + example: Bulk action completed successfully. type: string prompts_count: + description: The number of prompts processed in the bulk action. + example: 6 type: integer status_code: + description: The HTTP status code of the response. + example: 200 type: integer success: + description: Indicates if the bulk action was successful. + example: true type: boolean required: - attributes @@ -2021,18 +2914,22 @@ components: type: object properties: created: + description: List of prompts that were created. items: $ref: '#/components/schemas/PromptResponse' type: array deleted: + description: List of IDs of prompts that were deleted. items: type: string type: array skipped: + description: List of prompts that were skipped. items: $ref: '#/components/schemas/PromptsBulkActionSkipResult' type: array updated: + description: List of prompts that were updated. items: $ref: '#/components/schemas/PromptResponse' type: array @@ -2042,7 +2939,7 @@ components: - deleted - skipped PromptType: - description: Prompt type + description: Type of the prompt (either system or quick). enum: - system - quick @@ -2051,20 +2948,36 @@ components: type: object properties: categories: + description: The updated categories for the prompt. + example: + - security + - alert items: type: string type: array color: + description: The updated color associated with the prompt. + example: green type: string consumer: + description: The updated consumer for the prompt. + example: user123 type: string content: + description: The updated content for the prompt. + example: Updated content for security prompt. type: string id: + description: The ID of the prompt to update. + example: prompt123 type: string isDefault: + description: Whether this prompt should be the default. + example: true type: boolean isNewConversationDefault: + description: Whether the prompt should be the default for new conversations. + example: false type: boolean required: - id @@ -2074,6 +2987,7 @@ components: - OpenAI - Azure OpenAI - Other + example: OpenAI type: string Reader: additionalProperties: true @@ -2081,24 +2995,28 @@ components: Replacements: additionalProperties: type: string - description: Replacements object used to anonymize/deanomymize messsages + description: Replacements object used to anonymize/deanonymize messages type: object ResponseFields: type: object properties: createdAt: - description: Time the Knowledge Base Entry was created + description: Time the Knowledge Base Entry was created. + example: '2023-01-01T12:00:00Z' type: string createdBy: - description: User who created the Knowledge Base Entry + description: User who created the Knowledge Base Entry. + example: admin type: string id: $ref: '#/components/schemas/NonEmptyString' updatedAt: - description: Time the Knowledge Base Entry was last updated + description: Time the Knowledge Base Entry was last updated. + example: '2023-01-02T12:00:00Z' type: string updatedBy: - description: User who last updated the Knowledge Base Entry + description: User who last updated the Knowledge Base Entry. + example: editor type: string required: - id @@ -2113,10 +3031,12 @@ components: properties: alertId: description: ID of the Alert + example: alert789 type: string type: enum: - SecurityAlert + example: SecurityAlert type: string required: - type @@ -2130,48 +3050,59 @@ components: type: enum: - SecurityAlertsPage + example: SecurityAlertsPage type: string required: - type description: References the security alerts page SortOrder: + description: The order in which results are sorted. enum: - asc - desc + example: asc type: string TraceData: - description: trace Data + description: Trace Data type: object properties: traceId: description: Could be any string, not necessarily a UUID + example: d9876543-f0a1-2345-6789-abcdef123456 type: string transactionId: description: Could be any string, not necessarily a UUID + example: a1234567-bc89-0def-1234-56789abcdef0 type: string User: - description: Could be any string, not necessarily a UUID + description: Could be any string, not necessarily a UUID. type: object properties: id: - description: User id + description: User id. + example: user123 type: string name: - description: User name + description: User name. + example: John Doe type: string Vector: description: >- Object containing Knowledge Base Entry text embeddings and modelId used - to create the embeddings + to create the embeddings. type: object properties: modelId: - description: ID of the model used to create the embeddings + description: ID of the model used to create the embeddings. + example: bert-base-uncased type: string tokens: additionalProperties: type: number - description: Tokens with their corresponding values + description: Tokens with their corresponding values. + example: + token1: 0.123 + token2: 0.456 type: object required: - modelId diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts index 0e66e1bf4eede..e1ab75b189fe9 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen.ts @@ -16,8 +16,16 @@ import { z } from '@kbn/zod'; -import { NonEmptyString } from '../common_attributes.gen'; - +import { + BulkActionBase, + NonEmptyString, + NonEmptyTimestamp, + BulkCrudActionSummary, +} from '../common_attributes.gen'; + +/** + * Reason why the anonymization field was not modified. + */ export type AnonymizationFieldsBulkActionSkipReason = z.infer< typeof AnonymizationFieldsBulkActionSkipReason >; @@ -29,38 +37,92 @@ export type AnonymizationFieldsBulkActionSkipResult = z.infer< typeof AnonymizationFieldsBulkActionSkipResult >; export const AnonymizationFieldsBulkActionSkipResult = z.object({ + /** + * The ID of the anonymization field that was not modified. + */ id: z.string(), + /** + * Name of the anonymization field that was not modified. + */ name: z.string().optional(), + /** + * Reason why the anonymization field was not modified. + */ skip_reason: AnonymizationFieldsBulkActionSkipReason, }); export type AnonymizationFieldDetailsInError = z.infer; export const AnonymizationFieldDetailsInError = z.object({ + /** + * The ID of the anonymization field. + */ id: z.string(), + /** + * Name of the anonymization field. + */ name: z.string().optional(), }); export type NormalizedAnonymizationFieldError = z.infer; export const NormalizedAnonymizationFieldError = z.object({ + /** + * Error message. + */ message: z.string(), + /** + * Status code of the response. + */ status_code: z.number().int(), + /** + * Error code indicating the type of failure. + */ err_code: z.string().optional(), + /** + * Array of anonymization fields that caused the error. + */ anonymization_fields: z.array(AnonymizationFieldDetailsInError), }); export type AnonymizationFieldResponse = z.infer; export const AnonymizationFieldResponse = z.object({ + /** + * The ID of the anonymization field. + */ id: NonEmptyString, - timestamp: NonEmptyString.optional(), + /** + * Timestamp when the anonymization field was initially created. + */ + timestamp: NonEmptyTimestamp.optional(), + /** + * Name of the anonymization field. + */ field: z.string(), + /** + * Whether this field is allowed to be sent to the model. + */ allowed: z.boolean().optional(), + /** + * Whether this field should be anonymized. + */ anonymized: z.boolean().optional(), + /** + * Timestamp of the last update. + */ updatedAt: z.string().optional(), + /** + * Username of the person who last updated the field. + */ updatedBy: z.string().optional(), + /** + * Timestamp of when the anonymization field was created. + */ createdAt: z.string().optional(), + /** + * Username of the person who created the anonymization field. + */ createdBy: z.string().optional(), /** - * Kibana space + * Kibana space in which this anonymization field exists. */ namespace: z.string().optional(), }); @@ -69,58 +131,80 @@ export type AnonymizationFieldsBulkCrudActionResults = z.infer< typeof AnonymizationFieldsBulkCrudActionResults >; export const AnonymizationFieldsBulkCrudActionResults = z.object({ + /** + * List of anonymization fields successfully updated. + */ updated: z.array(AnonymizationFieldResponse), + /** + * List of anonymization fields successfully created. + */ created: z.array(AnonymizationFieldResponse), deleted: z.array(z.string()), + /** + * List of anonymization fields that were skipped during the operation. + */ skipped: z.array(AnonymizationFieldsBulkActionSkipResult), }); -export type BulkCrudActionSummary = z.infer; -export const BulkCrudActionSummary = z.object({ - failed: z.number().int(), - skipped: z.number().int(), - succeeded: z.number().int(), - total: z.number().int(), -}); - export type AnonymizationFieldsBulkCrudActionResponse = z.infer< typeof AnonymizationFieldsBulkCrudActionResponse >; export const AnonymizationFieldsBulkCrudActionResponse = z.object({ + /** + * Indicates if the bulk action was successful. + */ success: z.boolean().optional(), + /** + * HTTP status code returned. + */ status_code: z.number().int().optional(), + /** + * Message providing information about the bulk action result. + */ message: z.string().optional(), + /** + * Total number of anonymization fields processed. + */ anonymization_fields_count: z.number().int().optional(), attributes: z.object({ results: AnonymizationFieldsBulkCrudActionResults, summary: BulkCrudActionSummary, + /** + * List of errors that occurred during the bulk operation. + */ errors: z.array(NormalizedAnonymizationFieldError).optional(), }), }); -export type BulkActionBase = z.infer; -export const BulkActionBase = z.object({ +export type AnonymizationFieldCreateProps = z.infer; +export const AnonymizationFieldCreateProps = z.object({ /** - * Query to filter anonymization fields + * Name of the anonymization field to create. */ - query: z.string().optional(), + field: z.string(), /** - * Array of anonymization fields IDs + * Whether this field is allowed to be sent to the model. */ - ids: z.array(z.string()).min(1).optional(), -}); - -export type AnonymizationFieldCreateProps = z.infer; -export const AnonymizationFieldCreateProps = z.object({ - field: z.string(), allowed: z.boolean().optional(), + /** + * Whether this field should be anonymized. + */ anonymized: z.boolean().optional(), }); export type AnonymizationFieldUpdateProps = z.infer; export const AnonymizationFieldUpdateProps = z.object({ + /** + * The ID of the anonymization field to update. + */ id: z.string(), + /** + * Whether this field is allowed to be sent to the model. + */ allowed: z.boolean().optional(), + /** + * Whether this field should be anonymized. + */ anonymized: z.boolean().optional(), }); @@ -128,8 +212,17 @@ export type PerformAnonymizationFieldsBulkActionRequestBody = z.infer< typeof PerformAnonymizationFieldsBulkActionRequestBody >; export const PerformAnonymizationFieldsBulkActionRequestBody = z.object({ + /** + * Object containing the query to filter anonymization fields and/or an array of anonymization field IDs to delete. + */ delete: BulkActionBase.optional(), + /** + * Array of anonymization fields to create. + */ create: z.array(AnonymizationFieldCreateProps).optional(), + /** + * Array of anonymization fields to update. + */ update: z.array(AnonymizationFieldUpdateProps).optional(), }); export type PerformAnonymizationFieldsBulkActionRequestBodyInput = z.input< diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml index 01549b89d3bbb..04e79a3ecc4bf 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml @@ -19,15 +19,38 @@ paths: type: object properties: delete: - $ref: '#/components/schemas/BulkActionBase' + $ref: '../common_attributes.schema.yaml#/components/schemas/BulkActionBase' + description: Object containing the query to filter anonymization fields and/or an array of anonymization field IDs to delete. create: type: array items: $ref: '#/components/schemas/AnonymizationFieldCreateProps' + description: Array of anonymization fields to create. update: type: array items: $ref: '#/components/schemas/AnonymizationFieldUpdateProps' + description: Array of anonymization fields to update. + example: + delete: + query: 'field: host.name' + ids: + - 'field5' + - 'field6' + create: + - field: host.name + allowed: true + anonymized: false + - field: user.name + allowed: false + anonymized: true + update: + - id: field8 + allowed: true + anonymized: false + - id: field9 + allowed: false + anonymized: true responses: 200: description: Indicates a successful call. @@ -35,6 +58,46 @@ paths: application/json: schema: $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResponse' + example: + success: true + status_code: 200 + message: Bulk action completed successfully + anonymization_fields_count: 5 + attributes: + results: + updated: + - id: field8 + field: "url.domain" + allowed: true + anonymized: false + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + namespace: default + created: + - id: field2 + field: "host.name" + allowed: false + anonymized: true + timestamp: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + updatedBy: user1 + createdAt: '2023-10-31T12:00:00Z' + createdBy: user1 + namespace: default + deleted: + - field3 + skipped: + - id: field4 + name: "user.name" + skip_reason: ANONYMIZATION_FIELD_NOT_MODIFIED + summary: + failed: 1 + skipped: 1 + succeeded: 2 + total: 5 400: description: Generic Error content: @@ -44,15 +107,23 @@ paths: properties: statusCode: type: number + description: Status code of the response. error: type: string + description: Error type or name. message: type: string + description: Detailed error message. + example: + statusCode: 400 + error: Bad Request + message: Invalid request body components: schemas: AnonymizationFieldsBulkActionSkipReason: type: string + description: Reason why the anonymization field was not modified. enum: - ANONYMIZATION_FIELD_NOT_MODIFIED @@ -61,10 +132,15 @@ components: properties: id: type: string + description: The ID of the anonymization field that was not modified. + example: "field4" name: type: string + description: Name of the anonymization field that was not modified. + example: "user.name" skip_reason: $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipReason' + description: Reason why the anonymization field was not modified. required: - id - skip_reason @@ -74,8 +150,12 @@ components: properties: id: type: string + description: The ID of the anonymization field. + example: "field12" name: type: string + description: Name of the anonymization field. + example: "host.name" required: - id @@ -84,14 +164,21 @@ components: properties: message: type: string + description: Error message. + example: "Failed to update anonymization field." status_code: type: integer + description: Status code of the response. + example: 400 err_code: type: string + description: Error code indicating the type of failure. + example: "UPDATE_FAILED" anonymization_fields: type: array items: $ref: '#/components/schemas/AnonymizationFieldDetailsInError' + description: Array of anonymization fields that caused the error. required: - message - status_code @@ -105,25 +192,42 @@ components: properties: id: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' - 'timestamp': - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + description: The ID of the anonymization field. + timestamp: + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' + description: Timestamp when the anonymization field was initially created. field: type: string + description: Name of the anonymization field. + example: "url.domain" allowed: type: boolean + description: Whether this field is allowed to be sent to the model. + example: true anonymized: type: boolean + description: Whether this field should be anonymized. + example: false updatedAt: type: string + description: Timestamp of the last update. + example: "2023-10-31T12:00:00Z" updatedBy: type: string + description: Username of the person who last updated the field. + example: "user1" createdAt: type: string + description: Timestamp of when the anonymization field was created. + example: "2023-10-31T12:00:00Z" createdBy: type: string + description: Username of the person who created the anonymization field. + example: "user1" namespace: type: string - description: Kibana space + description: Kibana space in which this anonymization field exists. + example: "default" AnonymizationFieldsBulkCrudActionResults: type: object @@ -132,83 +236,66 @@ components: type: array items: $ref: '#/components/schemas/AnonymizationFieldResponse' + description: List of anonymization fields successfully updated. created: type: array items: $ref: '#/components/schemas/AnonymizationFieldResponse' + description: List of anonymization fields successfully created. deleted: type: array items: type: string + description: Array of IDs of anonymization fields that were deleted. + example: "field3" skipped: type: array items: $ref: '#/components/schemas/AnonymizationFieldsBulkActionSkipResult' + description: List of anonymization fields that were skipped during the operation. required: - updated - created - deleted - skipped - BulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - AnonymizationFieldsBulkCrudActionResponse: type: object properties: success: type: boolean + description: Indicates if the bulk action was successful. + example: true status_code: type: integer + description: HTTP status code returned. + example: 200 message: type: string + description: Message providing information about the bulk action result. + example: "Bulk action completed successfully" anonymization_fields_count: type: integer + description: Total number of anonymization fields processed. + example: 5 attributes: type: object properties: results: $ref: '#/components/schemas/AnonymizationFieldsBulkCrudActionResults' summary: - $ref: '#/components/schemas/BulkCrudActionSummary' + $ref: '../common_attributes.schema.yaml#/components/schemas/BulkCrudActionSummary' errors: type: array items: $ref: '#/components/schemas/NormalizedAnonymizationFieldError' + description: List of errors that occurred during the bulk operation. required: - results - summary required: - attributes - BulkActionBase: - x-inline: true - type: object - properties: - query: - type: string - description: Query to filter anonymization fields - ids: - type: array - description: Array of anonymization fields IDs - minItems: 1 - items: - type: string - AnonymizationFieldCreateProps: type: object required: @@ -216,10 +303,16 @@ components: properties: field: type: string + description: Name of the anonymization field to create. + example: "host.name" allowed: type: boolean + description: Whether this field is allowed to be sent to the model. + example: true anonymized: type: boolean + description: Whether this field should be anonymized. + example: false AnonymizationFieldUpdateProps: type: object @@ -228,7 +321,13 @@ components: properties: id: type: string + description: The ID of the anonymization field to update. + example: "field8" allowed: type: boolean + description: Whether this field is allowed to be sent to the model. + example: true anonymized: type: boolean + description: Whether this field should be anonymized. + example: false diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts index 1c478cb0b1f5c..fa6b681afbcee 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen.ts @@ -35,6 +35,9 @@ export type FindAnonymizationFieldsRequestQuery = z.infer< typeof FindAnonymizationFieldsRequestQuery >; export const FindAnonymizationFieldsRequestQuery = z.object({ + /** + * Fields to return + */ fields: ArrayFromString(z.string()).optional(), /** * Search query diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml index ce946efa7b38d..12d6f68fecbde 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml @@ -16,28 +16,37 @@ paths: - name: 'fields' in: query required: false + description: Fields to return schema: type: array items: type: string + example: + - id + - field + - anonymized + - allowed - name: 'filter' in: query description: Search query required: false schema: type: string + example: 'field: "user.name"' - name: 'sort_field' in: query description: Field to sort by required: false schema: $ref: '#/components/schemas/FindAnonymizationFieldsSortField' + example: 'created_at' - name: 'sort_order' in: query description: Sort order required: false schema: $ref: '../common_attributes.schema.yaml#/components/schemas/SortOrder' + example: 'asc' - name: 'page' in: query description: Page number @@ -46,6 +55,7 @@ paths: type: integer minimum: 1 default: 1 + example: 1 - name: 'per_page' in: query description: AnonymizationFields per page @@ -54,6 +64,7 @@ paths: type: integer minimum: 0 default: 20 + example: 20 responses: 200: @@ -78,6 +89,21 @@ paths: - perPage - total - data + example: + page: 1 + perPage: 20 + total: 100 + data: + - id: '1' + field: 'user.name' + anonymized: true + allowed: true + timestamp: '2023-10-31T12:00:00Z' + createdAt: '2023-10-31T12:00:00Z' + updatedAt: '2023-10-31T12:00:00Z' + createdBy: 'user1' + updatedBy: 'user1' + namespace: 'default' 400: description: Generic Error content: @@ -91,6 +117,10 @@ paths: type: string message: type: string + example: + statusCode: 400 + error: Bad Request + message: Invalid request parameters components: schemas: diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.gen.ts index 0857e364cf962..053691aa1a303 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.gen.ts @@ -17,7 +17,7 @@ import { z } from '@kbn/zod'; import { Replacements } from '../conversations/common_attributes.gen'; -import { NonEmptyString, User } from '../common_attributes.gen'; +import { NonEmptyTimestamp, User } from '../common_attributes.gen'; /** * An attack discovery that's also an alert @@ -65,7 +65,7 @@ export const AttackDiscoveryAlert = z.object({ */ mitreAttackTactics: z.array(z.string()).optional(), /** - * Optional Key-value pairs that are used to replace placeholders in the markdown fields + * Key-value pairs that are used to replace placeholders in the markdown fields */ replacements: Replacements.optional(), /** @@ -79,7 +79,7 @@ export const AttackDiscoveryAlert = z.object({ /** * The time the attack discovery was generated */ - timestamp: NonEmptyString, + timestamp: NonEmptyTimestamp, /** * A title for the attack discovery, in plain text */ diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.schema.yaml index 8ea1bcf0cec4d..321adf5068f3f 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.schema.yaml @@ -55,7 +55,7 @@ components: type: string type: array replacements: - description: Optional Key-value pairs that are used to replace placeholders in the markdown fields + description: Key-value pairs that are used to replace placeholders in the markdown fields $ref: '../conversations/common_attributes.schema.yaml#/components/schemas/Replacements' riskScore: description: The optional, (but typically populated after generation) risk score of the alert @@ -65,7 +65,7 @@ components: type: string timestamp: description: The time the attack discovery was generated - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' title: description: A title for the attack discovery, in plain text type: string diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts index 037ea17ed06c1..72a0edfd93b8e 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts @@ -16,7 +16,7 @@ import { z } from '@kbn/zod'; -import { NonEmptyString, User } from '../common_attributes.gen'; +import { NonEmptyTimestamp, NonEmptyString, User } from '../common_attributes.gen'; import { Replacements, ApiConfig } from '../conversations/common_attributes.gen'; import { AnonymizationFieldResponse } from '../anonymization_fields/bulk_crud_anonymization_fields_route.gen'; @@ -56,7 +56,7 @@ export const AttackDiscovery = z.object({ /** * The time the attack discovery was generated */ - timestamp: NonEmptyString.optional(), + timestamp: NonEmptyTimestamp.optional(), }); /** diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.schema.yaml index c71936ecdd41b..e53e408d8f490 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.schema.yaml @@ -42,7 +42,7 @@ components: type: string timestamp: description: The time the attack discovery was generated - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' AttackDiscoveries: type: array description: Array of attack discoveries diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.gen.ts index ff18fb03a5811..facda5b2399de 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.gen.ts @@ -21,7 +21,7 @@ export type GetAttackDiscoveryGenerationsRequestQuery = z.infer< >; export const GetAttackDiscoveryGenerationsRequestQuery = z.object({ /** - * Optional relative or absolute end time for filtering generations + * Relative or absolute end time for filtering generations */ end: z.string().optional(), /** @@ -29,7 +29,7 @@ export const GetAttackDiscoveryGenerationsRequestQuery = z.object({ */ size: z.coerce.number(), /** - * Optional relative or absolute start time for filtering generations + * Relative or absolute start time for filtering generations */ start: z.string().optional(), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.schema.yaml index 6ca3b1652eedf..faabaebffcd67 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_generations.route.schema.yaml @@ -19,7 +19,7 @@ paths: required: false schema: type: string - description: Optional relative or absolute end time for filtering generations + description: Relative or absolute end time for filtering generations - name: size in: query required: true @@ -31,7 +31,7 @@ paths: required: false schema: type: string - description: Optional relative or absolute start time for filtering generations + description: Relative or absolute start time for filtering generations responses: 200: description: Successful response diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.gen.ts index e466f97e886a3..9c837235437fe 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.gen.ts @@ -71,7 +71,7 @@ export const IntervalSchedule = z.object({ }); /** - * Optionally groups actions by use cases. Use `default` for alert notifications. + * Groups actions by use cases. Use `default` for alert notifications. */ export type AttackDiscoveryScheduleActionGroup = z.infer; export const AttackDiscoveryScheduleActionGroup = z.string(); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.schema.yaml index c74ca6ec822b4..829750a832ded 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/schedules.schema.yaml @@ -166,7 +166,7 @@ components: AttackDiscoveryScheduleActionGroup: type: string - description: Optionally groups actions by use cases. Use `default` for alert notifications. + description: Groups actions by use cases. Use `default` for alert notifications. AttackDiscoveryScheduleActionId: type: string diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts index 383f95358cdea..f87d0c6a3d3d9 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts @@ -19,51 +19,93 @@ import { BooleanFromString } from '@kbn/zod-helpers'; import { NonEmptyString } from '../common_attributes.gen'; +/** + * The operational context for the assistant. + */ export type RootContext = z.infer; export const RootContext = z.literal('security'); /** - * Message role. + * The role associated with the message in the chat. */ export type ChatMessageRole = z.infer; export const ChatMessageRole = z.enum(['system', 'user', 'assistant']); export type ChatMessageRoleEnum = typeof ChatMessageRole.enum; export const ChatMessageRoleEnum = ChatMessageRole.enum; +/** + * ECS-style metadata attached to the message. + */ export type MessageData = z.infer; export const MessageData = z.object({}).catchall(z.unknown()); /** - * AI assistant message. + * A message exchanged within the AI chat conversation. */ export type ChatMessage = z.infer; export const ChatMessage = z.object({ /** - * Message content. + * The textual content of the message. */ content: z.string().optional(), /** - * Message role. + * The sender role of the message. */ role: ChatMessageRole, /** - * ECS object to attach to the context of the message. + * Metadata to attach to the context of the message. */ data: MessageData.optional(), + /** + * List of field names within the data object that should be anonymized. + */ fields_to_anonymize: z.array(z.string()).optional(), }); +/** + * The request payload for creating a chat completion. + */ export type ChatCompleteProps = z.infer; export const ChatCompleteProps = z.object({ + /** + * Existing conversation ID to continue. + */ conversationId: NonEmptyString.optional(), + /** + * Prompt template identifier. + */ promptId: z.string().optional(), + /** + * If true, the response will be streamed in chunks. + */ isStream: z.boolean().optional(), + /** + * ISO language code for the assistant's response. + */ responseLanguage: z.string().optional(), + /** + * LangSmith project name for tracing. + */ langSmithProject: z.string().optional(), + /** + * API key for LangSmith integration. + */ langSmithApiKey: z.string().optional(), + /** + * Required connector identifier to route the request. + */ connectorId: z.string(), + /** + * Model ID or name to use for the response. + */ model: z.string().optional(), + /** + * Whether to persist the chat and response to storage. + */ persist: z.boolean(), + /** + * List of chat messages exchanged so far. + */ messages: z.array(ChatMessage), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.schema.yaml index 555d85bd06e6b..69353cf043d9a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.schema.yaml @@ -20,15 +20,35 @@ paths: schema: type: boolean default: false + example: false requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChatCompleteProps' + example: + conversationId: "abc123" + promptId: "prompt_456" + isStream: true + responseLanguage: "en" + langSmithProject: "security_ai_project" + langSmithApiKey: "sk-abc123" + connectorId: "conn-001" + model: "gpt-4" + persist: true + messages: + - role: "user" + content: "What are some common phishing techniques?" + data: + user_id: "user_789" + fields_to_anonymize: + - "user.name" + - "source.ip" + responses: 200: - description: Indicates a successful call. + description: Indicates a successful model response call. content: application/octet-stream: schema: @@ -43,76 +63,131 @@ paths: properties: statusCode: type: number + description: HTTP status code. + example: 400 error: type: string + description: Error type. + example: "Bad Request" message: type: string + description: Human-readable error message. + example: "Invalid request payload." components: schemas: RootContext: type: string + description: The operational context for the assistant. enum: - security + example: "security" ChatMessageRole: type: string - description: Message role. + description: The role associated with the message in the chat. enum: - - system - - user - - assistant + - system # System-injected context or instructions + - user # End-user message + - assistant # AI-generated response + example: "user" MessageData: type: object + description: ECS-style metadata attached to the message. additionalProperties: true + example: + user_id: "abc123" + alert_id: "alert-456" ChatMessage: type: object - description: AI assistant message. + description: A message exchanged within the AI chat conversation. required: - 'role' properties: content: type: string - description: Message content. + description: The textual content of the message. + example: "What security incidents have been reported today?" role: $ref: '#/components/schemas/ChatMessageRole' - description: Message role. + description: The sender role of the message. data: - description: ECS object to attach to the context of the message. + description: Metadata to attach to the context of the message. $ref: '#/components/schemas/MessageData' fields_to_anonymize: type: array + description: List of field names within the data object that should be anonymized. items: type: string + example: + - "user.name" + - "source.ip" ChatCompleteProps: type: object + description: The request payload for creating a chat completion. properties: conversationId: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + description: Existing conversation ID to continue. promptId: type: string + description: Prompt template identifier. + example: "prompt_001" isStream: type: boolean + description: If true, the response will be streamed in chunks. + example: true responseLanguage: type: string + description: ISO language code for the assistant's response. + example: "en" langSmithProject: type: string + description: LangSmith project name for tracing. + example: "security_ai_project" langSmithApiKey: type: string + description: API key for LangSmith integration. + example: "sk-abc123" connectorId: type: string + description: Required connector identifier to route the request. + example: "conn-001" model: type: string + description: Model ID or name to use for the response. + example: "gpt-4" persist: type: boolean + description: Whether to persist the chat and response to storage. + example: true messages: type: array + description: List of chat messages exchanged so far. items: $ref: '#/components/schemas/ChatMessage' required: - messages - persist - connectorId + example: + conversationId: "abc123" + promptId: "prompt_456" + isStream: true + responseLanguage: "en" + langSmithProject: "security_ai_project" + langSmithApiKey: "sk-abc123" + connectorId: "conn-001" + model: "gpt-4" + persist: true + messages: + - role: "user" + content: "How do I detect ransomware on my endpoints?" + data: + device_id: "device-567" + fields_to_anonymize: + - "device.name" + - "file.path" diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts index 9ab5f4c155391..fa46c6ff0be38 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts @@ -18,44 +18,100 @@ import { z } from '@kbn/zod'; import { isNonEmptyString } from '@kbn/zod-helpers'; /** - * A string that does not contain only whitespace characters + * A string that does not contain only whitespace characters. */ export type NonEmptyString = z.infer; export const NonEmptyString = z.string().min(1).superRefine(isNonEmptyString); /** - * A universally unique identifier + * A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters. + */ +export type NonEmptyTimestamp = z.infer; +export const NonEmptyTimestamp = z.string().min(1).superRefine(isNonEmptyString); + +/** + * A universally unique identifier. */ export type UUID = z.infer; export const UUID = z.string().uuid(); /** - * Could be any string, not necessarily a UUID + * Could be any string, not necessarily a UUID. */ export type User = z.infer; export const User = z.object({ /** - * User id + * User id. */ id: z.string().optional(), /** - * User name + * User name. */ name: z.string().optional(), }); +/** + * The order in which results are sorted. + */ export type SortOrder = z.infer; export const SortOrder = z.enum(['asc', 'desc']); export type SortOrderEnum = typeof SortOrder.enum; export const SortOrderEnum = SortOrder.enum; /** - * User screen context + * User screen context. */ export type ScreenContext = z.infer; export const ScreenContext = z.object({ /** - * The local timezone of the user + * The local timezone of the user. */ timeZone: z.string().optional(), }); + +export type BulkCrudActionSummary = z.infer; +export const BulkCrudActionSummary = z.object({ + /** + * The number of failed actions. + */ + failed: z.number().int(), + /** + * The number of skipped actions. + */ + skipped: z.number().int(), + /** + * The number of successfully performed actions. + */ + succeeded: z.number().int(), + /** + * The total number of actions attempted. + */ + total: z.number().int(), +}); + +export type BulkActionBase = z.infer; +export const BulkActionBase = z.object({ + /** + * Query to filter the bulk action. + */ + query: z.string().optional(), + /** + * Array of IDs to apply the action to. + */ + ids: z.array(z.string()).min(1).optional(), +}); + +/** + * User screen context. + */ +export type PromptIds = z.infer; +export const PromptIds = z.object({ + /** + * The unique identifier for a specific prompt. + */ + promptId: z.string(), + /** + * The unique identifier for a group of prompts. + */ + promptGroupId: z.string(), +}); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml index 37d2c07957ae3..036584653f770 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml @@ -10,34 +10,108 @@ components: type: string format: nonempty minLength: 1 - description: A string that does not contain only whitespace characters + description: A string that does not contain only whitespace characters. + example: "I am a string" + + + NonEmptyTimestamp: + type: string + format: nonempty + minLength: 1 + description: A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters. + example: "2023-10-31T12:00:00Z" UUID: type: string format: uuid - description: A universally unique identifier + description: A universally unique identifier. + example: "123e4567-e89b-12d3-a456-426614174000" User: type: object - description: Could be any string, not necessarily a UUID + description: Could be any string, not necessarily a UUID. properties: id: type: string - description: User id + description: User id. + example: "user123" name: type: string - description: User name + description: User name. + example: "John Doe" SortOrder: type: string enum: - 'asc' - 'desc' + description: The order in which results are sorted. + example: "asc" ScreenContext: - description: User screen context + description: User screen context. type: object properties: timeZone: - description: The local timezone of the user + description: The local timezone of the user. + type: string + example: "America/New_York" + + BulkCrudActionSummary: + type: object + properties: + failed: + type: integer + description: The number of failed actions. + example: 0 + skipped: + type: integer + description: The number of skipped actions. + example: 1 + succeeded: + type: integer + description: The number of successfully performed actions. + example: 10 + total: + type: integer + description: The total number of actions attempted. + example: 12 + required: + - failed + - skipped + - succeeded + - total + + BulkActionBase: + x-inline: true + type: object + properties: + query: + type: string + description: Query to filter the bulk action. + example: "status: 'inactive'" + ids: + type: array + description: Array of IDs to apply the action to. + minItems: 1 + items: + type: string + example: + - "1234" + - "5678" + + PromptIds: + description: User screen context. + type: object + required: + - promptId + - promptGroupId + properties: + promptId: + type: string + description: The unique identifier for a specific prompt. + example: "chatTitle" + promptGroupId: type: string + description: The unique identifier for a group of prompts. + example: "aiAssistant" diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts index 6a35bd91378de..e25965e9d63a9 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts @@ -24,7 +24,7 @@ export type AppendConversationMessageRequestParams = z.infer< >; export const AppendConversationMessageRequestParams = z.object({ /** - * The conversation's `id` value. + * The unique identifier (`id`) of the conversation to which the message will be appended. */ id: NonEmptyString, }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml index 0d9dccfa0550c..a21cb9cf3b9d7 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.schema.yaml @@ -8,7 +8,7 @@ paths: x-codegen-enabled: true x-labels: [ess, serverless] operationId: AppendConversationMessage - description: Append a message to the conversation + description: This endpoint allows you to append a new message to an existing conversation. The message will be added to the specified conversation identified by its unique `id`. summary: Append a message to the conversation tags: - Conversation API @@ -16,9 +16,10 @@ paths: - name: id in: path required: true - description: The conversation's `id` value. + description: The unique identifier (`id`) of the conversation to which the message will be appended. schema: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "abc123" requestBody: required: true content: @@ -27,13 +28,27 @@ paths: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationMessageCreateProps' responses: 200: - description: Indicates a successful call. + description: Indicates a successful call and the message has been appended to the conversation. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + examples: + success: + value: + id: "abc123" + title: "Security Issue" + messages: + - id: "msg1" + content: "This is the first message." + sender_id: "admin" + timestamp: "2025-05-01T12:00:00Z" + - id: "msg2" + content: "This is a follow-up message." + sender_id: "user123" + timestamp: "2025-05-01T12:05:00Z" 400: - description: Generic Error + description: Generic Error, indicating an issue with the request (e.g., invalid message format, missing required fields). content: application/json: schema: @@ -41,7 +56,13 @@ paths: properties: statusCode: type: number + description: The HTTP status code for the error. + example: 400 error: type: string + description: A short error message. + example: "Bad Request" message: type: string + description: A detailed error message providing more information about the failure. + example: "The message content is missing." diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts index b26ae9d9d913f..c91ca2a00c6ac 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts @@ -16,59 +16,106 @@ import { z } from '@kbn/zod'; +import { BulkActionBase, BulkCrudActionSummary } from '../common_attributes.gen'; import { ConversationCreateProps, ConversationUpdateProps, ConversationResponse, } from './common_attributes.gen'; +/** + * Reason for skipping a conversation during bulk action. + */ export type ConversationsBulkActionSkipReason = z.infer; export const ConversationsBulkActionSkipReason = z.literal('CONVERSATION_NOT_MODIFIED'); export type ConversationsBulkActionSkipResult = z.infer; export const ConversationsBulkActionSkipResult = z.object({ + /** + * The ID of the conversation that was skipped. + */ id: z.string(), + /** + * The name of the conversation that was skipped. + */ name: z.string().optional(), + /** + * The reason the conversation was skipped. + */ skip_reason: ConversationsBulkActionSkipReason, }); export type ConversationDetailsInError = z.infer; export const ConversationDetailsInError = z.object({ + /** + * The ID of the conversation that encountered an error. + */ id: z.string(), + /** + * The name of the conversation in error. + */ name: z.string().optional(), }); export type NormalizedConversationError = z.infer; export const NormalizedConversationError = z.object({ + /** + * Error message. + */ message: z.string(), + /** + * HTTP status code for the error. + */ status_code: z.number().int(), + /** + * A specific error code identifying the error. + */ err_code: z.string().optional(), + /** + * A list of conversations that caused errors. + */ conversations: z.array(ConversationDetailsInError), }); export type ConversationsBulkCrudActionResults = z.infer; export const ConversationsBulkCrudActionResults = z.object({ + /** + * List of conversations that were successfully updated. + */ updated: z.array(ConversationResponse), + /** + * List of conversations that were successfully created. + */ created: z.array(ConversationResponse), + /** + * List of conversation IDs that were successfully deleted. + */ deleted: z.array(z.string()), + /** + * List of conversations that were skipped during the bulk action. + */ skipped: z.array(ConversationsBulkActionSkipResult), }); -export type BulkCrudActionSummary = z.infer; -export const BulkCrudActionSummary = z.object({ - failed: z.number().int(), - skipped: z.number().int(), - succeeded: z.number().int(), - total: z.number().int(), -}); - export type ConversationsBulkCrudActionResponse = z.infer< typeof ConversationsBulkCrudActionResponse >; export const ConversationsBulkCrudActionResponse = z.object({ + /** + * Indicates whether the bulk action was successful. + */ success: z.boolean().optional(), + /** + * The HTTP status code returned for the bulk action. + */ status_code: z.number().int().optional(), + /** + * A message providing additional details about the bulk action result. + */ message: z.string().optional(), + /** + * The total number of conversations involved in the bulk action. + */ conversations_count: z.number().int().optional(), attributes: z.object({ results: ConversationsBulkCrudActionResults, @@ -77,22 +124,19 @@ export const ConversationsBulkCrudActionResponse = z.object({ }), }); -export type BulkActionBase = z.infer; -export const BulkActionBase = z.object({ +export type PerformBulkActionRequestBody = z.infer; +export const PerformBulkActionRequestBody = z.object({ /** - * Query to filter conversations + * Details of the bulk delete action to apply. */ - query: z.string().optional(), + delete: BulkActionBase.optional(), /** - * Array of conversation IDs + * List of conversations to create in bulk. */ - ids: z.array(z.string()).min(1).optional(), -}); - -export type PerformBulkActionRequestBody = z.infer; -export const PerformBulkActionRequestBody = z.object({ - delete: BulkActionBase.optional(), create: z.array(ConversationCreateProps).optional(), + /** + * List of conversations to update in bulk. + */ update: z.array(ConversationUpdateProps).optional(), }); export type PerformBulkActionRequestBodyInput = z.input; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.schema.yaml index 7517c32b1075b..32fe806d0c4ae 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.schema.yaml @@ -19,24 +19,37 @@ paths: type: object properties: delete: - $ref: '#/components/schemas/BulkActionBase' + $ref: '../common_attributes.schema.yaml#/components/schemas/BulkActionBase' + description: Details of the bulk delete action to apply. create: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationCreateProps' + description: List of conversations to create in bulk. update: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationUpdateProps' + description: List of conversations to update in bulk. + example: + delete: + query: "status: 'inactive'" + create: + - title: "New Security Issue" + description: "A description of the new issue" + update: + - id: "1234" + title: "Updated Security Issue" + description: "Updated description" responses: 200: - description: Indicates a successful call. + description: Indicates a successful bulk action. content: application/json: schema: $ref: '#/components/schemas/ConversationsBulkCrudActionResponse' 400: - description: Generic Error + description: Generic Error indicating a problem with the bulk action request. content: application/json: schema: @@ -44,10 +57,13 @@ paths: properties: statusCode: type: number + example: 400 error: type: string + example: "Bad Request" message: type: string + example: "Invalid query or missing conversation IDs." components: schemas: @@ -55,16 +71,24 @@ components: type: string enum: - CONVERSATION_NOT_MODIFIED + description: Reason for skipping a conversation during bulk action. + example: "CONVERSATION_NOT_MODIFIED" ConversationsBulkActionSkipResult: type: object properties: id: type: string + description: The ID of the conversation that was skipped. + example: "abcd1234" name: type: string + description: The name of the conversation that was skipped. + example: "Security Issue" skip_reason: $ref: '#/components/schemas/ConversationsBulkActionSkipReason' + description: The reason the conversation was skipped. + example: "CONVERSATION_NOT_MODIFIED" required: - id - skip_reason @@ -74,8 +98,12 @@ components: properties: id: type: string + description: The ID of the conversation that encountered an error. + example: "xyz9876" name: type: string + description: The name of the conversation in error. + example: "Database Issue" required: - id @@ -84,14 +112,21 @@ components: properties: message: type: string + description: Error message. + example: "Unable to update conversation due to missing fields." status_code: type: integer + description: HTTP status code for the error. + example: 400 err_code: type: string + description: A specific error code identifying the error. + example: "BAD_REQUEST" conversations: type: array items: $ref: '#/components/schemas/ConversationDetailsInError' + description: A list of conversations that caused errors. required: - message - status_code @@ -104,59 +139,54 @@ components: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + description: List of conversations that were successfully updated. created: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + description: List of conversations that were successfully created. deleted: type: array items: type: string + description: List of conversation IDs that were successfully deleted. skipped: type: array items: $ref: '#/components/schemas/ConversationsBulkActionSkipResult' + description: List of conversations that were skipped during the bulk action. required: - updated - created - deleted - skipped - BulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - ConversationsBulkCrudActionResponse: type: object properties: success: type: boolean + description: Indicates whether the bulk action was successful. + example: true status_code: type: integer + description: The HTTP status code returned for the bulk action. + example: 200 message: type: string + description: A message providing additional details about the bulk action result. + example: "Bulk action successfully completed." conversations_count: type: integer + description: The total number of conversations involved in the bulk action. + example: 12 attributes: type: object properties: results: $ref: '#/components/schemas/ConversationsBulkCrudActionResults' summary: - $ref: '#/components/schemas/BulkCrudActionSummary' + $ref: '../common_attributes.schema.yaml#/components/schemas/BulkCrudActionSummary' errors: type: array items: @@ -166,18 +196,3 @@ components: - summary required: - attributes - - - BulkActionBase: - x-inline: true - type: object - properties: - query: - type: string - description: Query to filter conversations - ids: - type: array - description: Array of conversation IDs - minItems: 1 - items: - type: string diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts index 5ab44916e0204..c57f0c29ddd38 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts @@ -16,10 +16,10 @@ import { z } from '@kbn/zod'; -import { NonEmptyString, User } from '../common_attributes.gen'; +import { NonEmptyTimestamp, NonEmptyString, User } from '../common_attributes.gen'; /** - * trace Data + * Trace Data */ export type TraceData = z.infer; export const TraceData = z.object({ @@ -173,13 +173,13 @@ export const ContentReferences = z export type MessageMetadata = z.infer; export const MessageMetadata = z.object({ /** - * Data refered to by the message content. + * Data referred to by the message content. */ contentReferences: ContentReferences.optional(), }); /** - * Replacements object used to anonymize/deanomymize messsages + * Replacements object used to anonymize/deanonymize messages */ export type Replacements = z.infer; export const Replacements = z.object({}).catchall(z.string()); @@ -239,17 +239,17 @@ export const Message = z.object({ /** * The timestamp message was sent or received. */ - timestamp: NonEmptyString, + timestamp: NonEmptyTimestamp, /** * Is error message. */ isError: z.boolean().optional(), /** - * trace Data + * Trace data */ traceData: TraceData.optional(), /** - * metadata + * Metadata */ metadata: MessageMetadata.optional(), }); @@ -257,15 +257,15 @@ export const Message = z.object({ export type ApiConfig = z.infer; export const ApiConfig = z.object({ /** - * connector id + * Connector ID */ connectorId: z.string(), /** - * action type id + * Action type ID */ actionTypeId: z.string(), /** - * defaultSystemPromptId + * Default system prompt ID */ defaultSystemPromptId: z.string().optional(), /** @@ -273,7 +273,7 @@ export const ApiConfig = z.object({ */ provider: Provider.optional(), /** - * model + * Model */ model: z.string().optional(), }); @@ -287,7 +287,7 @@ export const ConversationSummary = z.object({ /** * The timestamp summary was updated. */ - timestamp: NonEmptyString.optional(), + timestamp: NonEmptyTimestamp.optional(), /** * Define if summary is marked as publicly available. */ @@ -321,7 +321,7 @@ export const ConversationResponse = z.object({ */ category: ConversationCategory, summary: ConversationSummary.optional(), - timestamp: NonEmptyString.optional(), + timestamp: NonEmptyTimestamp.optional(), /** * The last time conversation was updated. */ @@ -341,7 +341,7 @@ export const ConversationResponse = z.object({ */ apiConfig: ApiConfig.optional(), /** - * excludeFromLastConversationStorage. + * Exclude from last conversation storage. */ excludeFromLastConversationStorage: z.boolean().optional(), /** @@ -371,7 +371,7 @@ export const ConversationUpdateProps = z.object({ apiConfig: ApiConfig.optional(), summary: ConversationSummary.optional(), /** - * excludeFromLastConversationStorage. + * Exclude from last conversation storage. */ excludeFromLastConversationStorage: z.boolean().optional(), replacements: Replacements.optional(), @@ -400,7 +400,7 @@ export const ConversationCreateProps = z.object({ */ apiConfig: ApiConfig.optional(), /** - * excludeFromLastConversationStorage. + * Exclude from last conversation storage. */ excludeFromLastConversationStorage: z.boolean().optional(), replacements: Replacements.optional(), diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.schema.yaml index c0be31b3d48ec..3909c32ae22dd 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.schema.yaml @@ -9,14 +9,16 @@ components: TraceData: type: object - description: trace Data + description: Trace Data properties: transactionId: type: string description: Could be any string, not necessarily a UUID + example: 'a1234567-bc89-0def-1234-56789abcdef0' traceId: type: string description: Could be any string, not necessarily a UUID + example: 'd9876543-f0a1-2345-6789-abcdef123456' BaseContentReference: type: object @@ -25,12 +27,14 @@ components: - 'id' - 'type' properties: - id: + id: type: string description: Id of the content reference - type: + example: 'content123' + type: type: string description: Type of the content reference + example: 'SecurityAlert' KnowledgeBaseEntryContentReference: description: References a knowledge base entry @@ -42,15 +46,18 @@ components: - 'knowledgeBaseEntryId' - 'knowledgeBaseEntryName' properties: - type: + type: type: string enum: [KnowledgeBaseEntry] + example: 'KnowledgeBaseEntry' knowledgeBaseEntryId: description: Id of the Knowledge Base Entry type: string + example: 'kbentry456' knowledgeBaseEntryName: description: Name of the knowledge base entry type: string + example: 'Network Security Best Practices' EsqlContentReference: description: References an ESQL query @@ -62,26 +69,31 @@ components: - 'query' - 'label' properties: - type: + type: type: string enum: [EsqlQuery] + example: 'EsqlQuery' query: description: An ESQL query type: string + example: 'SELECT * FROM alerts WHERE severity = "high"' label: description: Label of the query type: string + example: 'High Severity Alerts' timerange: - description: Time range to select in the time picker. - type: object - required: - - 'from' - - 'to' - properties: - from: - type: string - to: - type: string + description: Time range to select in the time picker. + type: object + required: + - 'from' + - 'to' + properties: + from: + type: string + example: '2025-04-01T00:00:00Z' + to: + type: string + example: '2025-04-30T23:59:59Z' SecurityAlertContentReference: description: References a security alert @@ -92,12 +104,14 @@ components: - 'type' - 'alertId' properties: - type: + type: type: string enum: [SecurityAlert] + example: 'SecurityAlert' alertId: description: ID of the Alert type: string + example: 'alert789' SecurityAlertsPageContentReference: description: References the security alerts page @@ -107,13 +121,14 @@ components: required: - 'type' properties: - type: + type: type: string enum: [SecurityAlertsPage] + example: 'SecurityAlertsPage' ProductDocumentationContentReference: - description: References the product documentation - allOf: + description: References the product documentation + allOf: - $ref: '#/components/schemas/BaseContentReference' - type: object required: @@ -121,15 +136,18 @@ components: - 'title' - 'url' properties: - type: + type: type: string enum: [ProductDocumentation] + example: 'ProductDocumentation' title: description: Title of the documentation type: string + example: 'Getting Started with Security AI Assistant' url: description: URL to the documentation type: string + example: 'https://docs.example.com/security-ai-assistant' ContentReference: description: A content reference @@ -157,15 +175,15 @@ components: type: object description: Message metadata properties: - contentReferences: + contentReferences: $ref: '#/components/schemas/ContentReferences' - description: Data refered to by the message content. + description: Data referred to by the message content. Replacements: type: object additionalProperties: type: string - description: Replacements object used to anonymize/deanomymize messsages + description: Replacements object used to anonymize/deanonymize messages Reader: type: object @@ -178,6 +196,7 @@ components: - OpenAI - Azure OpenAI - Other + example: 'OpenAI' MessageRole: type: string @@ -186,6 +205,7 @@ components: - system - user - assistant + example: 'assistant' ConversationCategory: type: string @@ -193,6 +213,7 @@ components: enum: - assistant - insights + example: 'assistant' ConversationConfidence: type: string @@ -201,6 +222,7 @@ components: - low - medium - high + example: 'high' Message: type: object @@ -213,24 +235,28 @@ components: content: type: string description: Message content. + example: 'Hello, how can I assist you today?' reader: $ref: '#/components/schemas/Reader' description: Message content. role: $ref: '#/components/schemas/MessageRole' description: Message role. + example: 'assistant' timestamp: - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' description: The timestamp message was sent or received. + example: '2025-04-30T15:30:00Z' isError: type: boolean description: Is error message. + example: false traceData: $ref: '#/components/schemas/TraceData' - description: trace Data + description: Trace data metadata: $ref: '#/components/schemas/MessageMetadata' - description: metadata + description: Metadata ApiConfig: type: object @@ -240,19 +266,24 @@ components: properties: connectorId: type: string - description: connector id + description: Connector ID + example: 'connector123' actionTypeId: type: string - description: action type id + description: Action type ID + example: 'actionType456' defaultSystemPromptId: type: string - description: defaultSystemPromptId + description: Default system prompt ID + example: 'systemPrompt001' provider: $ref: '#/components/schemas/Provider' description: Provider + example: 'OpenAI' model: type: string - description: model + description: Model + example: 'gpt-4' ConversationSummary: type: object @@ -260,15 +291,19 @@ components: content: type: string description: Summary text of the conversation over time. + example: 'This conversation covered how to configure the Security AI Assistant.' timestamp: - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' description: The timestamp summary was updated. + example: '2025-04-30T16:00:00Z' public: type: boolean description: Define if summary is marked as publicly available. + example: true confidence: $ref: '#/components/schemas/ConversationConfidence' description: How confident you are about this being a correct and useful learning. + example: 'high' ErrorSchema: type: object @@ -287,8 +322,10 @@ components: status_code: type: integer minimum: 400 + example: 404 message: type: string + example: 'Resource not found' ConversationResponse: type: object @@ -305,19 +342,23 @@ components: title: type: string description: The conversation title. + example: 'Security AI Assistant Setup' category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: 'assistant' summary: $ref: '#/components/schemas/ConversationSummary' - 'timestamp': - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + timestamp: + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' updatedAt: description: The last time conversation was updated. type: string + example: '2025-04-30T16:30:00Z' createdAt: description: The time conversation was created. type: string + example: '2025-04-30T14:00:00Z' replacements: $ref: '#/components/schemas/Replacements' users: @@ -327,17 +368,18 @@ components: messages: type: array items: - $ref: '#/components/schemas/Message' + $ref: '#/components/schemas/Message' description: The conversation messages. apiConfig: $ref: '#/components/schemas/ApiConfig' description: LLM API configuration. excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean namespace: type: string description: Kibana space + example: 'default' ConversationUpdateProps: type: object @@ -349,13 +391,15 @@ components: title: type: string description: The conversation title. + example: 'Updated Security AI Assistant Setup' category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: 'assistant' messages: type: array items: - $ref: '#/components/schemas/Message' + $ref: '#/components/schemas/Message' description: The conversation messages. apiConfig: $ref: '#/components/schemas/ApiConfig' @@ -363,7 +407,7 @@ components: summary: $ref: '#/components/schemas/ConversationSummary' excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean replacements: $ref: '#/components/schemas/Replacements' @@ -376,22 +420,25 @@ components: id: type: string description: The conversation id. + example: 'conversation123' title: type: string description: The conversation title. + example: 'Security AI Assistant Setup' category: $ref: '#/components/schemas/ConversationCategory' description: The conversation category. + example: 'assistant' messages: type: array items: - $ref: '#/components/schemas/Message' + $ref: '#/components/schemas/Message' description: The conversation messages. apiConfig: $ref: '#/components/schemas/ApiConfig' description: LLM API configuration. excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + description: Exclude from last conversation storage. type: boolean replacements: $ref: '#/components/schemas/Replacements' @@ -404,6 +451,5 @@ components: messages: type: array items: - $ref: '#/components/schemas/Message' + $ref: '#/components/schemas/Message' description: The conversation messages. - diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts index 8fd92c41f1a51..9ef4cd5b5cb7b 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts @@ -45,7 +45,7 @@ export const DeleteConversationResponse = ConversationResponse; export type ReadConversationRequestParams = z.infer; export const ReadConversationRequestParams = z.object({ /** - * The conversation's `id` value. + * The conversation's `id` value, a unique identifier for the conversation. */ id: NonEmptyString, }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml index f644599cdb229..d917192c444bc 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml @@ -8,7 +8,7 @@ paths: x-codegen-enabled: true x-labels: [ess, serverless] operationId: CreateConversation - description: Create a new Security AI Assistant conversation. + description: Create a new Security AI Assistant conversation. This endpoint allows the user to initiate a conversation with the Security AI Assistant by providing the required parameters. summary: Create a conversation tags: - Conversation API @@ -18,15 +18,45 @@ paths: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationCreateProps' + example: + title: "Security Discussion" + category: "assistant" + messages: + - content: "Hello, how can I assist you today?" + role: "system" + timestamp: "2023-10-31T12:00:00Z" + apiConfig: + connectorId: "12345" + actionTypeId: "67890" + replacements: {} + excludeFromLastConversationStorage: false responses: 200: - description: Indicates a successful call. + description: Indicates a successful call. The conversation was created successfully. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + example: + id: "abc123" + title: "Security Discussion" + category: "assistant" + createdAt: "2023-10-31T12:01:00Z" + updatedAt: "2023-10-31T12:01:00Z" + users: + - id: "user1" + name: "John Doe" + messages: + - content: "Hello, how can I assist you today?" + role: "system" + timestamp: "2023-10-31T12:00:00Z" + apiConfig: + connectorId: "12345" + actionTypeId: "67890" + replacements: {} + excludeFromLastConversationStorage: false 400: - description: Generic Error + description: Generic Error. This response indicates an issue with the request, such as missing required parameters or incorrect data. content: application/json: schema: @@ -34,17 +64,20 @@ paths: properties: statusCode: type: number + example: 400 error: type: string + example: "Bad Request" message: type: string + example: "Missing required parameter: title" /api/security_ai_assistant/current_user/conversations/{id}: get: x-codegen-enabled: true x-labels: [ess, serverless] operationId: ReadConversation - description: Get the details of an existing conversation using the conversation ID. + description: Get the details of an existing conversation using the conversation ID. This allows users to fetch the specific conversation data by its unique ID. summary: Get a conversation tags: - Conversations API @@ -52,18 +85,37 @@ paths: - name: id in: path required: true - description: The conversation's `id` value. + description: The conversation's `id` value, a unique identifier for the conversation. schema: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "abc123" responses: 200: - description: Indicates a successful call. + description: Indicates a successful call. The conversation details are returned. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + example: + id: "abc123" + title: "Security Discussion" + category: "assistant" + createdAt: "2023-10-31T12:01:00Z" + updatedAt: "2023-10-31T12:01:00Z" + users: + - id: "user1" + name: "John Doe" + messages: + - content: "Hello, how can I assist you today?" + role: "system" + timestamp: "2023-10-31T12:00:00Z" + apiConfig: + connectorId: "12345" + actionTypeId: "67890" + replacements: {} + excludeFromLastConversationStorage: false 400: - description: Generic Error + description: Generic Error. The request could not be processed due to an error. content: application/json: schema: @@ -71,15 +123,19 @@ paths: properties: statusCode: type: number + example: 400 error: type: string + example: "Bad Request" message: type: string + example: "Invalid conversation ID" + put: x-codegen-enabled: true x-labels: [ess, serverless] operationId: UpdateConversation - description: Update an existing conversation using the conversation ID. + description: Update an existing conversation using the conversation ID. This endpoint allows users to modify the details of an existing conversation. summary: Update a conversation tags: - Conversation API @@ -90,21 +146,52 @@ paths: description: The conversation's `id` value. schema: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "abc123" requestBody: required: true content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationUpdateProps' + example: + title: "Updated Security Discussion" + category: "insights" + messages: + - content: "The issue was resolved." + role: "assistant" + timestamp: "2023-10-31T12:30:00Z" + apiConfig: + connectorId: "54321" + actionTypeId: "09876" + replacements: {} + excludeFromLastConversationStorage: true responses: 200: - description: Indicates a successful call. + description: Indicates a successful call. The conversation was updated successfully. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + example: + id: "abc123" + title: "Updated Security Discussion" + category: "insights" + createdAt: "2023-10-31T12:01:00Z" + updatedAt: "2023-10-31T12:31:00Z" + users: + - id: "user1" + name: "John Doe" + messages: + - content: "The issue was resolved." + role: "assistant" + timestamp: "2023-10-31T12:30:00Z" + apiConfig: + connectorId: "54321" + actionTypeId: "09876" + replacements: {} + excludeFromLastConversationStorage: true 400: - description: Generic Error + description: Generic Error. This response indicates an issue with the request, such as missing required parameters or incorrect data. content: application/json: schema: @@ -112,15 +199,19 @@ paths: properties: statusCode: type: number + example: 400 error: type: string + example: "Bad Request" message: type: string + example: "Missing required field: title" + delete: x-codegen-enabled: true x-labels: [ess, serverless] operationId: DeleteConversation - description: Delete an existing conversation using the conversation ID. + description: Delete an existing conversation using the conversation ID. This endpoint allows users to permanently delete a conversation. summary: Delete a conversation tags: - Conversation API @@ -131,15 +222,34 @@ paths: description: The conversation's `id` value. schema: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "abc123" responses: 200: - description: Indicates a successful call. + description: Indicates a successful call. The conversation was deleted successfully. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' + example: + id: "abc123" + title: "Deleted Security Discussion" + category: "assistant" + createdAt: "2023-10-31T12:01:00Z" + updatedAt: "2023-10-31T12:01:00Z" + users: + - id: "user1" + name: "John Doe" + messages: + - content: "The conversation has been deleted." + role: "system" + timestamp: "2023-10-31T12:35:00Z" + apiConfig: + connectorId: "12345" + actionTypeId: "67890" + replacements: {} + excludeFromLastConversationStorage: false 400: - description: Generic Error + description: Generic Error. This response indicates an issue with the request. content: application/json: schema: @@ -147,7 +257,10 @@ paths: properties: statusCode: type: number + example: 400 error: type: string + example: "Bad Request" message: type: string + example: "Invalid conversation ID" diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts index 7354722ba6e38..39826ed17d3ed 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts @@ -20,6 +20,9 @@ import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../common_attributes.gen'; import { ConversationResponse } from './common_attributes.gen'; +/** + * The field by which to sort the conversations. Possible values are `created_at`, `title`, and `updated_at`. + */ export type FindConversationsSortField = z.infer; export const FindConversationsSortField = z.enum(['created_at', 'title', 'updated_at']); export type FindConversationsSortFieldEnum = typeof FindConversationsSortField.enum; @@ -27,25 +30,28 @@ export const FindConversationsSortFieldEnum = FindConversationsSortField.enum; export type FindConversationsRequestQuery = z.infer; export const FindConversationsRequestQuery = z.object({ + /** + * A list of fields to include in the response. If omitted, all fields are returned. + */ fields: ArrayFromString(z.string()).optional(), /** - * Search query + * A search query to filter the conversations. Can match against titles, messages, or other conversation attributes. */ filter: z.string().optional(), /** - * Field to sort by + * The field by which to sort the results. Valid fields are `created_at`, `title`, and `updated_at`. */ sort_field: FindConversationsSortField.optional(), /** - * Sort order + * The order in which to sort the results. Can be either `asc` for ascending or `desc` for descending. */ sort_order: SortOrder.optional(), /** - * Page number + * The page number of the results to retrieve. Default is 1. */ page: z.coerce.number().int().min(1).optional().default(1), /** - * Conversations per page + * The number of conversations to return per page. Default is 20. */ per_page: z.coerce.number().int().min(0).optional().default(20), }); @@ -53,8 +59,20 @@ export type FindConversationsRequestQueryInput = z.input; export const FindConversationsResponse = z.object({ + /** + * The current page of the results. + */ page: z.number().int(), + /** + * The number of results returned per page. + */ perPage: z.number().int(), + /** + * The total number of conversations matching the filter criteria. + */ total: z.number().int(), + /** + * A list of conversations. + */ data: z.array(ConversationResponse), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml index ccf2bd8e9cafe..c42d0f5290c31 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml @@ -8,7 +8,7 @@ paths: x-codegen-enabled: true x-labels: [ess, serverless] operationId: FindConversations - description: Get a list of all conversations for the current user. + description: Get a list of all conversations for the current user. This endpoint allows users to search, filter, sort, and paginate through their conversations. summary: Get conversations tags: - Conversations API @@ -16,48 +16,55 @@ paths: - name: 'fields' in: query required: false + description: A list of fields to include in the response. If omitted, all fields are returned. schema: type: array items: type: string + example: ["id", "title", "createdAt"] - name: 'filter' in: query - description: Search query + description: A search query to filter the conversations. Can match against titles, messages, or other conversation attributes. required: false schema: type: string + example: "Security Issue" - name: 'sort_field' in: query - description: Field to sort by + description: The field by which to sort the results. Valid fields are `created_at`, `title`, and `updated_at`. required: false schema: $ref: '#/components/schemas/FindConversationsSortField' + example: "created_at" - name: 'sort_order' in: query - description: Sort order + description: The order in which to sort the results. Can be either `asc` for ascending or `desc` for descending. required: false schema: $ref: '../common_attributes.schema.yaml#/components/schemas/SortOrder' + example: "desc" - name: 'page' in: query - description: Page number + description: The page number of the results to retrieve. Default is 1. required: false schema: type: integer minimum: 1 default: 1 + example: 1 - name: 'per_page' in: query - description: Conversations per page + description: The number of conversations to return per page. Default is 20. required: false schema: type: integer minimum: 0 default: 20 + example: 20 responses: 200: - description: Successful response + description: Successful response, returns a paginated list of conversations matching the specified criteria. content: application/json: schema: @@ -65,12 +72,19 @@ paths: properties: page: type: integer + description: The current page of the results. + example: 1 perPage: type: integer + description: The number of results returned per page. + example: 20 total: type: integer + description: The total number of conversations matching the filter criteria. + example: 100 data: type: array + description: A list of conversations. items: $ref: './common_attributes.schema.yaml#/components/schemas/ConversationResponse' required: @@ -79,7 +93,7 @@ paths: - total - data 400: - description: Generic Error + description: Generic Error. The request could not be processed due to an invalid query parameter or other issue. content: application/json: schema: @@ -87,16 +101,21 @@ paths: properties: statusCode: type: number + example: 400 error: type: string + example: "Bad Request" message: type: string + example: "Invalid filter query parameter" components: schemas: FindConversationsSortField: type: string + description: The field by which to sort the conversations. Possible values are `created_at`, `title`, and `updated_at`. enum: - 'created_at' - 'title' - 'updated_at' + example: "created_at" diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts index e070c3129e192..32f3a0c202071 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts @@ -16,7 +16,7 @@ import { z } from '@kbn/zod'; -import { NonEmptyString, User } from '../common_attributes.gen'; +import { NonEmptyString, NonEmptyTimestamp, User } from '../common_attributes.gen'; import { Replacements, ApiConfig } from '../conversations/common_attributes.gen'; /** @@ -93,7 +93,7 @@ export const DefendInsightGenerationInterval = z.object({ export type DefendInsightsResponse = z.infer; export const DefendInsightsResponse = z.object({ id: NonEmptyString, - timestamp: NonEmptyString.optional(), + timestamp: NonEmptyTimestamp.optional(), /** * The last time the Defend insight was updated. */ diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.schema.yaml index 5c27449c7d346..8a6266eda589a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.schema.yaml @@ -73,7 +73,7 @@ components: id: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' 'timestamp': - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' updatedAt: description: The last time the Defend insight was updated. type: string diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/index.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/index.ts index 4efe579e8dd2d..2ee06eb1b0142 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/index.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/index.ts @@ -66,5 +66,10 @@ export * from './knowledge_base/entries/common_attributes.gen'; export * from './knowledge_base/entries/crud_knowledge_base_entries_route.gen'; export * from './knowledge_base/entries/find_knowledge_base_entries_route.gen'; +export * from './anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +export * from './anonymization_fields/find_anonymization_fields_route.gen'; + +export * from './prompts/bulk_crud_prompts_route.gen'; export * from './prompts/find_prompts_route.gen'; + export { PromptResponse, PromptTypeEnum } from './prompts/bulk_crud_prompts_route.gen'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts index f22089412d3a7..73807c7876a9a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts @@ -31,11 +31,11 @@ export const KnowledgeBaseResponse = z.object({ export type CreateKnowledgeBaseRequestQuery = z.infer; export const CreateKnowledgeBaseRequestQuery = z.object({ /** - * Optional ELSER modelId to use when setting up the Knowledge Base + * ELSER modelId to use when setting up the Knowledge Base. If not provided, a default model will be used. */ modelId: z.string().optional(), /** - * Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base + * Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base. Defaults to `false`. */ ignoreSecurityLabs: BooleanFromString.optional().default(false), }); @@ -66,10 +66,28 @@ export type ReadKnowledgeBaseRequestParamsInput = z.input; export const ReadKnowledgeBaseResponse = z.object({ + /** + * Indicates if the ELSER model exists for the KnowledgeBase. + */ elser_exists: z.boolean().optional(), + /** + * Indicates if the setup process is available for the KnowledgeBase. + */ is_setup_available: z.boolean().optional(), + /** + * Indicates if the setup process is currently in progress. + */ is_setup_in_progress: z.boolean().optional(), + /** + * Indicates if Security Labs documentation exists in the KnowledgeBase. + */ security_labs_exists: z.boolean().optional(), + /** + * Indicates if user data exists in the KnowledgeBase. + */ user_data_exists: z.boolean().optional(), + /** + * The status of the product documentation in the KnowledgeBase. + */ product_documentation_status: z.string().optional(), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml index 9320d175e9205..d3f790e8f9045 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml @@ -18,19 +18,22 @@ paths: description: The KnowledgeBase `resource` value. schema: type: string + example: "kb12345" - name: modelId in: query - description: Optional ELSER modelId to use when setting up the Knowledge Base + description: ELSER modelId to use when setting up the Knowledge Base. If not provided, a default model will be used. required: false schema: type: string + example: "elser-model-001" - name: ignoreSecurityLabs in: query - description: Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base + description: Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base. Defaults to `false`. required: false schema: type: boolean default: false + example: true responses: 200: description: Indicates a successful call. @@ -47,10 +50,16 @@ paths: properties: statusCode: type: number + description: The HTTP status code of the error. + example: 400 error: type: string + description: A short description of the error. + example: "Bad Request" message: type: string + description: A detailed error message. + example: "Invalid resource ID provided." get: x-codegen-enabled: true x-labels: [ess, serverless] @@ -65,6 +74,7 @@ paths: description: The KnowledgeBase `resource` value. schema: type: string + example: "kb12345" responses: 200: description: Indicates a successful call. @@ -75,16 +85,28 @@ paths: properties: elser_exists: type: boolean + description: Indicates if the ELSER model exists for the KnowledgeBase. + example: true is_setup_available: type: boolean + description: Indicates if the setup process is available for the KnowledgeBase. + example: true is_setup_in_progress: type: boolean + description: Indicates if the setup process is currently in progress. + example: false security_labs_exists: type: boolean + description: Indicates if Security Labs documentation exists in the KnowledgeBase. + example: true user_data_exists: type: boolean + description: Indicates if user data exists in the KnowledgeBase. + example: false product_documentation_status: type: string + description: The status of the product documentation in the KnowledgeBase. + example: "complete" 400: description: Generic Error content: @@ -94,10 +116,16 @@ paths: properties: statusCode: type: number + description: The HTTP status code of the error. + example: 400 error: type: string + description: A short description of the error. + example: "Bad Request" message: type: string + description: A detailed error message. + example: "Invalid resource ID provided." components: schemas: @@ -108,3 +136,4 @@ components: success: type: boolean description: Identify the success of the method execution. + example: true diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts index 631b8c27a6387..37d3f663e49fd 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts @@ -22,6 +22,9 @@ import { KnowledgeBaseEntryResponse, } from './common_attributes.gen'; +/** + * Reason why a Knowledge Base Entry was skipped during the bulk action. + */ export type KnowledgeBaseEntryBulkActionSkipReason = z.infer< typeof KnowledgeBaseEntryBulkActionSkipReason >; @@ -33,22 +36,46 @@ export type KnowledgeBaseEntryBulkActionSkipResult = z.infer< typeof KnowledgeBaseEntryBulkActionSkipResult >; export const KnowledgeBaseEntryBulkActionSkipResult = z.object({ + /** + * ID of the skipped Knowledge Base Entry. + */ id: z.string(), + /** + * Name of the skipped Knowledge Base Entry. + */ name: z.string().optional(), skip_reason: KnowledgeBaseEntryBulkActionSkipReason, }); export type KnowledgeBaseEntryDetailsInError = z.infer; export const KnowledgeBaseEntryDetailsInError = z.object({ + /** + * ID of the Knowledge Base Entry that encountered an error. + */ id: z.string(), + /** + * Name of the Knowledge Base Entry that encountered an error. + */ name: z.string().optional(), }); export type NormalizedKnowledgeBaseEntryError = z.infer; export const NormalizedKnowledgeBaseEntryError = z.object({ + /** + * Error message describing the issue. + */ message: z.string(), + /** + * HTTP status code associated with the error. + */ statusCode: z.number().int(), + /** + * Specific error code for the issue. + */ err_code: z.string().optional(), + /** + * List of Knowledge Base Entries that encountered the error. + */ knowledgeBaseEntries: z.array(KnowledgeBaseEntryDetailsInError), }); @@ -56,9 +83,21 @@ export type KnowledgeBaseEntryBulkCrudActionResults = z.infer< typeof KnowledgeBaseEntryBulkCrudActionResults >; export const KnowledgeBaseEntryBulkCrudActionResults = z.object({ + /** + * List of Knowledge Base Entries that were successfully updated. + */ updated: z.array(KnowledgeBaseEntryResponse), + /** + * List of Knowledge Base Entries that were successfully created. + */ created: z.array(KnowledgeBaseEntryResponse), + /** + * List of IDs of Knowledge Base Entries that were successfully deleted. + */ deleted: z.array(z.string()), + /** + * List of Knowledge Base Entries that were skipped during the bulk action. + */ skipped: z.array(KnowledgeBaseEntryBulkActionSkipResult), }); @@ -66,9 +105,21 @@ export type KnowledgeBaseEntryBulkCrudActionSummary = z.infer< typeof KnowledgeBaseEntryBulkCrudActionSummary >; export const KnowledgeBaseEntryBulkCrudActionSummary = z.object({ + /** + * Number of Knowledge Base Entries that failed during the bulk action. + */ failed: z.number().int(), + /** + * Number of Knowledge Base Entries that were skipped during the bulk action. + */ skipped: z.number().int(), + /** + * Number of Knowledge Base Entries that were successfully processed during the bulk action. + */ succeeded: z.number().int(), + /** + * Total number of Knowledge Base Entries involved in the bulk action. + */ total: z.number().int(), }); @@ -76,13 +127,28 @@ export type KnowledgeBaseEntryBulkCrudActionResponse = z.infer< typeof KnowledgeBaseEntryBulkCrudActionResponse >; export const KnowledgeBaseEntryBulkCrudActionResponse = z.object({ + /** + * Indicates whether the bulk action was successful. + */ success: z.boolean().optional(), + /** + * HTTP status code of the response. + */ statusCode: z.number().int().optional(), + /** + * Message describing the result of the bulk action. + */ message: z.string().optional(), + /** + * Total number of Knowledge Base Entries processed. + */ knowledgeBaseEntriesCount: z.number().int().optional(), attributes: z.object({ results: KnowledgeBaseEntryBulkCrudActionResults, summary: KnowledgeBaseEntryBulkCrudActionSummary, + /** + * List of errors encountered during the bulk action. + */ errors: z.array(NormalizedKnowledgeBaseEntryError).optional(), }), }); @@ -90,11 +156,11 @@ export const KnowledgeBaseEntryBulkCrudActionResponse = z.object({ export type KnowledgeBaseEntryBulkActionBase = z.infer; export const KnowledgeBaseEntryBulkActionBase = z.object({ /** - * Query to filter Knowledge Base Entries + * Query to filter Knowledge Base Entries. */ query: z.string().optional(), /** - * Array of Knowledge base Entry IDs + * Array of Knowledge Base Entry IDs. */ ids: z.array(z.string()).min(1).optional(), }); @@ -104,7 +170,13 @@ export type PerformKnowledgeBaseEntryBulkActionRequestBody = z.infer< >; export const PerformKnowledgeBaseEntryBulkActionRequestBody = z.object({ delete: KnowledgeBaseEntryBulkActionBase.optional(), + /** + * List of Knowledge Base Entries to create. + */ create: z.array(KnowledgeBaseEntryCreateProps).optional(), + /** + * List of Knowledge Base Entries to update. + */ update: z.array(KnowledgeBaseEntryUpdateProps).optional(), }); export type PerformKnowledgeBaseEntryBulkActionRequestBodyInput = z.input< diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml index 0688fc5d3faca..a7051c866ad08 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml @@ -9,7 +9,7 @@ paths: x-labels: [ess, serverless] operationId: PerformKnowledgeBaseEntryBulkAction summary: Applies a bulk action to multiple Knowledge Base Entries - description: The bulk action is applied to all Knowledge Base Entries that match the filter or to the list of Knowledge Base Entries by their IDs + description: The bulk action is applied to all Knowledge Base Entries that match the filter or to the list of Knowledge Base Entries by their IDs. tags: - Knowledge Base Entries Bulk API requestBody: @@ -24,10 +24,25 @@ paths: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryCreateProps' + description: List of Knowledge Base Entries to create. + example: [ + { + "title": "New Entry", + "content": "This is the content of the new entry." + } + ] update: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryUpdateProps' + description: List of Knowledge Base Entries to update. + example: [ + { + "id": "123", + "title": "Updated Entry", + "content": "Updated content." + } + ] responses: 200: description: Successful bulk operation request @@ -48,14 +63,19 @@ components: type: string enum: - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + description: Reason why a Knowledge Base Entry was skipped during the bulk action. KnowledgeBaseEntryBulkActionSkipResult: type: object properties: id: type: string + description: ID of the skipped Knowledge Base Entry. + example: "123" name: type: string + description: Name of the skipped Knowledge Base Entry. + example: "Skipped Entry" skip_reason: $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' required: @@ -67,8 +87,12 @@ components: properties: id: type: string + description: ID of the Knowledge Base Entry that encountered an error. + example: "456" name: type: string + description: Name of the Knowledge Base Entry that encountered an error. + example: "Error Entry" required: - id @@ -77,14 +101,21 @@ components: properties: message: type: string + description: Error message describing the issue. + example: "Failed to update entry." statusCode: type: integer + description: HTTP status code associated with the error. + example: 400 err_code: type: string + description: Specific error code for the issue. + example: "UPDATE_FAILED" knowledgeBaseEntries: type: array items: $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' + description: List of Knowledge Base Entries that encountered the error. required: - message - statusCode @@ -97,18 +128,44 @@ components: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' + description: List of Knowledge Base Entries that were successfully updated. + example: [ + { + "id": "123", + "title": "Updated Entry", + "content": "Updated content." + } + ] created: type: array items: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' + description: List of Knowledge Base Entries that were successfully created. + example: [ + { + "id": "456", + "title": "New Entry", + "content": "This is the content of the new entry." + } + ] deleted: type: array items: type: string + description: List of IDs of Knowledge Base Entries that were successfully deleted. + example: ["789"] skipped: type: array items: $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' + description: List of Knowledge Base Entries that were skipped during the bulk action. + example: [ + { + "id": "123", + "name": "Skipped Entry", + "skip_reason": "KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED" + } + ] required: - updated - created @@ -120,12 +177,20 @@ components: properties: failed: type: integer + description: Number of Knowledge Base Entries that failed during the bulk action. + example: 2 skipped: type: integer + description: Number of Knowledge Base Entries that were skipped during the bulk action. + example: 1 succeeded: type: integer + description: Number of Knowledge Base Entries that were successfully processed during the bulk action. + example: 5 total: type: integer + description: Total number of Knowledge Base Entries involved in the bulk action. + example: 8 required: - failed - skipped @@ -137,12 +202,20 @@ components: properties: success: type: boolean + description: Indicates whether the bulk action was successful. + example: true statusCode: type: integer + description: HTTP status code of the response. + example: 200 message: type: string + description: Message describing the result of the bulk action. + example: "Bulk action completed successfully." knowledgeBaseEntriesCount: type: integer + description: Total number of Knowledge Base Entries processed. + example: 8 attributes: type: object properties: @@ -154,23 +227,38 @@ components: type: array items: $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' + description: List of errors encountered during the bulk action. + example: [ + { + "message": "Failed to update entry.", + "statusCode": 400, + "err_code": "UPDATE_FAILED", + "knowledgeBaseEntries": [ + { + "id": "456", + "name": "Error Entry" + } + ] + } + ] required: - results - summary required: - attributes - KnowledgeBaseEntryBulkActionBase: x-inline: true type: object properties: query: type: string - description: Query to filter Knowledge Base Entries + description: Query to filter Knowledge Base Entries. + example: "status:active AND category:technology" ids: type: array - description: Array of Knowledge base Entry IDs + description: Array of Knowledge Base Entry IDs. minItems: 1 items: type: string + example: ["123", "456", "789"] diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts index 96d128d2b76d7..ebf47d33bb4e8 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts @@ -19,21 +19,21 @@ import { z } from '@kbn/zod'; import { User, NonEmptyString } from '../../common_attributes.gen'; /** - * Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval + * Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval. */ export type InputSchema = z.infer; export const InputSchema = z.array( z.object({ /** - * Name of the field + * Name of the field. */ fieldName: z.string(), /** - * Type of the field + * Type of the field. */ fieldType: z.string(), /** - * Description of the field + * Description of the field. */ description: z.string(), }) @@ -42,14 +42,23 @@ export const InputSchema = z.array( export type KnowledgeBaseEntryErrorSchema = z.infer; export const KnowledgeBaseEntryErrorSchema = z .object({ + /** + * HTTP status code of the error. + */ statusCode: z.number(), + /** + * Error type or category. + */ error: z.string(), + /** + * Detailed error message. + */ message: z.string(), }) .strict(); /** - * Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc + * Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc. */ export type KnowledgeBaseResource = z.infer; export const KnowledgeBaseResource = z.enum(['security_labs', 'user']); @@ -57,32 +66,32 @@ export type KnowledgeBaseResourceEnum = typeof KnowledgeBaseResource.enum; export const KnowledgeBaseResourceEnum = KnowledgeBaseResource.enum; /** - * Metadata about a Knowledge Base Entry + * Metadata about a Knowledge Base Entry. */ export type Metadata = z.infer; export const Metadata = z.object({ kbResource: KnowledgeBaseResource, /** - * Source document name or filepath + * Source document name or filepath. */ source: z.string(), /** - * Whether this resource should always be included + * Whether this resource should always be included. */ required: z.boolean(), }); /** - * Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings + * Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings. */ export type Vector = z.infer; export const Vector = z.object({ /** - * ID of the model used to create the embeddings + * ID of the model used to create the embeddings. */ modelId: z.string(), /** - * Tokens with their corresponding values + * Tokens with their corresponding values. */ tokens: z.object({}).catchall(z.number()), }); @@ -90,7 +99,7 @@ export const Vector = z.object({ export type BaseRequiredFields = z.infer; export const BaseRequiredFields = z.object({ /** - * Name of the Knowledge Base Entry + * Name of the Knowledge Base Entry. */ name: z.string(), }); @@ -98,11 +107,11 @@ export const BaseRequiredFields = z.object({ export type BaseDefaultableFields = z.infer; export const BaseDefaultableFields = z.object({ /** - * Kibana Space, defaults to 'default' space + * Kibana Space, defaults to 'default' space. */ namespace: z.string().optional(), /** - * Whether this Knowledge Base Entry is global, defaults to false + * Whether this Knowledge Base Entry is global, defaults to false. */ global: z.boolean().optional(), /** @@ -128,19 +137,19 @@ export type ResponseFields = z.infer; export const ResponseFields = z.object({ id: NonEmptyString, /** - * Time the Knowledge Base Entry was created + * Time the Knowledge Base Entry was created. */ createdAt: z.string(), /** - * User who created the Knowledge Base Entry + * User who created the Knowledge Base Entry. */ createdBy: z.string(), /** - * Time the Knowledge Base Entry was last updated + * Time the Knowledge Base Entry was last updated. */ updatedAt: z.string(), /** - * User who last updated the Knowledge Base Entry + * User who last updated the Knowledge Base Entry. */ updatedBy: z.string(), }); @@ -159,16 +168,16 @@ export const DocumentEntryType = z.literal('document'); export type DocumentEntryRequiredFields = z.infer; export const DocumentEntryRequiredFields = z.object({ /** - * Entry type + * Entry type. */ type: z.literal('document'), kbResource: KnowledgeBaseResource, /** - * Source document name or filepath + * Source document name or filepath. */ source: z.string(), /** - * Knowledge Base Entry content + * Knowledge Base Entry content. */ text: z.string(), }); @@ -176,7 +185,7 @@ export const DocumentEntryRequiredFields = z.object({ export type DocumentEntryOptionalFields = z.infer; export const DocumentEntryOptionalFields = z.object({ /** - * Whether this resource should always be included, defaults to false + * Whether this resource should always be included, defaults to false. */ required: z.boolean().optional(), vector: Vector.optional(), @@ -204,23 +213,23 @@ export const IndexEntryType = z.literal('index'); export type IndexEntryRequiredFields = z.infer; export const IndexEntryRequiredFields = z.object({ /** - * Entry type + * Entry type. */ type: z.literal('index'), /** - * Index or Data Stream to query for Knowledge Base content + * Index or Data Stream to query for Knowledge Base content. */ index: z.string(), /** - * Field to query for Knowledge Base content + * Field to query for Knowledge Base content. */ field: z.string(), /** - * Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description + * Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description. */ description: z.string(), /** - * Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema + * Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema. */ queryDescription: z.string(), }); @@ -229,7 +238,7 @@ export type IndexEntryOptionalFields = z.infer; export const IndexEntryOptionalFields = z.object({ inputSchema: InputSchema.optional(), /** - * Fields to extract from the query result, defaults to all fields if not provided or empty + * Fields to extract from the query result, defaults to all fields if not provided or empty. */ outputFields: z.array(z.string()).optional(), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml index 7ff8395d06cd1..6e40217df21dc 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml @@ -8,7 +8,7 @@ components: schemas: InputSchema: type: array - description: Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval + description: Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval. items: type: object required: @@ -18,13 +18,16 @@ components: properties: fieldName: type: string - description: Name of the field + description: Name of the field. + example: "title" fieldType: type: string - description: Type of the field + description: Type of the field. + example: "string" description: type: string - description: Description of the field + description: Description of the field. + example: "The title of the document." KnowledgeBaseEntryErrorSchema: type: object @@ -36,14 +39,20 @@ components: properties: statusCode: type: number + description: HTTP status code of the error. + example: 404 error: type: string + description: Error type or category. + example: "Not Found" message: type: string + description: Detailed error message. + example: "The requested Knowledge Base Entry was not found." Metadata: type: object - description: Metadata about a Knowledge Base Entry + description: Metadata about a Knowledge Base Entry. required: - "kbResource" - "source" @@ -53,26 +62,30 @@ components: $ref: "#/components/schemas/KnowledgeBaseResource" source: type: string - description: Source document name or filepath + description: Source document name or filepath. + example: "/documents/example.txt" required: type: boolean - description: Whether this resource should always be included + description: Whether this resource should always be included. + example: true Vector: type: object - description: Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings + description: Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings. required: - "modelId" - "tokens" properties: modelId: type: string - description: ID of the model used to create the embeddings + description: ID of the model used to create the embeddings. + example: "bert-base-uncased" tokens: type: object additionalProperties: type: number - description: Tokens with their corresponding values + description: Tokens with their corresponding values. + example: { "token1": 0.123, "token2": 0.456 } ########### # Base Entry @@ -83,7 +96,8 @@ components: properties: name: type: string - description: Name of the Knowledge Base Entry + description: Name of the Knowledge Base Entry. + example: "Example Entry" required: - name @@ -93,10 +107,12 @@ components: properties: namespace: type: string - description: Kibana Space, defaults to 'default' space + description: Kibana Space, defaults to 'default' space. + example: "default" global: type: boolean - description: Whether this Knowledge Base Entry is global, defaults to false + description: Whether this Knowledge Base Entry is global, defaults to false. + example: false users: type: array description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. @@ -134,17 +150,21 @@ components: id: $ref: "../../common_attributes.schema.yaml#/components/schemas/NonEmptyString" createdAt: - description: Time the Knowledge Base Entry was created + description: Time the Knowledge Base Entry was created. type: string + example: "2023-01-01T12:00:00Z" createdBy: - description: User who created the Knowledge Base Entry + description: User who created the Knowledge Base Entry. type: string + example: "admin" updatedAt: - description: Time the Knowledge Base Entry was last updated + description: Time the Knowledge Base Entry was last updated. type: string + example: "2023-01-02T12:00:00Z" updatedBy: - description: User who last updated the Knowledge Base Entry + description: User who last updated the Knowledge Base Entry. type: string + example: "editor" required: - id - createdAt @@ -167,11 +187,12 @@ components: - $ref: "#/components/schemas/ResponseFields" KnowledgeBaseResource: - description: Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc + description: Knowledge Base resource name for grouping entries, e.g. 'security_labs', 'user', etc. type: string enum: - security_labs - user + example: "security_labs" ########### # Document Knowledge Base Entry @@ -180,6 +201,7 @@ components: type: string enum: - document + example: "document" DocumentEntryRequiredFields: type: object @@ -187,16 +209,18 @@ components: type: type: string enum: [document] - description: Entry type + description: Entry type. + example: "document" kbResource: $ref: "#/components/schemas/KnowledgeBaseResource" source: type: string - description: Source document name or filepath + description: Source document name or filepath. + example: "/documents/example.txt" text: type: string - description: Knowledge Base Entry content - + description: Knowledge Base Entry content. + example: "This is the content of the document." required: - type - kbResource @@ -208,7 +232,8 @@ components: properties: required: type: boolean - description: Whether this resource should always be included, defaults to false + description: Whether this resource should always be included, defaults to false. + example: false vector: $ref: "#/components/schemas/Vector" @@ -240,6 +265,7 @@ components: type: string enum: - index + example: "index" IndexEntryRequiredFields: type: object @@ -247,19 +273,24 @@ components: type: type: string enum: [index] - description: Entry type + description: Entry type. + example: "index" index: type: string - description: Index or Data Stream to query for Knowledge Base content + description: Index or Data Stream to query for Knowledge Base content. + example: "knowledge_base_index" field: type: string - description: Field to query for Knowledge Base content + description: Field to query for Knowledge Base content. + example: "content" description: type: string - description: Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description + description: Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description. + example: "Query this index for general knowledge base content." queryDescription: type: string - description: Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema + description: Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema. + example: "Search for documents containing the specified keywords." required: - type - index @@ -274,9 +305,10 @@ components: $ref: "#/components/schemas/InputSchema" outputFields: type: array - description: Fields to extract from the query result, defaults to all fields if not provided or empty + description: Fields to extract from the query result, defaults to all fields if not provided or empty. items: type: string + example: ["title", "author"] IndexEntryCreateFields: allOf: diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts index e4eb006efccaa..9a98770002885 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts @@ -40,7 +40,7 @@ export type DeleteKnowledgeBaseEntryRequestParams = z.infer< >; export const DeleteKnowledgeBaseEntryRequestParams = z.object({ /** - * The Knowledge Base Entry's `id` value + * The unique identifier (`id`) of the Knowledge Base Entry to delete. */ id: NonEmptyString, }); @@ -56,7 +56,7 @@ export type ReadKnowledgeBaseEntryRequestParams = z.infer< >; export const ReadKnowledgeBaseEntryRequestParams = z.object({ /** - * The Knowledge Base Entry's `id` value. + * The unique identifier (`id`) of the Knowledge Base Entry to retrieve. */ id: NonEmptyString, }); @@ -72,7 +72,7 @@ export type UpdateKnowledgeBaseEntryRequestParams = z.infer< >; export const UpdateKnowledgeBaseEntryRequestParams = z.object({ /** - * The Knowledge Base Entry's `id` value + * The unique identifier (`id`) of the Knowledge Base Entry to update. */ id: NonEmptyString, }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml index db2dbf3616b3e..15d13569b0fe9 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml @@ -18,6 +18,10 @@ paths: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryCreateProps' + example: + title: "How to reset a password" + content: "To reset your password, go to the settings page and click 'Reset Password'." + tags: ["password", "reset", "help"] responses: 200: description: Successful request returning Knowledge Base Entries @@ -25,19 +29,27 @@ paths: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' + example: + id: "12345" + title: "How to reset a password" + content: "To reset your password, go to the settings page and click 'Reset Password'." + tags: ["password", "reset", "help"] 400: - description: Generic Error + description: A generic error occurred, such as invalid input or missing required fields. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' + example: + error: "Invalid input" + message: "The 'title' field is required." /api/security_ai_assistant/knowledge_base/entries/{id}: get: x-codegen-enabled: true x-labels: [ess, serverless] operationId: ReadKnowledgeBaseEntry - description: Read a Knowledge Base Entry + description: Retrieve a Knowledge Base Entry by its unique `id`. summary: Read a Knowledge Base Entry tags: - Knowledge Base Entries API @@ -45,27 +57,36 @@ paths: - name: id in: path required: true - description: The Knowledge Base Entry's `id` value. + description: The unique identifier (`id`) of the Knowledge Base Entry to retrieve. schema: $ref: '../../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "12345" responses: 200: - description: Successful request returning a Knowledge Base Entry + description: Successful request returning the requested Knowledge Base Entry. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' + example: + id: "12345" + title: "How to reset a password" + content: "To reset your password, go to the settings page and click 'Reset Password'." + tags: ["password", "reset", "help"] 400: - description: Generic Error + description: A generic error occurred, such as an invalid `id` or the entry not being found. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' + example: + error: "Not Found" + message: "No Knowledge Base Entry found with the provided `id`." put: x-codegen-enabled: true x-labels: [ess, serverless] operationId: UpdateKnowledgeBaseEntry - description: Update a Knowledge Base Entry + description: Update an existing Knowledge Base Entry by its unique `id`. summary: Update a Knowledge Base Entry tags: - Knowledge Base Entries API @@ -73,34 +94,46 @@ paths: - name: id in: path required: true - description: The Knowledge Base Entry's `id` value + description: The unique identifier (`id`) of the Knowledge Base Entry to update. schema: $ref: '../../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "12345" requestBody: required: true content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryUpdateRouteProps' - + example: + title: "How to reset a password (updated)" + content: "To reset your password, go to the settings page, click 'Reset Password', and follow the instructions." + tags: ["password", "reset", "help", "update"] responses: 200: - description: Successful request returning the updated Knowledge Base Entry + description: Successful request returning the updated Knowledge Base Entry. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' + example: + id: "12345" + title: "How to reset a password (updated)" + content: "To reset your password, go to the settings page, click 'Reset Password', and follow the instructions." + tags: ["password", "reset", "help", "update"] 400: - description: Generic Error + description: A generic error occurred, such as invalid input or the entry not being found. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' + example: + error: "Invalid input" + message: "The 'content' field cannot be empty." delete: x-codegen-enabled: true x-labels: [ess, serverless] operationId: DeleteKnowledgeBaseEntry - description: Deletes a single Knowledge Base Entry using the `id` field + description: Delete a Knowledge Base Entry by its unique `id`. summary: Deletes a single Knowledge Base Entry using the `id` field tags: - Knowledge Base Entries API @@ -108,20 +141,26 @@ paths: - name: id in: path required: true - description: The Knowledge Base Entry's `id` value + description: The unique identifier (`id`) of the Knowledge Base Entry to delete. schema: $ref: '../../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + example: "12345" responses: 200: - description: Successful request returning the deleted Knowledge Base Entry's ID + description: Successful request returning the `id` of the deleted Knowledge Base Entry. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/DeleteResponseFields' + example: + id: "12345" + message: "Knowledge Base Entry successfully deleted." 400: - description: Generic Error + description: A generic error occurred, such as an invalid `id` or the entry not being found. content: application/json: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' - + example: + error: "Not Found" + message: "No Knowledge Base Entry found with the provided `id`." diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts index b27e003b3681d..9f2ec49956b30 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts @@ -20,6 +20,9 @@ import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../../common_attributes.gen'; import { KnowledgeBaseEntryResponse } from './common_attributes.gen'; +/** + * Fields available for sorting Knowledge Base Entries. + */ export type FindKnowledgeBaseEntriesSortField = z.infer; export const FindKnowledgeBaseEntriesSortField = z.enum([ 'created_at', @@ -34,25 +37,28 @@ export type FindKnowledgeBaseEntriesRequestQuery = z.infer< typeof FindKnowledgeBaseEntriesRequestQuery >; export const FindKnowledgeBaseEntriesRequestQuery = z.object({ + /** + * A list of fields to include in the response. If not provided, all fields will be included. + */ fields: ArrayFromString(z.string()).optional(), /** - * Search query + * Search query to filter Knowledge Base Entries by specific criteria. */ filter: z.string().optional(), /** - * Field to sort by + * Field to sort the Knowledge Base Entries by. */ sort_field: FindKnowledgeBaseEntriesSortField.optional(), /** - * Sort order + * Sort order for the results, either asc or desc. */ sort_order: SortOrder.optional(), /** - * Page number + * Page number for paginated results. Defaults to 1. */ page: z.coerce.number().int().min(1).optional().default(1), /** - * Knowledge Base Entries per page + * Number of Knowledge Base Entries to return per page. Defaults to 20. */ per_page: z.coerce.number().int().min(0).optional().default(20), }); @@ -62,8 +68,20 @@ export type FindKnowledgeBaseEntriesRequestQueryInput = z.input< export type FindKnowledgeBaseEntriesResponse = z.infer; export const FindKnowledgeBaseEntriesResponse = z.object({ + /** + * The current page number. + */ page: z.number().int(), + /** + * The number of Knowledge Base Entries returned per page. + */ perPage: z.number().int(), + /** + * The total number of Knowledge Base Entries available. + */ total: z.number().int(), + /** + * The list of Knowledge Base Entries for the current page. + */ data: z.array(KnowledgeBaseEntryResponse), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml index 1b333d18a0d4a..14055337699eb 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml @@ -16,48 +16,55 @@ paths: - name: 'fields' in: query required: false + description: A list of fields to include in the response. If not provided, all fields will be included. schema: type: array items: type: string + example: ['title', 'created_at'] - name: 'filter' in: query - description: Search query + description: Search query to filter Knowledge Base Entries by specific criteria. required: false schema: type: string + example: 'error handling' - name: 'sort_field' in: query - description: Field to sort by + description: Field to sort the Knowledge Base Entries by. required: false schema: $ref: '#/components/schemas/FindKnowledgeBaseEntriesSortField' + example: 'created_at' - name: 'sort_order' in: query - description: Sort order + description: Sort order for the results, either asc or desc. required: false schema: $ref: '../../common_attributes.schema.yaml#/components/schemas/SortOrder' + example: 'asc' - name: 'page' in: query - description: Page number + description: Page number for paginated results. Defaults to 1. required: false schema: type: integer minimum: 1 default: 1 + example: 2 - name: 'per_page' in: query - description: Knowledge Base Entries per page + description: Number of Knowledge Base Entries to return per page. Defaults to 20. required: false schema: type: integer minimum: 0 default: 20 + example: 10 responses: 200: - description: Successful response + description: Successful response containing the paginated Knowledge Base Entries. content: application/json: schema: @@ -65,12 +72,19 @@ paths: properties: page: type: integer + description: The current page number. + example: 1 perPage: type: integer + description: The number of Knowledge Base Entries returned per page. + example: 20 total: type: integer + description: The total number of Knowledge Base Entries available. + example: 100 data: type: array + description: The list of Knowledge Base Entries for the current page. items: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' required: @@ -79,7 +93,7 @@ paths: - total - data 400: - description: Generic Error + description: Generic Error indicating an issue with the request. content: application/json: schema: @@ -87,17 +101,25 @@ paths: properties: statusCode: type: number + description: The HTTP status code of the error. + example: 400 error: type: string + description: A short description of the error. + example: 'Bad Request' message: type: string + description: A detailed message explaining the error. + example: 'Invalid query parameter: sort_order' components: schemas: FindKnowledgeBaseEntriesSortField: type: string + description: Fields available for sorting Knowledge Base Entries. enum: - 'created_at' - 'is_default' - 'title' - 'updated_at' + example: 'title' diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts index 1196de5cecf3d..70ece35b050b5 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts @@ -16,26 +16,50 @@ import { z } from '@kbn/zod'; -import { NonEmptyString, User } from '../common_attributes.gen'; +import { + BulkActionBase, + NonEmptyString, + NonEmptyTimestamp, + User, + BulkCrudActionSummary, +} from '../common_attributes.gen'; +/** + * Reason why a prompt was skipped during the bulk action. + */ export type PromptsBulkActionSkipReason = z.infer; export const PromptsBulkActionSkipReason = z.literal('PROMPT_FIELD_NOT_MODIFIED'); export type PromptsBulkActionSkipResult = z.infer; export const PromptsBulkActionSkipResult = z.object({ + /** + * The ID of the prompt that was skipped. + */ id: z.string(), + /** + * The name of the prompt that was skipped. + */ name: z.string().optional(), + /** + * The reason for skipping the prompt. + */ skip_reason: PromptsBulkActionSkipReason, }); export type PromptDetailsInError = z.infer; export const PromptDetailsInError = z.object({ + /** + * The ID of the prompt that encountered an error. + */ id: z.string(), + /** + * The name of the prompt that encountered an error. + */ name: z.string().optional(), }); /** - * Prompt type + * Type of the prompt (either system or quick). */ export type PromptType = z.infer; export const PromptType = z.enum(['system', 'quick']); @@ -44,56 +68,123 @@ export const PromptTypeEnum = PromptType.enum; export type NormalizedPromptError = z.infer; export const NormalizedPromptError = z.object({ + /** + * A message describing the error encountered. + */ message: z.string(), + /** + * The HTTP status code associated with the error. + */ status_code: z.number().int(), + /** + * A code representing the error type. + */ err_code: z.string().optional(), + /** + * List of prompts that encountered errors. + */ prompts: z.array(PromptDetailsInError), }); export type PromptResponse = z.infer; export const PromptResponse = z.object({ id: NonEmptyString, - timestamp: NonEmptyString.optional(), + timestamp: NonEmptyTimestamp.optional(), + /** + * The name of the prompt. + */ name: z.string(), + /** + * The type of the prompt. + */ promptType: PromptType, + /** + * The content of the prompt. + */ content: z.string(), + /** + * Categories associated with the prompt. + */ categories: z.array(z.string()).optional(), + /** + * The color associated with the prompt. + */ color: z.string().optional(), + /** + * Whether this prompt is the default for new conversations. + */ isNewConversationDefault: z.boolean().optional(), + /** + * Whether this prompt is the default. + */ isDefault: z.boolean().optional(), + /** + * The consumer that the prompt is associated with. + */ consumer: z.string().optional(), + /** + * The timestamp of when the prompt was last updated. + */ updatedAt: z.string().optional(), + /** + * The user who last updated the prompt. + */ updatedBy: z.string().optional(), + /** + * The timestamp of when the prompt was created. + */ createdAt: z.string().optional(), + /** + * The user who created the prompt. + */ createdBy: z.string().optional(), + /** + * List of users associated with the prompt. + */ users: z.array(User).optional(), /** - * Kibana space + * Kibana space where the prompt is located. */ namespace: z.string().optional(), }); export type PromptsBulkCrudActionResults = z.infer; export const PromptsBulkCrudActionResults = z.object({ + /** + * List of prompts that were updated. + */ updated: z.array(PromptResponse), + /** + * List of prompts that were created. + */ created: z.array(PromptResponse), + /** + * List of IDs of prompts that were deleted. + */ deleted: z.array(z.string()), + /** + * List of prompts that were skipped. + */ skipped: z.array(PromptsBulkActionSkipResult), }); -export type BulkCrudActionSummary = z.infer; -export const BulkCrudActionSummary = z.object({ - failed: z.number().int(), - skipped: z.number().int(), - succeeded: z.number().int(), - total: z.number().int(), -}); - export type PromptsBulkCrudActionResponse = z.infer; export const PromptsBulkCrudActionResponse = z.object({ + /** + * Indicates if the bulk action was successful. + */ success: z.boolean().optional(), + /** + * The HTTP status code of the response. + */ status_code: z.number().int().optional(), + /** + * A message describing the result of the bulk action. + */ message: z.string().optional(), + /** + * The number of prompts processed in the bulk action. + */ prompts_count: z.number().int().optional(), attributes: z.object({ results: PromptsBulkCrudActionResults, @@ -102,38 +193,71 @@ export const PromptsBulkCrudActionResponse = z.object({ }), }); -export type BulkActionBase = z.infer; -export const BulkActionBase = z.object({ +export type PromptCreateProps = z.infer; +export const PromptCreateProps = z.object({ /** - * Query to filter promps + * The name of the prompt. */ - query: z.string().optional(), + name: z.string(), /** - * Array of prompts IDs + * The type of the prompt. */ - ids: z.array(z.string()).min(1).optional(), -}); - -export type PromptCreateProps = z.infer; -export const PromptCreateProps = z.object({ - name: z.string(), promptType: PromptType, + /** + * The content of the prompt. + */ content: z.string(), + /** + * The color associated with the prompt. + */ color: z.string().optional(), + /** + * List of categories for the prompt. + */ categories: z.array(z.string()).optional(), + /** + * Whether this prompt should be the default for new conversations. + */ isNewConversationDefault: z.boolean().optional(), + /** + * Whether this prompt should be the default. + */ isDefault: z.boolean().optional(), + /** + * The consumer associated with the prompt. + */ consumer: z.string().optional(), }); export type PromptUpdateProps = z.infer; export const PromptUpdateProps = z.object({ + /** + * The ID of the prompt to update. + */ id: z.string(), + /** + * The updated content for the prompt. + */ content: z.string().optional(), + /** + * The updated color associated with the prompt. + */ color: z.string().optional(), + /** + * The updated categories for the prompt. + */ categories: z.array(z.string()).optional(), + /** + * Whether the prompt should be the default for new conversations. + */ isNewConversationDefault: z.boolean().optional(), + /** + * Whether this prompt should be the default. + */ isDefault: z.boolean().optional(), + /** + * The updated consumer for the prompt. + */ consumer: z.string().optional(), }); @@ -141,8 +265,17 @@ export type PerformPromptsBulkActionRequestBody = z.infer< typeof PerformPromptsBulkActionRequestBody >; export const PerformPromptsBulkActionRequestBody = z.object({ + /** + * Criteria for deleting prompts in bulk. + */ delete: BulkActionBase.optional(), + /** + * List of prompts to be created. + */ create: z.array(PromptCreateProps).optional(), + /** + * List of prompts to be updated. + */ update: z.array(PromptUpdateProps).optional(), }); export type PerformPromptsBulkActionRequestBodyInput = z.input< diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml index 26f2cfb8ee777..c849cb5e5c7c8 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml @@ -9,7 +9,9 @@ paths: x-labels: [ess, serverless] operationId: PerformPromptsBulkAction summary: Apply a bulk action to prompts - description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. + description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts + that match the filter or to the list of prompts by their IDs. This action allows + for bulk create, update, or delete operations. tags: - Bulk API requestBody: @@ -19,24 +21,69 @@ paths: type: object properties: delete: - $ref: '#/components/schemas/BulkActionBase' + $ref: '../common_attributes.schema.yaml#/components/schemas/BulkActionBase' + description: Criteria for deleting prompts in bulk. create: type: array + description: List of prompts to be created. items: $ref: '#/components/schemas/PromptCreateProps' update: type: array + description: List of prompts to be updated. items: $ref: '#/components/schemas/PromptUpdateProps' + example: + create: + - name: "New Security Prompt" + promptType: "system" + content: "Please verify the security settings." + update: + - id: "prompt123" + content: "Updated content for security prompt." + delete: + ids: ["prompt1", "prompt2"] responses: 200: - description: Indicates a successful call. + description: Indicates a successful call with the results of the bulk action. content: application/json: schema: $ref: '#/components/schemas/PromptsBulkCrudActionResponse' + examples: + success: + value: + success: true + status_code: 200 + message: "Bulk action completed successfully." + prompts_count: 5 + attributes: + results: + updated: + - id: "prompt1" + name: "Security Prompt" + promptType: "system" + content: "Updated security settings prompt" + created: + - id: "prompt6" + name: "New Security Prompt" + promptType: "system" + content: "Please verify the security settings." + deleted: + - "prompt2" + - "prompt3" + skipped: + - id: "prompt4" + name: "Security Prompt" + skip_reason: "PROMPT_FIELD_NOT_MODIFIED" + summary: + failed: 0 + skipped: 1 + succeeded: 4 + total: 5 + errors: [] 400: - description: Generic Error + description: Indicates a generic error due to a bad request. content: application/json: schema: @@ -44,10 +91,16 @@ paths: properties: statusCode: type: number + description: The HTTP status code for the error. + example: 400 error: type: string + description: A short error message. + example: "Bad Request" message: type: string + description: A detailed error message. + example: "Invalid prompt ID or missing required fields." components: schemas: @@ -55,16 +108,20 @@ components: type: string enum: - PROMPT_FIELD_NOT_MODIFIED + description: Reason why a prompt was skipped during the bulk action. PromptsBulkActionSkipResult: type: object properties: id: type: string + description: The ID of the prompt that was skipped. name: type: string + description: The name of the prompt that was skipped. skip_reason: $ref: '#/components/schemas/PromptsBulkActionSkipReason' + description: The reason for skipping the prompt. required: - id - skip_reason @@ -74,14 +131,16 @@ components: properties: id: type: string + description: The ID of the prompt that encountered an error. name: type: string + description: The name of the prompt that encountered an error. required: - id PromptType: type: string - description: Prompt type + description: Type of the prompt (either system or quick). enum: - system - quick @@ -91,14 +150,18 @@ components: properties: message: type: string + description: A message describing the error encountered. status_code: type: integer + description: The HTTP status code associated with the error. err_code: type: string + description: A code representing the error type. prompts: type: array items: $ref: '#/components/schemas/PromptDetailsInError' + description: List of prompts that encountered errors. required: - message - status_code @@ -114,41 +177,54 @@ components: properties: id: $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' - 'timestamp': - $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyString' + timestamp: + $ref: '../common_attributes.schema.yaml#/components/schemas/NonEmptyTimestamp' name: type: string + description: The name of the prompt. promptType: $ref: '#/components/schemas/PromptType' + description: The type of the prompt. content: type: string + description: The content of the prompt. categories: type: array items: type: string + description: Categories associated with the prompt. color: type: string + description: The color associated with the prompt. isNewConversationDefault: type: boolean + description: Whether this prompt is the default for new conversations. isDefault: type: boolean + description: Whether this prompt is the default. consumer: type: string + description: The consumer that the prompt is associated with. updatedAt: type: string + description: The timestamp of when the prompt was last updated. updatedBy: type: string + description: The user who last updated the prompt. createdAt: type: string + description: The timestamp of when the prompt was created. createdBy: type: string + description: The user who created the prompt. users: type: array items: $ref: '../common_attributes.schema.yaml#/components/schemas/User' + description: List of users associated with the prompt. namespace: type: string - description: Kibana space + description: Kibana space where the prompt is located. PromptsBulkCrudActionResults: type: object @@ -157,59 +233,54 @@ components: type: array items: $ref: '#/components/schemas/PromptResponse' + description: List of prompts that were updated. created: type: array items: $ref: '#/components/schemas/PromptResponse' + description: List of prompts that were created. deleted: type: array items: type: string + description: List of IDs of prompts that were deleted. skipped: type: array items: $ref: '#/components/schemas/PromptsBulkActionSkipResult' + description: List of prompts that were skipped. required: - updated - created - deleted - skipped - BulkCrudActionSummary: - type: object - properties: - failed: - type: integer - skipped: - type: integer - succeeded: - type: integer - total: - type: integer - required: - - failed - - skipped - - succeeded - - total - PromptsBulkCrudActionResponse: type: object properties: success: type: boolean + description: Indicates if the bulk action was successful. + example: true status_code: type: integer + description: The HTTP status code of the response. + example: 200 message: type: string + description: A message describing the result of the bulk action. + example: "Bulk action completed successfully." prompts_count: type: integer + description: The number of prompts processed in the bulk action. + example: 6 attributes: type: object properties: results: $ref: '#/components/schemas/PromptsBulkCrudActionResults' summary: - $ref: '#/components/schemas/BulkCrudActionSummary' + $ref: '../common_attributes.schema.yaml#/components/schemas/BulkCrudActionSummary' errors: type: array items: @@ -220,20 +291,6 @@ components: required: - attributes - BulkActionBase: - x-inline: true - type: object - properties: - query: - type: string - description: Query to filter promps - ids: - type: array - description: Array of prompts IDs - minItems: 1 - items: - type: string - PromptCreateProps: type: object required: @@ -243,22 +300,38 @@ components: properties: name: type: string + description: The name of the prompt. + example: "New Security Prompt" promptType: $ref: '#/components/schemas/PromptType' + description: The type of the prompt. + example: "system" content: type: string + description: The content of the prompt. + example: "Please verify the security settings." color: type: string + description: The color associated with the prompt. + example: "blue" categories: type: array items: type: string + description: List of categories for the prompt. + example: ["security", "verification"] isNewConversationDefault: type: boolean + description: Whether this prompt should be the default for new conversations. + example: true isDefault: type: boolean + description: Whether this prompt should be the default. + example: false consumer: type: string + description: The consumer associated with the prompt. + example: "admin" PromptUpdateProps: type: object @@ -267,17 +340,31 @@ components: properties: id: type: string + description: The ID of the prompt to update. + example: "prompt123" content: type: string + description: The updated content for the prompt. + example: "Updated content for security prompt." color: type: string + description: The updated color associated with the prompt. + example: "green" categories: type: array items: type: string + description: The updated categories for the prompt. + example: ["security", "alert"] isNewConversationDefault: type: boolean + description: Whether the prompt should be the default for new conversations. + example: false isDefault: type: boolean + description: Whether this prompt should be the default. + example: true consumer: type: string + description: The updated consumer for the prompt. + example: "user123" diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts index 5c4efb19a44ef..2f9674fb52bb7 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts @@ -20,6 +20,9 @@ import { ArrayFromString } from '@kbn/zod-helpers'; import { SortOrder } from '../common_attributes.gen'; import { PromptResponse } from './bulk_crud_prompts_route.gen'; +/** + * Field by which to sort the prompts. + */ export type FindPromptsSortField = z.infer; export const FindPromptsSortField = z.enum(['created_at', 'is_default', 'name', 'updated_at']); export type FindPromptsSortFieldEnum = typeof FindPromptsSortField.enum; @@ -27,25 +30,28 @@ export const FindPromptsSortFieldEnum = FindPromptsSortField.enum; export type FindPromptsRequestQuery = z.infer; export const FindPromptsRequestQuery = z.object({ + /** + * List of specific fields to include in each returned prompt. + */ fields: ArrayFromString(z.string()).optional(), /** - * Search query + * Search query string to filter prompts by matching fields. */ filter: z.string().optional(), /** - * Field to sort by + * Field to sort prompts by. */ sort_field: FindPromptsSortField.optional(), /** - * Sort order + * Sort order, either asc or desc. */ sort_order: SortOrder.optional(), /** - * Page number + * Page number for pagination. */ page: z.coerce.number().int().min(1).optional().default(1), /** - * Prompts per page + * Number of prompts per page. */ per_page: z.coerce.number().int().min(0).optional().default(20), }); @@ -53,8 +59,20 @@ export type FindPromptsRequestQueryInput = z.input; export const FindPromptsResponse = z.object({ + /** + * Current page number. + */ page: z.number().int(), + /** + * Number of prompts per page. + */ perPage: z.number().int(), + /** + * Total number of prompts matching the query. + */ total: z.number().int(), + /** + * The list of prompts returned based on the search query, sorting, and pagination. + */ data: z.array(PromptResponse), }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml index 34794d69dffd5..e40abba52c8a2 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml @@ -2,62 +2,68 @@ openapi: 3.0.0 info: title: Find Prompts API endpoint version: '2023-10-31' + paths: /api/security_ai_assistant/prompts/_find: get: x-codegen-enabled: true x-labels: [ess, serverless] operationId: FindPrompts - description: Get a list of all prompts. + description: Get a list of all prompts based on optional filters, sorting, and pagination. summary: Get prompts tags: - Prompts API parameters: - name: 'fields' in: query + description: List of specific fields to include in each returned prompt. required: false schema: type: array items: type: string + example: ['id', 'name', 'content'] - name: 'filter' in: query - description: Search query + description: Search query string to filter prompts by matching fields. required: false schema: type: string + example: 'error handling' - name: 'sort_field' in: query - description: Field to sort by + description: Field to sort prompts by. required: false schema: $ref: '#/components/schemas/FindPromptsSortField' - name: 'sort_order' in: query - description: Sort order + description: Sort order, either asc or desc. required: false schema: $ref: '../common_attributes.schema.yaml#/components/schemas/SortOrder' - name: 'page' in: query - description: Page number + description: Page number for pagination. required: false schema: type: integer minimum: 1 default: 1 + example: 1 - name: 'per_page' in: query - description: Prompts per page + description: Number of prompts per page. required: false schema: type: integer minimum: 0 default: 20 + example: 20 responses: 200: - description: Successful response + description: Successful response containing a list of prompts. content: application/json: schema: @@ -65,12 +71,19 @@ paths: properties: page: type: integer + description: Current page number. + example: 1 perPage: type: integer + description: Number of prompts per page. + example: 20 total: type: integer + description: Total number of prompts matching the query. + example: 142 data: type: array + description: The list of prompts returned based on the search query, sorting, and pagination. items: $ref: './bulk_crud_prompts_route.schema.yaml#/components/schemas/PromptResponse' required: @@ -78,8 +91,31 @@ paths: - perPage - total - data + example: + page: 1 + perPage: 20 + total: 142 + data: + - id: "prompt-123" + timestamp: "2025-04-30T22:30:00Z" + name: "Error Troubleshooting Prompt" + promptType: "standard" + content: "If you encounter an error, check the logs and retry." + categories: ["troubleshooting", "logging"] + color: "#FF5733" + isNewConversationDefault: false + isDefault: true + consumer: "security" + updatedAt: "2025-04-30T22:45:00Z" + updatedBy: "jdoe" + createdAt: "2025-04-20T21:00:00Z" + createdBy: "jdoe" + users: + - username: "jdoe" + full_name: "John Doe" + namespace: "default" 400: - description: Generic Error + description: Bad request due to invalid parameters or malformed query. content: application/json: schema: @@ -87,17 +123,26 @@ paths: properties: statusCode: type: number + description: HTTP status code for the error. + example: 400 error: type: string + description: Short error message. + example: "Bad Request" message: type: string + description: Detailed description of the error. + example: "Invalid sort order value provided." components: schemas: FindPromptsSortField: type: string + description: Field by which to sort the prompts. enum: - 'created_at' - 'is_default' - 'name' - 'updated_at' + example: 'created_at' + diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts index b91682e20abe7..0b6361e660131 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/bulk_update_anonymization_fields.ts @@ -14,7 +14,7 @@ import { import { PerformAnonymizationFieldsBulkActionRequestBody, PerformAnonymizationFieldsBulkActionResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; export const bulkUpdateAnonymizationFields = async ( http: HttpSetup, diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts index 657216b9079cd..d79e2e3e1f16b 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { useQuery } from '@tanstack/react-query'; import { API_VERSIONS, diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts index fef992bc14b26..88ca4eb003e2f 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.test.ts @@ -12,7 +12,7 @@ import { import { httpServiceMock } from '@kbn/core-http-browser-mocks'; import { IToasts } from '@kbn/core-notifications-browser'; import { bulkUpdatePrompts } from './bulk_update_prompts'; -import { PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas'; const prompt1 = { id: 'field1', diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts index fb5e1dadb7dc6..bb6d88703a374 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/bulk_update_prompts.ts @@ -14,7 +14,7 @@ import { import { PerformPromptsBulkActionRequestBody, PerformPromptsBulkActionResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; export const bulkUpdatePrompts = async ( http: HttpSetup, diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts index 4c0ca9c0a9c89..27e2bccbd66ca 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FindPromptsResponse } from '@kbn/elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen'; +import { FindPromptsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { useQuery } from '@tanstack/react-query'; import { API_VERSIONS, ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND } from '@kbn/elastic-assistant-common'; import { HttpSetup, IToasts } from '@kbn/core/public'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx index d3ae29643804e..98335add50b20 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx @@ -9,7 +9,7 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/ import { sortBy } from 'lodash/fp'; import React, { useCallback, useMemo } from 'react'; -import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { getNewSelectedPromptContext } from '../../data_anonymization/get_new_selected_prompt_context'; import type { PromptContext, SelectedPromptContext } from '../prompt_context/types'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts index 7ea1fdbc38bf8..129ebd70a4168 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts @@ -6,7 +6,7 @@ */ import { Replacements } from '@kbn/elastic-assistant-common'; -import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import type { ReactNode } from 'react'; /** diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/utils.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/utils.test.tsx index 041e00944eeb2..b9a26285ef915 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/utils.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/utils.test.tsx @@ -6,7 +6,7 @@ */ import { ProviderEnum } from '@kbn/elastic-assistant-common'; import { getSelectedConversations } from './utils'; -import { PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas'; describe('getSelectedConversations', () => { const conversationSettings = { '8f1e3218-0b02-480a-8791-78c1ed5f3708': { diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_editor.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_editor.tsx index 6664afb9a1360..639fc70328158 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_editor.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_editor.tsx @@ -10,7 +10,7 @@ import { EuiFormRow, EuiColorPicker, EuiTextArea } from '@elastic/eui'; import { EuiSetColorMethod } from '@elastic/eui/src/services/color_picker/color_picker'; import { css } from '@emotion/react'; -import { PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { PromptContextTemplate } from '../../../..'; import { getRandomEuiColor } from './helpers'; import * as i18n from './translations'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_settings.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_settings.tsx index c9082efbf6a1e..a54c5f3a7235f 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_settings.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_settings.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiTitle, EuiText, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; -import { PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { EuiSetColorMethod } from '@elastic/eui/src/services/color_picker/color_picker'; import * as i18n from './translations'; import { QuickPromptSettingsEditor } from './quick_prompt_editor'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/index.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/index.tsx index 3710e4f6eec6d..559dfc302b3e4 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/index.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/index.tsx @@ -15,7 +15,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { useQuickPromptUpdater } from '../../settings/use_settings_updater/use_quick_prompt_updater'; import { QuickPromptSettingsEditor } from '../quick_prompt_settings/quick_prompt_editor'; import * as i18n from './translations'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx index f2baf4528b52d..0960e8fee3413 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx @@ -17,10 +17,7 @@ import { import useMeasure from 'react-use/lib/useMeasure'; import { css } from '@emotion/react'; -import { - PromptResponse, - PromptTypeEnum, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptResponse, PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas'; import * as i18n from './translations'; import { useAssistantContext } from '../../assistant_context'; import { QUICK_PROMPTS_TAB } from '../settings/const'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_anonymization_updater.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_anonymization_updater.ts index 7e44e32e5bacc..41ffd3da323fd 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_anonymization_updater.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_anonymization_updater.ts @@ -5,9 +5,11 @@ * 2.0. */ -import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import { + FindAnonymizationFieldsResponse, + PerformAnonymizationFieldsBulkActionRequestBody, +} from '@kbn/elastic-assistant-common/impl/schemas'; import { useCallback, useEffect, useState } from 'react'; -import { PerformAnonymizationFieldsBulkActionRequestBody } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; import type { HttpSetup } from '@kbn/core-http-browser'; import type { IToasts } from '@kbn/core-notifications-browser'; import { BatchUpdateListItem } from '../../../data_anonymization_editor/context_editor/types'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_quick_prompt_updater.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_quick_prompt_updater.ts index 93dd11d8fd35f..ffe5a7fe5aa5b 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_quick_prompt_updater.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_quick_prompt_updater.ts @@ -7,7 +7,7 @@ import { useCallback, useEffect, useState } from 'react'; import { FindPromptsResponse, PromptResponse, PromptTypeEnum } from '@kbn/elastic-assistant-common'; -import { PerformPromptsBulkActionRequestBody as PromptsPerformBulkActionRequestBody } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PerformPromptsBulkActionRequestBody as PromptsPerformBulkActionRequestBody } from '@kbn/elastic-assistant-common/impl/schemas'; import { HttpSetup } from '@kbn/core-http-browser'; import { EuiSetColorMethod } from '@elastic/eui/src/services/color_picker/color_picker'; import { IToasts } from '@kbn/core-notifications-browser'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_system_prompt_updater.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_system_prompt_updater.ts index 218a08ad49b0b..e9724c44da82a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_system_prompt_updater.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_system_prompt_updater.ts @@ -13,7 +13,7 @@ import { PromptTypeEnum, } from '@kbn/elastic-assistant-common'; import { HttpSetup } from '@kbn/core-http-browser'; -import { PerformPromptsBulkActionRequestBody as PromptsPerformBulkActionRequestBody } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PerformPromptsBulkActionRequestBody as PromptsPerformBulkActionRequestBody } from '@kbn/elastic-assistant-common/impl/schemas'; import { InfiniteData, QueryObserverResult } from '@tanstack/react-query'; import { IToasts } from '@kbn/core-notifications-browser'; import { AIConnector } from '../../../connectorland/connector_selector'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/use_data_stream_apis.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/use_data_stream_apis.tsx index 1518d97f320bd..ffdd5ab01fcec 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/use_data_stream_apis.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/use_data_stream_apis.tsx @@ -8,7 +8,7 @@ import { useMemo, useState } from 'react'; import type { HttpSetup } from '@kbn/core-http-browser'; import { PromptResponse, PromptTypeEnum } from '@kbn/elastic-assistant-common'; -import type { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import type { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { InfiniteData, QueryObserverResult, diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization/get_new_selected_prompt_context/index.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization/get_new_selected_prompt_context/index.ts index 2037f0bdd8913..67c1e9f082bb1 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization/get_new_selected_prompt_context/index.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization/get_new_selected_prompt_context/index.ts @@ -5,9 +5,11 @@ * 2.0. */ -import type { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import type { + FindAnonymizationFieldsResponse, + AnonymizationFieldResponse, +} from '@kbn/elastic-assistant-common/impl/schemas'; import { isAllowed, isAnonymized } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; import type { PromptContext, SelectedPromptContext } from '../../assistant/prompt_context/types'; export async function getNewSelectedPromptContext({ diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/get_rows/index.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/get_rows/index.ts index d9f1b5b7b4fe2..11ab25d211312 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/get_rows/index.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/get_rows/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { isAllowed, isAnonymized, isDenied } from '@kbn/elastic-assistant-common'; import { ContextEditorRow } from '../types'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/index.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/index.tsx index 8e3c2e84d8770..be92be89e5972 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/index.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor/index.tsx @@ -9,7 +9,7 @@ import { EuiInMemoryTable } from '@elastic/eui'; import type { EuiSearchBarProps, EuiTableSelectionType } from '@elastic/eui'; import React, { useCallback, useMemo, useState, useRef } from 'react'; -import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import styled from '@emotion/styled'; import { getColumns } from './get_columns'; import { getRows } from './get_rows'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor_modal/index.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor_modal/index.tsx index 652f6fd89b315..5b89d0064b10d 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor_modal/index.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/context_editor_modal/index.tsx @@ -29,7 +29,7 @@ import { euiThemeVars } from '@kbn/ui-theme'; import { AnonymizationFieldResponse, PerformAnonymizationFieldsBulkActionRequestBody, -} from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { find, uniqBy } from 'lodash'; import { ContextEditor } from '../context_editor'; import { Stats } from '../stats'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/get_stats/index.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/get_stats/index.ts index adcdab05724cd..bc75f3ebe5ee1 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/get_stats/index.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/get_stats/index.ts @@ -7,7 +7,7 @@ import { isAllowed, isAnonymized, isDenied, Replacements } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { Stats } from '../helpers'; export const getStats = ({ diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/stats/index.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/stats/index.tsx index 180933409aafd..9e8dbf940127b 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/stats/index.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/data_anonymization_editor/stats/index.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { Replacements } from '@kbn/elastic-assistant-common'; import React, { useMemo } from 'react'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/mock/quick_prompt.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/mock/quick_prompt.ts index 31fa9bb6508b8..27a343b384eaa 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/mock/quick_prompt.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/mock/quick_prompt.ts @@ -5,10 +5,7 @@ * 2.0. */ -import { - PromptResponse, - PromptTypeEnum, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptResponse, PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas'; export const MOCK_QUICK_PROMPTS: PromptResponse[] = [ { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/anonymization_fields_schema.mock.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/anonymization_fields_schema.mock.ts index 73d47d96be492..b58141e438d6d 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/anonymization_fields_schema.mock.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/anonymization_fields_schema.mock.ts @@ -11,7 +11,7 @@ import { AnonymizationFieldResponse, AnonymizationFieldUpdateProps, PerformAnonymizationFieldsBulkActionRequestBody, -} from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { EsAnonymizationFieldsSchema } from '../ai_assistant_data_clients/anonymization_fields/types'; export const getAnonymizationFieldsSearchEsMock = () => { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/prompts_schema.mock.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/prompts_schema.mock.ts index 4939a6608e618..11a542320e412 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/prompts_schema.mock.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/prompts_schema.mock.ts @@ -12,7 +12,7 @@ import { PromptCreateProps, PromptResponse, PromptUpdateProps, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; export const getPromptsSearchEsMock = () => { const searchResponse: estypes.SearchResponse = { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts index 0f577df4e56e1..21bd230ffd2b1 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts @@ -10,7 +10,7 @@ import { AnonymizationFieldCreateProps, AnonymizationFieldResponse, AnonymizationFieldUpdateProps, -} from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { AuthenticatedUser } from '@kbn/core-security-common'; import { CreateAnonymizationFieldSchema, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts index eb71270127b2a..ad94e057ec684 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts @@ -11,7 +11,7 @@ import { PromptResponse, PromptType, PromptUpdateProps, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { AuthenticatedUser } from '@kbn/core-security-common'; import { CreatePromptSchema, EsPromptsSchema, UpdatePromptSchema } from './types'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/__mocks__/mock_anonymization_fields.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/__mocks__/mock_anonymization_fields.ts index ed487e4705c27..9ae0dc551ae63 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/__mocks__/mock_anonymization_fields.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/__mocks__/mock_anonymization_fields.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; export const getMockAnonymizationFieldResponse = (): AnonymizationFieldResponse[] => [ { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/constants.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/constants.ts index c6f6f09f1d9ae..161e6ca6b0fe6 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/constants.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/constants.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; export const DEFAULT_EVAL_ANONYMIZATION_FIELDS: AnonymizationFieldResponse[] = [ { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts index ce5b2ab71d177..a66b36cda95ba 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts @@ -9,7 +9,7 @@ import type { ActionsClient } from '@kbn/actions-plugin/server'; import type { Connector } from '@kbn/actions-plugin/server/application/connector/types'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Logger } from '@kbn/core/server'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import type { LangChainTracer } from '@langchain/core/tracers/tracer_langchain'; import { ActionsClientLlm } from '@kbn/langchain/server'; import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts index ddc812061f561..7c889e79a03f9 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts @@ -7,7 +7,7 @@ import { ElasticsearchClient, Logger } from '@kbn/core/server'; import { Replacements } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import type { ActionsClientLlm } from '@kbn/langchain/server'; import { END, START, StateGraph } from '@langchain/langgraph'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/mock/mock_anonymization_fields.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/mock/mock_anonymization_fields.ts index 541fb78b17c5d..175329e3feba9 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/mock/mock_anonymization_fields.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/mock/mock_anonymization_fields.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import type { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; export const mockAnonymizationFields: AnonymizationFieldResponse[] = [ { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/anonymized_alerts_retriever/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/anonymized_alerts_retriever/index.ts index b7863f2e150fd..d0612d472a514 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/anonymized_alerts_retriever/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/anonymized_alerts_retriever/index.ts @@ -7,7 +7,7 @@ import type { ElasticsearchClient } from '@kbn/core/server'; import { Replacements } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager'; import type { Document } from '@langchain/core/documents'; import { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/helpers/get_anonymized_alerts/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/helpers/get_anonymized_alerts/index.ts index 5e4d88c5a0dce..3ba95edf7e7da 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/helpers/get_anonymized_alerts/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/helpers/get_anonymized_alerts/index.ts @@ -16,7 +16,7 @@ import { transformRawData, } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; export const getAnonymizedAlerts = async ({ alertsIndexPattern, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.ts index eedf725ab754f..893c115f6315d 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.ts @@ -7,7 +7,7 @@ import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { Replacements } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { AnonymizedAlertsRetriever } from './anonymized_alerts_retriever'; import type { GraphState } from '../../types'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts index 35e0f9de5e9bd..871dee7772635 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts @@ -22,7 +22,7 @@ import { BulkCrudActionSummary, PerformAnonymizationFieldsBulkActionRequestBody, PerformAnonymizationFieldsBulkActionResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { ANONYMIZATION_FIELDS_TABLE_MAX_PAGE_SIZE } from '../../../common/constants'; import { ElasticAssistantPluginRouter } from '../../types'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts index 2673dc2d54c4d..bca4509406690 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts @@ -16,7 +16,7 @@ import { import { FindAnonymizationFieldsRequestQuery, FindAnonymizationFieldsResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import _ from 'lodash'; import { ElasticAssistantPluginRouter } from '../../types'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx index 022eb8f1619e7..eeb4203f6569c 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx @@ -9,7 +9,7 @@ import type { ActionsClient } from '@kbn/actions-plugin/server'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Logger, SavedObjectsClientContract } from '@kbn/core/server'; import { ApiConfig, AttackDiscovery, Replacements } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { ActionsClientLlm } from '@kbn/langchain/server'; import { PublicMethodsOf } from '@kbn/utility-types'; import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.test.ts index f862c5c43b154..916398f0c0895 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { throwIfInvalidAnonymization } from '.'; import * as i18n from './translations'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.ts index 01f5af25c316e..32a593733d99b 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/throw_if_invalid_anonymization/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import * as i18n from './translations'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts index 50c754a56ad4f..3c0c593bf2ef7 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts @@ -23,7 +23,7 @@ import type { DefendInsightsResponse, Replacements, } from '@kbn/elastic-assistant-common'; -import type { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import type { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import type { ActionsClient } from '@kbn/actions-plugin/server'; import { ActionsClientLlm } from '@kbn/langchain/server'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts index 3b8e90fe0f0f0..a9193c2ff5e68 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts @@ -15,7 +15,7 @@ import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/ import { KnowledgeBaseEntryCreateProps, KnowledgeBaseEntryResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { ElasticAssistantPluginRouter } from '../../../types'; import { buildResponse } from '../../utils'; import { performChecks } from '../../helpers'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts index 0653660f757ad..33173f063f8cc 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts @@ -15,7 +15,7 @@ import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/ import { DeleteKnowledgeBaseEntryRequestParams, DeleteKnowledgeBaseEntryResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { ElasticAssistantPluginRouter } from '../../../types'; import { buildResponse } from '../../utils'; import { performChecks } from '../../helpers'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts index 93761e3e01c82..ee73ce935896c 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts @@ -16,7 +16,7 @@ import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/ import { KnowledgeBaseEntryResponse, KnowledgeBaseEntryUpdateRouteProps, -} from '@kbn/elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { ElasticAssistantPluginRouter } from '../../../types'; import { buildResponse } from '../../utils'; import { performChecks } from '../../helpers'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts index 0f37bf95119f4..7d97bee6f3f0b 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts @@ -22,7 +22,7 @@ import { BulkCrudActionSummary, PerformPromptsBulkActionRequestBody, PerformPromptsBulkActionResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { PROMPTS_TABLE_MAX_PAGE_SIZE } from '../../../common/constants'; import { ElasticAssistantPluginRouter } from '../../types'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/find_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/find_route.ts index ea57bd5472203..7556e764c6535 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/find_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/find_route.ts @@ -12,7 +12,7 @@ import { API_VERSIONS, ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND } from '@kbn/elasti import { FindPromptsRequestQuery, FindPromptsResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { ElasticAssistantPluginRouter } from '../../types'; import { buildResponse } from '../utils'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts index b02a1040edad1..22315b568de49 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts @@ -15,7 +15,7 @@ import { import { FindConversationsRequestQuery, FindConversationsResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { ElasticAssistantPluginRouter } from '../../types'; import { buildResponse } from '../utils'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts index 14d880123d823..6c7a01794e873 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts @@ -11,8 +11,10 @@ import { API_VERSIONS, ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, } from '@kbn/elastic-assistant-common'; -import { ConversationResponse } from '@kbn/elastic-assistant-common/impl/schemas/conversations/common_attributes.gen'; -import { ReadConversationRequestParams } from '@kbn/elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen'; +import { + ConversationResponse, + ReadConversationRequestParams, +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { buildResponse } from '../utils'; import { ElasticAssistantPluginRouter } from '../../types'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts index ac3b9b4846ac7..cbe49ecf1f9d5 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts @@ -14,8 +14,8 @@ import { import { ConversationResponse, ConversationUpdateProps, -} from '@kbn/elastic-assistant-common/impl/schemas/conversations/common_attributes.gen'; -import { UpdateConversationRequestParams } from '@kbn/elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen'; + UpdateConversationRequestParams, +} from '@kbn/elastic-assistant-common/impl/schemas'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { ElasticAssistantPluginRouter } from '../../types'; import { buildResponse } from '../utils'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts index 633f5aa79ec94..3f99d0689dfb8 100755 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts @@ -35,7 +35,7 @@ import { Replacements, ContentReferencesStore, } from '@kbn/elastic-assistant-common'; -import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; +import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { LicensingApiRequestHandlerContext, LicensingPluginStart, diff --git a/x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx index 1bf997eb4de2f..8c33ca94f9139 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx @@ -5,10 +5,7 @@ * 2.0. */ -import { - PromptTypeEnum, - type PromptResponse, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptTypeEnum, type PromptResponse } from '@kbn/elastic-assistant-common/impl/schemas'; import { APP_UI_ID } from '../../../../common'; import * as i18n from './translations'; import { diff --git a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts index 7f990a5350999..63658f97720f4 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; +import type { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas'; export const mockFindAnonymizationFieldsResponse: FindAnonymizationFieldsResponse = { perPage: 1000, diff --git a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts index 28bd8970fbcb3..69bda90328b28 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts @@ -11,7 +11,7 @@ import type { DynamicTool } from '@langchain/core/tools'; import { loggerMock } from '@kbn/logging-mocks'; import { ALERT_COUNTS_TOOL } from './alert_counts_tool'; import type { RetrievalQAChain } from 'langchain/chains'; -import type { ExecuteConnectorRequestBody } from '@kbn/elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen'; +import type { ExecuteConnectorRequestBody } from '@kbn/elastic-assistant-common/impl/schemas'; import type { ContentReferencesStore } from '@kbn/elastic-assistant-common'; import { newContentReferencesStoreMock } from '@kbn/elastic-assistant-common/impl/content_references/content_references_store/__mocks__/content_references_store.mock'; diff --git a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts index d2fc1888e2ae8..606426e96de71 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts @@ -12,7 +12,7 @@ import type { DynamicTool } from '@langchain/core/tools'; import { OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL } from './open_and_acknowledged_alerts_tool'; import type { RetrievalQAChain } from 'langchain/chains'; import { mockAlertsFieldsApi } from '@kbn/elastic-assistant-plugin/server/__mocks__/alerts'; -import type { ExecuteConnectorRequestBody } from '@kbn/elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen'; +import type { ExecuteConnectorRequestBody } from '@kbn/elastic-assistant-common/impl/schemas'; import { loggerMock } from '@kbn/logging-mocks'; import type { ContentReferencesStore, diff --git a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts index b4dfd08af5e48..14ca8ed18cada 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts @@ -9,7 +9,7 @@ import type { RetrievalQAChain } from 'langchain/chains'; import type { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { KibanaRequest } from '@kbn/core-http-server'; -import type { ExecuteConnectorRequestBody } from '@kbn/elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen'; +import type { ExecuteConnectorRequestBody } from '@kbn/elastic-assistant-common/impl/schemas'; import { loggerMock } from '@kbn/logging-mocks'; import { PRODUCT_DOCUMENTATION_TOOL } from './product_documentation_tool'; import type { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts index 9a7f8d9cac2ae..a3420e346e889 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts @@ -6,7 +6,7 @@ */ import { EXPLAIN_THEN_SUMMARIZE_SUGGEST_INVESTIGATION_GUIDE_NON_I18N } from '@kbn/security-solution-plugin/public/assistant/content/prompts/user/translations'; -import { PromptCreateProps } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptCreateProps } from '@kbn/elastic-assistant-common/impl/schemas'; import { IS_SERVERLESS } from '../../env_var_names_constants'; import { QUICK_PROMPT_BADGE, USER_PROMPT } from '../../screens/ai_assistant'; import { createRule } from '../../tasks/api_calls/rules'; diff --git a/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts b/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts index 23ab68f1e91d8..5fd97f391cfbb 100644 --- a/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts +++ b/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts @@ -11,7 +11,7 @@ import { ConversationResponse, Provider, } from '@kbn/elastic-assistant-common'; -import { PromptCreateProps } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +import { PromptCreateProps } from '@kbn/elastic-assistant-common/impl/schemas'; export const getMockConversation = (body?: Partial) => ({ title: 'Test Conversation', diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.ts index 6a2543ed12bbf..8eab1b73e3d14 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.ts @@ -10,7 +10,7 @@ import { PerformPromptsBulkActionRequestBody, PerformPromptsBulkActionResponse, PromptCreateProps, -} from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; +} from '@kbn/elastic-assistant-common/impl/schemas'; import { deleteAllDocuments } from './elasticsearch'; import { getMockConversation, getMockCreatePrompt } from '../../objects/assistant'; import { getSpaceUrl } from '../space';