openapi: 3.0.3
info:
contact:
name: Kibana Team
description: 'The Kibana REST APIs enable you to manage resources such as connectors, data views, and saved objects.
The API calls are stateless.
Each request that you make happens in isolation from other calls and must include all of the necessary information for Kibana to fulfill the
request.
API requests return JSON output, which is a format that is machine-readable and works well for automation.
To interact with Kibana APIs, use the following operations:
- GET: Fetches the information.
- PATCH: Applies partial modifications to the existing information.
- POST: Adds new information.
- PUT: Updates the existing information.
- DELETE: Removes the information.
You can prepend any Kibana API endpoint with `kbn:` and run the request in **Dev Tools → Console**.
For example:
```
GET kbn:/api/data_views
```
For more information about the console, refer to [Run API requests](https://www.elastic.co/docs/explore-analyze/query-filter/tools/console).
NOTE: Access to internal Kibana API endpoints will be restricted in Kibana version 9.0. Please move any integrations to publicly documented APIs.
## Documentation source and versions
This documentation is derived from the `main` branch of the [kibana](https://github.com/elastic/kibana) repository.
It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).
This documentation contains work-in-progress information for future Elastic Stack releases.
'
title: Kibana APIs Actions agent builder API
version: ''
x-doc-license:
name: Attribution-NonCommercial-NoDerivatives 4.0 International
url: https://creativecommons.org/licenses/by-nc-nd/4.0/
x-feedbackLink:
label: Feedback
url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
security:
- apiKeyAuth: []
- basicAuth: []
tags:
- name: agent builder
description: 'Agent Builder is a set of AI-powered capabilities for developing and interacting with agents that work with your Elasticsearch data.
Most users will probably want to integrate with Agent Builder using MCP or A2A, but you can also work programmatically with tools, agents, and conversations using these Kibana APIs.
**Elastic Agent Builder requires an Enterprise subscription.**
'
externalDocs:
description: Agent Builder docs
url: https://www.elastic.co/docs/solutions/search/agent-builder/programmatic-access
x-displayName: Agent Builder
paths:
/api/agent_builder/a2a/{agentId}:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/a2a/{agentId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
> warn
> This endpoint is designed for A2A protocol clients and should not be used directly via REST APIs. Use an A2A SDK or A2A Inspector instead.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: post-agent-builder-a2a-agentid
parameters:
- description: The unique identifier of the agent to send the A2A task to.
in: path
name: agentId
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
a2aTaskRequestExample:
description: 'WARNING: DO NOT USE THIS ENDPOINT VIA REST API. These examples are auto-generated and should not be run. Integrate with A2A using an A2A SDK or A2A Inspector instead.'
value:
id: task-123
jsonrpc: '2.0'
method: complete
params:
messages:
- content: Hello from A2A protocol
role: user
schema: {}
responses:
'200':
content:
application/json:
examples:
a2aTaskResponseExample:
description: Example response from A2A Task Endpoint with results of task execution
value:
id: task-123
jsonrpc: '2.0'
result:
conversation_id: conv-456
response:
message: Hello! How can I help you today?
type: response
description: Indicates a successful response
summary: Send A2A task
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/a2a/{agentId}.json:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/a2a/{agentId}.json
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Get agent discovery metadata in JSON format. Use this endpoint to provide agent information for A2A protocol integration and discovery.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-a2a-agentid.json
parameters:
- description: The unique identifier of the agent to get A2A metadata for.
in: path
name: agentId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
a2aAgentCardResponseExample:
description: Example response card of Elastic AI Agent
value:
capabilities:
pushNotifications: false
stateTransitionHistory: false
streaming: false
defaultInputModes:
- text/plain
defaultOutputModes:
- text/plain
description: Elastic AI Agent
name: Elastic AI Agent
protocolVersion: 0.3.0
provider:
organization: Elastic
url: https://elastic.co
securitySchemes:
authorization:
description: Authentication token
in: header
name: Authorization
type: apiKey
skills:
- description: A powerful tool for searching and analyzing data within your Elasticsearch cluster.
examples: []
id: platform.core.search
inputModes:
- text/plain
- application/json
name: platform.core.search
outputModes:
- text/plain
- application/json
tags:
- tool
supportsAuthenticatedExtendedCard: false
url: http://localhost:5601/api/agent_builder/a2a/elastic-ai-agent
version: 0.1.0
description: Indicates a successful response
summary: Get A2A agent card
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/a2a/{agentId}.json\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/a2a/{agentId}.json
'
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/agents:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/agents
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-agents
parameters: []
responses:
'200':
content:
application/json:
examples:
listAgentsResponseExample:
description: Example response that returns one built-in Elastic agent and one created by the user
value:
results:
- configuration:
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Elastic AI Agent
id: elastic-ai-agent
name: Elastic AI Agent
type: chat
- avatar_color: '#BFDBFF'
avatar_symbol: SI
configuration:
instructions: You are a custom agent that wants to help searching data using all indices starting with prefix "content-".
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Hi! I can help you search the data within the indices starting with "content-" prefix.
id: created-agent-id
labels:
- custom-indices
- department-search
name: Search Index Helper
type: chat
description: Indicates a successful response
summary: List agents
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/agents\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/agents
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/agents
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Create a new agent. Use this endpoint to define the agent''s behavior, appearance, and capabilities through comprehensive configuration options. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).
[Required authorization] Route required privileges: agentBuilder:manageAgents.'
operationId: post-agent-builder-agents
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
examples:
createAgentRequestExample:
description: Example request for creating a custom agent with special prompt and tools
value:
avatar_color: '#BFDBFF'
avatar_symbol: SI
configuration:
instructions: You are a custom agent that wants to help searching data using all indices starting with prefix "content-".
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Hi! I can help you search the data within the indices starting with "content-" prefix.
id: created-agent-id
labels:
- custom-indices
- department-search
name: Search Index Helper
schema:
additionalProperties: false
type: object
properties:
avatar_color:
description: Optional hex color code for the agent avatar.
type: string
avatar_symbol:
description: Optional symbol/initials for the agent avatar.
type: string
configuration:
additionalProperties: false
description: Configuration settings for the agent.
type: object
properties:
enable_elastic_capabilities:
description: When true, enables built-in Elastic capabilities for the agent.
type: boolean
instructions:
description: Optional system instructions that define the agent behavior.
type: string
plugin_ids:
description: Array of plugin IDs to assign to the agent.
items:
description: Plugin ID to assign to the agent.
type: string
maxItems: 100
type: array
skill_ids:
description: Array of skill IDs to be available to the agent.
items:
description: Skill ID to be available to the agent.
type: string
maxItems: 100
type: array
tools:
items:
additionalProperties: false
description: Tool selection configuration for the agent.
type: object
properties:
tool_ids:
description: Array of tool IDs that the agent can use.
items:
description: Tool ID to be available to the agent.
type: string
type: array
required:
- tool_ids
type: array
workflow_ids:
items:
description: Optional list of workflow IDs. When set, these workflows run before every agent execution, in order.
type: string
maxItems: 100
type: array
required:
- tools
description:
description: Description of what the agent does.
type: string
id:
description: Unique identifier for the agent.
type: string
labels:
description: Optional labels for categorizing and organizing agents.
items:
description: Label for categorizing the agent.
type: string
type: array
name:
description: Display name for the agent.
type: string
visibility:
description: '**Technical Preview; added in 9.4.0.** Optional visibility setting: `public` (any privileged user can read/write), `shared` (any privileged user can read, only owner can write), `private` (only owner can read/write).'
enum:
- public
- shared
- private
type: string
required:
- id
- name
- description
- configuration
responses:
'200':
content:
application/json:
examples:
createAgentResponseExample:
description: Example response returning the definition of an agent created as a result of the request
value:
avatar_color: '#BFDBFF'
avatar_symbol: SI
configuration:
instructions: You are a custom agent that wants to help searching data using all indices starting with prefix "content-".
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Hi! I can help you search the data within the indices starting with "content-" prefix.
id: created-agent-id
labels:
- custom-indices
- department-search
name: Search Index Helper
type: chat
description: Indicates a successful response
summary: Create an agent
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"${KIBANA_URL}/api/agent_builder/agents\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"id\": \"new-agent-id\",\n \"name\": \"Search Index Helper\",\n \"description\": \"Hi! I can help you search the data within the indices starting with \\\"content-\\\" prefix.\",\n \"labels\": [\"custom-indices\", \"department-search\"],\n \"avatar_color\": \"#BFDBFF\",\n \"avatar_symbol\": \"SI\",\n \"configuration\": {\n \"instructions\": \"You are a custom agent that wants to help searching data using all indices starting with prefix \\\"content-\\\".\",\n \"tools\": [\n {\n \"tool_ids\": [\n \"platform.core.search\",\n \"platform.core.list_indices\",\n \"platform.core.get_index_mapping\",\n \"platform.core.get_document_by_id\"\n ]\n }\n ]\n }\n}'\n"
- lang: Console
source: "POST kbn://api/agent_builder/agents\n{\n \"id\": \"new-agent-id\",\n \"name\": \"Search Index Helper\",\n \"description\": \"Hi! I can help you search the data within the indices starting with \\\"content-\\\" prefix.\",\n \"labels\": [\"custom-indices\", \"department-search\"],\n \"avatar_color\": \"#BFDBFF\",\n \"avatar_symbol\": \"SI\",\n \"configuration\": {\n \"instructions\": \"You are a custom agent that wants to help searching data using all indices starting with prefix \\\"content-\\\".\",\n \"tools\": [\n {\n \"tool_ids\": [\n \"platform.core.search\",\n \"platform.core.list_indices\",\n \"platform.core.get_index_mapping\",\n \"platform.core.get_document_by_id\"\n ]\n }\n ]\n }\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/agents/{agent_id}/consumption:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/agents/{agent_id}/consumption
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Returns paginated, per-conversation token consumption data for a given agent. Includes input/output token counts, round counts, LLM call counts, and warnings for conversations with high token usage. Requires the manageAgents privilege.
[Required authorization] Route required privileges: agentBuilder:manageAgents.'
operationId: post-agent-builder-agents-agent-id-consumption
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the agent.
in: path
name: agent_id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
consumptionDefaultExample:
description: Get consumption data for an agent with default pagination
value:
size: 25
sort_field: updated_at
sort_order: desc
consumptionFilteredExample:
description: Get consumption data filtered by username with warnings
value:
has_warnings: true
size: 10
sort_field: total_tokens
sort_order: desc
usernames:
- elastic
- admin
schema:
additionalProperties: false
type: object
properties:
has_warnings:
description: Filter to conversations with or without high-token warnings.
type: boolean
search:
description: Free-text search filter on conversation title.
type: string
search_after:
description: Cursor for pagination. Pass the search_after value from the previous response.
items:
nullable: true
maxItems: 10000
type: array
size:
default: 25
description: Number of results per page.
maximum: 100
minimum: 1
type: number
sort_field:
default: updated_at
description: Field to sort results by.
enum:
- updated_at
- total_tokens
- round_count
type: string
sort_order:
default: desc
description: Sort direction.
enum:
- asc
- desc
type: string
usernames:
description: Filter results to conversations by these usernames.
items:
type: string
maxItems: 10000
type: array
responses:
'200':
content:
application/json:
examples:
consumptionResponseExample:
description: Example response with per-conversation token usage data
value:
aggregations:
total_with_warnings: 0
usernames:
- elastic
- admin
results:
- conversation_id: conv-abc123
created_at: '2025-03-01T10:00:00Z'
llm_calls: 8
round_count: 5
title: Help me search my data
token_usage:
input_tokens: 15000
output_tokens: 3000
total_tokens: 18000
updated_at: '2025-03-01T10:15:00Z'
user:
id: uid-1
username: elastic
warnings: []
- conversation_id: conv-def456
created_at: '2025-03-02T14:00:00Z'
llm_calls: 20
round_count: 12
title: Analyze server logs
token_usage:
input_tokens: 250000
output_tokens: 8000
total_tokens: 258000
updated_at: '2025-03-02T14:30:00Z'
user:
id: uid-2
username: admin
warnings:
- input_tokens: 250000
round_id: round-7
type: high_input_tokens
search_after:
- 1709391000000
- '2025-03-02T14:30:00Z'
total: 2
description: Indicates a successful response
summary: Get agent consumption data
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"${KIBANA_URL}/api/agent_builder/agents/elastic-ai-agent/consumption\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"elastic-api-version: 2023-10-31\" \\\n -d '{\"size\": 25, \"sort_field\": \"updated_at\", \"sort_order\": \"desc\"}'\n"
- lang: Console
source: 'POST kbn://api/agent_builder/agents/elastic-ai-agent/consumption
{"size": 25, "sort_field": "updated_at", "sort_order": "desc"}
'
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/agents/{id}:
delete:
description: '**Spaces method and path for this operation:**
delete /s/{space_id}/api/agent_builder/agents/{id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Delete an agent by ID. This action cannot be undone. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).
[Required authorization] Route required privileges: agentBuilder:manageAgents.'
operationId: delete-agent-builder-agents-id
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the agent to delete.
in: path
name: id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
deleteAgentResponseExample:
description: Example response showing that deletion of the agent has been successful
value:
success: true
description: Indicates a successful response
summary: Delete an agent
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X DELETE \"${KIBANA_URL}/api/agent_builder/agents/{id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\"\n"
- lang: Console
source: 'DELETE kbn://api/agent_builder/agents/{id}
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/agents/{id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-agents-id
parameters:
- description: The unique identifier of the agent to retrieve.
in: path
name: id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
getAgentByIdResponseExample:
description: Example response that an agent created by the user that will query elasticsearch indices starting with 'content-' prefix to answer the questions.
value:
avatar_color: '#BFDBFF'
avatar_symbol: SI
configuration:
instructions: You are a custom agent that wants to help searching data using all indices starting with prefix "content-".
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Hi! I can help you search the data within the indices starting with "content-" prefix.
id: created-agent-id
labels:
- custom-indices
- department-search
name: Search Index Helper
type: chat
description: Indicates a successful response
summary: Get an agent by ID
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/agents/{id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/agents/{id}
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
put:
description: '**Spaces method and path for this operation:**
put /s/{space_id}/api/agent_builder/agents/{id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update an existing agent configuration. Use this endpoint to modify any aspect of the agent''s behavior, appearance, or capabilities. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).
[Required authorization] Route required privileges: agentBuilder:manageAgents.'
operationId: put-agent-builder-agents-id
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the agent to update.
in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
createAgentRequestExample:
description: Example request for updating custom agent
value:
avatar_color: '#BFDBFF'
avatar_symbol: SI
configuration:
instructions: You are a custom agent that wants to help searching data using all indices starting with prefix "content-".
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Updated description - Search for anything in "content-*" indices!
id: created-agent-id
labels:
- custom-indices
- department-search
- elastic-employees
name: Search Index Helper
schema:
additionalProperties: false
type: object
properties:
avatar_color:
description: Updated hex color code for the agent avatar.
type: string
avatar_symbol:
description: Updated symbol/initials for the agent avatar.
type: string
configuration:
additionalProperties: false
description: Updated configuration settings for the agent.
type: object
properties:
enable_elastic_capabilities:
description: When true, enables built-in Elastic capabilities for the agent.
type: boolean
instructions:
description: Updated system instructions that define the agent behavior.
type: string
plugin_ids:
description: Array of plugin IDs to assign to the agent.
items:
description: Plugin ID to assign to the agent.
type: string
maxItems: 100
type: array
skill_ids:
description: Array of skill IDs to be available to the agent.
items:
description: Skill ID to be available to the agent.
type: string
maxItems: 100
type: array
tools:
items:
additionalProperties: false
description: Tool selection configuration for the agent.
type: object
properties:
tool_ids:
description: Array of tool IDs that the agent can use.
items:
description: Tool ID to be available to the agent.
type: string
type: array
required:
- tool_ids
type: array
workflow_ids:
items:
description: Updated list of workflow IDs. When set, these workflows run every agent execution, in order.
type: string
maxItems: 100
type: array
description:
description: Updated description of what the agent does.
type: string
labels:
description: Updated labels for categorizing and organizing agents.
items:
description: Updated label for categorizing the agent.
type: string
type: array
name:
description: Updated display name for the agent.
type: string
visibility:
description: '**Technical Preview; added in 9.4.0.** Updated visibility setting: `public` (any privileged user can read/write), `shared` (any privileged user can read, only owner can write), `private` (only owner can read/write).'
enum:
- public
- shared
- private
type: string
responses:
'200':
content:
application/json:
examples:
updateAgentResponseExample:
description: Example response returning the agent definition with the changes applied from the request
value:
avatar_color: '#BFDBFF'
avatar_symbol: SI
configuration:
instructions: You are a custom agent that wants to help searching data using all indices starting with prefix "content-".
tools:
- tool_ids:
- platform.core.search
- platform.core.list_indices
- platform.core.get_index_mapping
- platform.core.get_document_by_id
description: Updated description - Search for anything in "content-*" indices!
id: created-agent-id
labels:
- custom-indices
- department-search
- elastic-employees
name: Search Index Helper
type: chat
description: Indicates a successful response
summary: Update an agent
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X PUT \"${KIBANA_URL}/api/agent_builder/agents/{id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Search Index Helper\",\n \"description\": \"Updated description - Search for anything in \\\"content-*\\\" indices!\",\n \"labels\": [\"custom-indices\", \"department-search\", \"elastic-employees\"],\n \"avatar_color\": \"#BFDBFF\",\n \"avatar_symbol\": \"SI\",\n \"configuration\": {\n \"instructions\": \"You are a custom agent that wants to help searching data using all indices starting with prefix \\\"content-\\\".\",\n \"tools\": [{\n \"tool_ids\": [\n \"platform.core.search\",\n \"platform.core.list_indices\",\n \"platform.core.get_index_mapping\",\n \"platform.core.get_document_by_id\"\n ]\n }]\n }\n }'\n"
- lang: Console
source: "PUT kbn://api/agent_builder/agents/{id}\n{\n \"name\": \"Search Index Helper\",\n \"description\": \"Updated description - Search for anything in \\\"content-*\\\" indices!\",\n \"labels\": [\"custom-indices\", \"department-search\", \"elastic-employees\"],\n \"avatar_color\": \"#BFDBFF\",\n \"avatar_symbol\": \"SI\",\n \"configuration\": {\n \"instructions\": \"You are a custom agent that wants to help searching data using all indices starting with prefix \\\"content-\\\".\",\n \"tools\": [{\n \"tool_ids\": [\n \"platform.core.search\",\n \"platform.core.list_indices\",\n \"platform.core.get_index_mapping\",\n \"platform.core.get_document_by_id\"\n ]\n }]\n }\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/conversations
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
List all conversations for a user. Use the optional agent ID to filter conversations by a specific agent.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-conversations
parameters:
- description: Optional agent ID to filter conversations by a specific agent.
in: query
name: agent_id
required: false
schema:
type: string
responses:
'200':
content:
application/json:
examples:
listConversationsResponseExample:
description: Example response containing the list of conversations with all agents
value:
results:
- agent_id: elastic-ai-agent
created_at: '2025-09-19T17:45:39.554Z'
id: bcc176c5-38f6-40be-be0c-898e34fa1480
title: General Greeting
updated_at: '2025-09-19T17:45:39.554Z'
user:
username: elastic
description: Indicates a successful response
summary: List conversations
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/conversations\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/conversations
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations/{conversation_id}:
delete:
description: '**Spaces method and path for this operation:**
delete /s/{space_id}/api/agent_builder/conversations/{conversation_id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Delete a conversation by ID. This action cannot be undone.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: delete-agent-builder-conversations-conversation-id
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation to delete.
in: path
name: conversation_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
deleteConversationResponseExample:
description: Example response showing that deletion of conversation has been successful
value:
success: true
description: Indicates a successful response
summary: Delete conversation by ID
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X DELETE \"${KIBANA_URL}/api/agent_builder/conversations/{conversation_id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\"\n"
- lang: Console
source: 'DELETE kbn://api/agent_builder/conversations/{conversation_id}
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/conversations/{conversation_id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Get a specific conversation by ID. Use this endpoint to retrieve the complete conversation history including all messages and metadata.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-conversations-conversation-id
parameters:
- description: The unique identifier of the conversation to retrieve.
in: path
name: conversation_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
getConversationByIdResponseExample:
description: Example response containing the contents of a convesation with the chat agent
value:
agent_id: elastic-ai-agent
created_at: '2025-09-19T17:45:39.554Z'
id: bcc176c5-38f6-40be-be0c-898e34fa1480
rounds:
- id: 170ec3b2-0f5a-4538-8b60-549572386d2a
input:
message: Hello, how are you?
response:
message: 'Since this is a general greeting that doesn''t require any organizational or product-specific information, I can respond without using tools.
Hello! I''m doing well, thank you for asking. I''m here to help you with any questions you may have. How can I assist you today?'
steps: []
title: General Greeting
updated_at: '2025-09-19T17:45:39.554Z'
user:
username: elastic
description: Indicates a successful response
summary: Get conversation by ID
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/conversations/{conversation_id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/conversations/{conversation_id}
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations/{conversation_id}/attachments:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
List all attachments for a conversation. Use the optional include_deleted query parameter to include soft-deleted attachments.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-conversations-conversation-id-attachments
parameters:
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
- description: Whether to include deleted attachments in the list.
in: query
name: include_deleted
required: false
schema:
type: boolean
responses:
'200':
content:
application/json:
examples:
listAttachmentsResponseExample:
description: Example response containing active attachments for a conversation
value:
results:
- active: true
current_version: 2
description: My text file
id: attachment-1
type: text
versions:
- content_hash: abc123
created_at: '2025-01-01T10:00:00.000Z'
data: Initial content
estimated_tokens: 3
version: 1
- content_hash: def456
created_at: '2025-01-01T11:00:00.000Z'
data: Updated content
estimated_tokens: 3
version: 2
- active: true
current_version: 1
description: Configuration data
id: attachment-2
type: json
versions:
- content_hash: ghi789
created_at: '2025-01-01T12:00:00.000Z'
data:
key: value
nested:
field: 123
estimated_tokens: 15
version: 1
total_token_estimate: 21
description: Indicates a successful response
summary: List conversation attachments
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Create a new attachment for a conversation with version tracking.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: post-agent-builder-conversations-conversation-id-attachments
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
createHiddenAttachmentExample:
description: Example request for creating a hidden attachment
value:
data: Internal system data
description: System context
hidden: true
type: text
createJsonAttachmentExample:
description: Example request for creating a JSON attachment with custom ID
value:
data:
configuration:
enabled: true
threshold: 50
metadata:
source: user_input
description: Application settings
id: custom-attachment-id
type: json
createTextAttachmentExample:
description: Example request for creating a text attachment
value:
data: This is the content of my text attachment
description: Meeting notes
type: text
schema:
additionalProperties: false
type: object
properties:
data:
description: The attachment data/content. Required unless origin is provided.
nullable: true
description:
description: Human-readable description of the attachment.
type: string
hidden:
description: Whether the attachment should be hidden from the user.
type: boolean
id:
description: Optional custom ID for the attachment.
type: string
origin:
description: Origin string (for example, saved object ID) for by-reference attachments. When provided without data, the content is resolved once at creation time.
type: string
type:
description: The type of the attachment (e.g., text, esql, visualization).
type: string
required:
- type
- data
responses:
'200':
content:
application/json:
examples:
createAttachmentResponseExample:
description: Example response returning the created attachment
value:
attachment:
active: true
current_version: 1
description: Meeting notes
id: att-abc123
type: text
versions:
- content_hash: sha256-xyz
created_at: '2025-01-06T10:00:00.000Z'
data: This is the content of my text attachment
estimated_tokens: 12
version: 1
description: Indicates a successful response
summary: Create conversation attachment
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}:
delete:
description: '**Spaces method and path for this operation:**
delete /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Delete an attachment. By default performs a soft delete (can be restored). Use permanent=true to permanently remove unreferenced attachments.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: delete-agent-builder-conversations-conversation-id-attachments-attachment-id
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
- description: The unique identifier of the attachment to delete.
in: path
name: attachment_id
required: true
schema:
type: string
- description: If true, permanently removes the attachment (only for unreferenced attachments).
in: query
name: permanent
required: false
schema:
type: boolean
responses:
'200':
content:
application/json:
examples:
permanentDeleteAttachmentResponseExample:
description: Example response for permanent delete (cannot be restored)
value:
permanent: true
success: true
softDeleteAttachmentResponseExample:
description: Example response for soft delete (can be restored)
value:
permanent: false
success: true
description: Indicates a successful response
summary: Delete conversation attachment
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
patch:
description: '**Spaces method and path for this operation:**
patch /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Rename an attachment without creating a new version.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: patch-agent-builder-conversations-conversation-id-attachments-attachment-id
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
- description: The unique identifier of the attachment to rename.
in: path
name: attachment_id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
renameAttachmentExample:
description: Example request for renaming an attachment
value:
description: Updated attachment name
schema:
additionalProperties: false
type: object
properties:
description:
description: The new description/name for the attachment.
type: string
required:
- description
responses:
'200':
content:
application/json:
examples:
renameAttachmentResponseExample:
description: Example response returning the renamed attachment (version unchanged)
value:
attachment:
active: true
current_version: 1
description: Updated attachment name
id: att-abc123
type: text
versions:
- content_hash: sha256-xyz
created_at: '2025-01-06T10:00:00.000Z'
data: Content remains the same
estimated_tokens: 10
version: 1
success: true
description: Indicates a successful response
summary: Rename attachment
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
put:
description: '**Spaces method and path for this operation:**
put /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update an attachment content. Creates a new version if content changed.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: put-agent-builder-conversations-conversation-id-attachments-attachment-id
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
- description: The unique identifier of the attachment to update.
in: path
name: attachment_id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
updateAttachmentContentExample:
description: Example request for updating attachment content
value:
data: This is the updated content
updateAttachmentWithDescriptionExample:
description: Example request for updating both content and description
value:
data: New content version
description: Updated meeting notes - v2
schema:
additionalProperties: false
type: object
properties:
data:
description: The new attachment data/content.
nullable: true
description:
description: Optional new description for the attachment.
type: string
required:
- data
responses:
'200':
content:
application/json:
examples:
updateAttachmentResponseExample:
description: Example response returning the updated attachment with new version
value:
attachment:
active: true
current_version: 2
description: Meeting notes
id: att-abc123
type: text
versions:
- content_hash: sha256-abc
created_at: '2025-01-06T10:00:00.000Z'
data: Original content
estimated_tokens: 10
version: 1
- content_hash: sha256-def
created_at: '2025-01-06T11:00:00.000Z'
data: This is the updated content
estimated_tokens: 12
version: 2
new_version: 2
description: Indicates a successful response
summary: Update conversation attachment
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/_restore:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/_restore
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Restore a soft-deleted attachment.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: post-agent-builder-conversations-conversation-id-attachments-attachment-id-restore
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
- description: The unique identifier of the attachment to restore.
in: path
name: attachment_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
restoreAttachmentResponseExample:
description: Example response returning the restored attachment
value:
attachment:
active: true
current_version: 1
description: Restored attachment
id: att-abc123
type: text
versions:
- content_hash: sha256-xyz
created_at: '2025-01-06T10:00:00.000Z'
data: Restored content
estimated_tokens: 10
version: 1
success: true
description: Indicates a successful response
summary: Restore deleted attachment
tags:
- agent builder
x-state: Technical Preview; added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin:
put:
description: '**Spaces method and path for this operation:**
put /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/origin
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update the origin reference for an attachment. Use this after saving a by-value attachment to link it to its persistent store.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: put-agent-builder-conversations-conversation-id-attachments-attachment-id-origin
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
- description: The unique identifier of the attachment to update.
in: path
name: attachment_id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
updateOriginExample:
description: Example request for linking an attachment to a saved visualization
value:
origin: abc123
schema:
additionalProperties: false
type: object
properties:
origin:
description: The origin string (e.g., saved object ID for visualizations and dashboards).
type: string
required:
- origin
responses:
'200':
content:
application/json:
examples:
updateOriginResponseExample:
description: Example response returning the attachment with updated origin
value:
attachment:
active: true
current_version: 1
description: Sales chart
id: att-123
origin: abc123
type: visualization
versions:
- content_hash: sha256-xyz
created_at: '2025-01-06T10:00:00.000Z'
data:
chart_type: bar
esql: FROM sales | STATS count=COUNT(*) BY month
query: Show monthly sales
visualization: {}
estimated_tokens: 50
version: 1
success: true
description: Indicates a successful response
summary: Update attachment origin
tags:
- agent builder
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/conversations/{conversation_id}/attachments/stale:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/stale
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Checks staleness for the latest version of all conversation attachments against their origin snapshot.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-conversations-conversation-id-attachments-stale
parameters:
- description: The unique identifier of the conversation.
in: path
name: conversation_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
checkStaleAttachmentsResponseExample:
description: 'Mixed conversation: attachments without a stale source return only id and is_stale. When a staleness check fails for one attachment, is_stale is false and an error explains why. When an origin-backed attachment is out of date, the response includes type, origin, and resolved data (here a simple text body) for resync.'
value:
attachments:
- id: att-text-meeting-notes
is_stale: false
- id: att-lens-active-users
is_stale: false
- error: Origin could not be resolved
id: att-query-attachment
is_stale: false
- data: This is the content of my text attachment
hidden: false
id: att-text-runbook
is_stale: true
origin: document:hr-onboarding-v2
type: text
description: Indicates a successful response
summary: Check attachment staleness
tags:
- agent builder
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/converse:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/converse
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/chat).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: post-agent-builder-converse
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
examples:
converseRequestExample:
description: Example request to send a message to the agent as a part of the conversation
value:
agent_id: elastic-ai-agent
connector_id: my-connector-id
input: What is Elasticsearch?
converseRequestInferenceExample:
description: Example using inference_id (mutually exclusive with connector_id)
value:
agent_id: elastic-ai-agent
inference_id: my-inference-endpoint-id
input: What is Elasticsearch?
schema:
additionalProperties: false
type: object
properties:
_execution_mode:
description: '**Experimental; added in 9.4.0.** define how to execute the agent (local execution or via task_manager)'
enum:
- local
- task_manager
type: string
action:
description: The action to perform. "regenerate" re-executes the last round with the original input. Requires conversation_id.
enum:
- regenerate
type: string
agent_id:
default: elastic-ai-agent
description: The ID of the agent to chat with. Defaults to the default Elastic AI agent.
type: string
attachments:
description: '**Technical Preview; added in 9.3.0.** Optional attachments to send with the message.'
items:
additionalProperties: false
type: object
properties:
data:
additionalProperties:
nullable: true
description: Payload of the attachment. Required unless `origin` is provided (content is resolved once at send time).
type: object
hidden:
description: When true, the attachment will not be displayed in the UI.
type: boolean
id:
description: Optional id for the attachment.
type: string
origin:
description: Origin string (for example, saved object ID) for by-reference attachments. When provided without `data`, the content is resolved once using the attachment type’s `resolve` hook.
type: string
type:
description: Type of the attachment.
type: string
required:
- type
type: array
browser_api_tools:
description: Optional browser API tools to be registered as LLM tools with browser.* namespace. These tools execute on the client side.
items:
additionalProperties: false
type: object
properties:
description:
description: Description of what the browser API tool does.
type: string
id:
description: Unique identifier for the browser API tool.
type: string
schema:
description: JSON Schema defining the tool parameters (JsonSchema7Type).
nullable: true
required:
- id
- description
- schema
type: array
capabilities:
additionalProperties: false
description: Controls agent capabilities during conversation. Currently supports visualization rendering for tabular tool results.
type: object
properties:
visualizations:
description: When true, allows the agent to render tabular data from tool results as interactive visualizations using custom XML elements in responses.
type: boolean
configuration_overrides:
additionalProperties: false
description: Runtime configuration overrides. These override the stored agent configuration for this execution only.
type: object
properties:
instructions:
description: Custom instructions for the agent.
type: string
tools:
description: Tool selection to enable for this execution.
items:
additionalProperties: false
type: object
properties:
tool_ids:
items:
type: string
type: array
required:
- tool_ids
type: array
connector_id:
description: Optional connector ID for the agent to use for model routing. Mutually exclusive with `inference_id`; omit or use only one.
nullable: true
type: string
conversation_id:
description: Optional existing conversation ID to continue a previous conversation.
type: string
inference_id:
description: Optional inference endpoint ID for model routing (public alias for the same internal identifier as `connector_id`). Mutually exclusive with `connector_id`.
nullable: true
type: string
input:
description: The user input message to send to the agent.
type: string
prompts:
additionalProperties:
additionalProperties: false
type: object
properties:
allow:
type: boolean
required:
- allow
description: Can be used to respond to a confirmation prompt.
type: object
responses:
'200':
content:
application/json:
examples:
converseResponseExample:
description: Example response containing the chain of events representing a conversation with the agent
value:
conversation_id: 696ccd6d-4bff-4b26-a62e-522ccf2dcd16
response:
message: Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease.
steps:
- reasoning: Searching for official documentation or content that explains what Elasticsearch is
type: reasoning
- params:
query: what is elasticsearch definition overview introduction
progression:
- message: Selecting the best target for this query
results:
- data:
message: Could not figure out which index to use
type: error
tool_call_id: tooluse_shOdUwKIRwC9YhqGzeg0cQ
tool_id: platform.core.search
type: tool_call
description: Indicates a successful response
summary: Send chat message
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"${KIBANA_URL}/api/agent_builder/converse\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input\": \"What is Elasticsearch?\",\n \"agent_id\": \"elastic-ai-agent\"}'\n"
- lang: Console
source: "POST kbn://api/agent_builder/converse\n{\n \"input\": \"What is Elasticsearch?\",\n \"agent_id\": \"elastic-ai-agent\"\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/converse/async:
post:
description: "**Spaces method and path for this operation:**\n\npost /s/{space_id}/api/agent_builder/converse/async
\n\nRefer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.\n\nSend a message to an agent and receive real-time streaming events. This asynchronous endpoint provides live updates as the agent processes your request, allowing you to see intermediate steps and progress. Use this for interactive experiences where you want to monitor the agent's thinking process.\n\n## Event types\n\nThe endpoint emits Server-Sent Events (SSE) with the following custom event types:\n\n`conversation_id_set`\n\nSets the conversation ID.\n\nSchema:\n```json\n{\n \"conversation_id\": \"uuid\"\n}\n```\n\n---\n\n`conversation_created`\n\nFires when a new conversation is persisted and assigned an ID.\n\nSchema:\n```json\n{\n \"conversation_id\": \"uuid\",\n \"title\": \"conversation title\"\n}\n```\n\n---\n\n`conversation_updated`\n\nFires when a conversation is updated.\n\nSchema:\n```json\n{\n \"conversation_id\": \"uuid\",\n \"title\": \"updated conversation title\"\n}\n```\n\n---\n\n`reasoning`\n\nHandles reasoning-related data.\n\nSchema:\n```json\n{\n \"reasoning\": \"plain text reasoning content\",\n \"transient\": false\n}\n```\n\n---\n\n`tool_call`\n\nTriggers when a tool is invoked.\n\nSchema:\n```json\n{\n \"tool_call_id\": \"uuid\",\n \"tool_id\": \"tool_name\",\n \"params\": {}\n}\n```\n\n---\n\n`tool_progress`\n\nReports progress of a running tool.\n\nSchema:\n```json\n{\n \"tool_call_id\": \"uuid\",\n \"message\": \"progress message\"\n}\n```\n\n---\n\n`tool_result`\n\nReturns results from a completed tool call.\n\nSchema:\n```json\n{\n \"tool_call_id\": \"uuid\",\n \"tool_id\": \"tool_name\",\n \"results\": []\n}\n```\n\n**Note:** `results` is an array of `ToolResult` objects.\n\n---\n\n`message_chunk`\n\nStreams partial text chunks.\n\nSchema:\n```json\n{\n \"message_id\": \"uuid\",\n \"text_chunk\": \"partial text\"\n}\n```\n\n---\n\n`message_complete`\n\nIndicates message stream is finished.\n\nSchema:\n```json\n{\n \"message_id\": \"uuid\",\n \"message_content\": \"full text content of the message\"\n}\n```\n\n---\n\n`thinking_complete`\n\nMarks the end of the thinking/reasoning phase.\n\nSchema:\n```json\n{\n \"time_to_first_token\": 0\n}\n```\n\n**Note:** `time_to_first_token` is in milliseconds.\n\n---\n\n`round_complete`\n\nMarks end of one conversation round.\n\nSchema:\n```json\n{\n \"round\": {}\n}\n```\n\n**Note:** `round` contains the full round json object.\n\n---\n\n## Event flow\n\nA typical conversation round emits events in this sequence:\n\n1. `reasoning` (potentially multiple, some transient)\n2. `tool_call` (if tools are used)\n3. `tool_progress` (zero or more progress updates)\n4. `tool_result` (when tool completes)\n5. `thinking_complete`\n6. `message_chunk` (multiple, as text streams)\n7. `message_complete`\n8. `round_complete`\n\n
[Required authorization] Route required privileges: agentBuilder:read."
operationId: post-agent-builder-converse-async
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
examples:
converseAsyncRequestExample:
description: Example request to send a message to the agent as a part of the conversation
value:
agent_id: elastic-ai-agent
conversation_id: c250305b-1929-4248-b568-b9e3f065fda5
input: Hello
converseAsyncRequestInferenceExample:
description: Example using inference_id (mutually exclusive with connector_id)
value:
agent_id: elastic-ai-agent
inference_id: my-inference-endpoint-id
input: Hello
schema:
additionalProperties: false
type: object
properties:
_execution_mode:
description: '**Experimental; added in 9.4.0.** define how to execute the agent (local execution or via task_manager)'
enum:
- local
- task_manager
type: string
action:
description: The action to perform. "regenerate" re-executes the last round with the original input. Requires conversation_id.
enum:
- regenerate
type: string
agent_id:
default: elastic-ai-agent
description: The ID of the agent to chat with. Defaults to the default Elastic AI agent.
type: string
attachments:
description: '**Technical Preview; added in 9.3.0.** Optional attachments to send with the message.'
items:
additionalProperties: false
type: object
properties:
data:
additionalProperties:
nullable: true
description: Payload of the attachment. Required unless `origin` is provided (content is resolved once at send time).
type: object
hidden:
description: When true, the attachment will not be displayed in the UI.
type: boolean
id:
description: Optional id for the attachment.
type: string
origin:
description: Origin string (for example, saved object ID) for by-reference attachments. When provided without `data`, the content is resolved once using the attachment type’s `resolve` hook.
type: string
type:
description: Type of the attachment.
type: string
required:
- type
type: array
browser_api_tools:
description: Optional browser API tools to be registered as LLM tools with browser.* namespace. These tools execute on the client side.
items:
additionalProperties: false
type: object
properties:
description:
description: Description of what the browser API tool does.
type: string
id:
description: Unique identifier for the browser API tool.
type: string
schema:
description: JSON Schema defining the tool parameters (JsonSchema7Type).
nullable: true
required:
- id
- description
- schema
type: array
capabilities:
additionalProperties: false
description: Controls agent capabilities during conversation. Currently supports visualization rendering for tabular tool results.
type: object
properties:
visualizations:
description: When true, allows the agent to render tabular data from tool results as interactive visualizations using custom XML elements in responses.
type: boolean
configuration_overrides:
additionalProperties: false
description: Runtime configuration overrides. These override the stored agent configuration for this execution only.
type: object
properties:
instructions:
description: Custom instructions for the agent.
type: string
tools:
description: Tool selection to enable for this execution.
items:
additionalProperties: false
type: object
properties:
tool_ids:
items:
type: string
type: array
required:
- tool_ids
type: array
connector_id:
description: Optional connector ID for the agent to use for model routing. Mutually exclusive with `inference_id`; omit or use only one.
nullable: true
type: string
conversation_id:
description: Optional existing conversation ID to continue a previous conversation.
type: string
inference_id:
description: Optional inference endpoint ID for model routing (public alias for the same internal identifier as `connector_id`). Mutually exclusive with `connector_id`.
nullable: true
type: string
input:
description: The user input message to send to the agent.
type: string
prompts:
additionalProperties:
additionalProperties: false
type: object
properties:
allow:
type: boolean
required:
- allow
description: Can be used to respond to a confirmation prompt.
type: object
responses:
'200':
content:
text/event-stream:
examples:
converseAsyncResponseExample:
description: Example stream containing the chain of events representing a conversation with the agent
value:
- data:
data:
conversation_id: c250305b-1929-4248-b568-b9e3f065fda5
event: conversation_id_set
- data:
data:
reasoning: Starting with a general search to understand what content is available.
event: reasoning
- data:
data:
params:
query: latest documents
tool_call_id: tooluse__2aJELgyRYqD8SDOKSiwtg
tool_id: platform.core.search
event: tool_call
- data:
data:
results:
- data:
message: Could not figure out which index to use
type: error
tool_call_id: tooluse__2aJELgyRYqD8SDOKSiwtg
event: tool_result
- data:
data:
round:
id: a5692d54-bc06-4a6e-aea1-412779c73f66
input:
message: Hello
response:
message: Hello! How can I help you today?
event: round_complete
description: Indicates a successful response
summary: Send chat message (streaming)
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"${KIBANA_URL}/api/agent_builder/converse/async\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input\": \"Hello again let us have an async chat\",\n \"agent_id\": \"elastic-ai-agent\",\n \"conversation_id\": \"\"\n }'\n"
- lang: Console
source: "POST kbn://api/agent_builder/converse/async\n{\n \"input\": \"Hello again let's have an async chat\",\n \"agent_id\": \"elastic-ai-agent\",\n \"conversation_id\": \"\"\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/mcp:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/mcp
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
> warn
> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.
To learn more, refer to the [MCP documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: post-agent-builder-mcp
parameters:
- description: Comma-separated list of namespaces to filter tools. Only tools matching the specified namespaces will be returned.
in: query
name: namespace
required: false
schema:
type: string
requestBody:
content:
application/json:
examples:
mcpInitializeRequestExample:
description: 'WARNING: DO NOT USE THIS ENDPOINT VIA REST API. These examples are auto-generated and should not be run. Integrate with MCP using MCP Inspector or native MCP clients (Claude Desktop, Cursor, VS Code) instead.'
value:
id: 1
jsonrpc: '2.0'
method: initialize
params:
capabilities: {}
clientInfo:
name: test-client
version: 1.0.0
protocolVersion: '2024-11-05'
schema: {}
responses:
'200':
content:
application/json:
examples:
mcpInitializeResponseExample:
description: Example response showing the successful result of communication initialisation over MCP protocol
value:
id: 1
jsonrpc: '2.0'
result:
capabilities:
tools:
listChanged: true
protocolVersion: '2024-11-05'
serverInfo:
name: elastic-mcp-server
version: 0.0.1
description: Indicates a successful response
summary: MCP server
tags:
- agent builder
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/plugins:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/plugins
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
List all installed plugins and their managed assets. Plugins are installable packages that bundle agent capabilities such as skills, following the [Claude agent plugin specification](https://code.claude.com/docs/en/plugins).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-plugins
parameters: []
responses:
'200':
content:
application/json:
examples:
listPluginsResponseExample:
description: Example response that returns one installed plugin
value:
results:
- created_at: '2025-01-01T00:00:00.000Z'
description: Financial analysis tools and skills for Claude
id: financial-analysis
manifest:
author:
name: Anthropic
url: https://www.anthropic.com
keywords:
- finance
- analysis
repository: https://github.com/anthropics/financial-services-plugins
name: financial-analysis
skill_ids:
- financial-analysis-analyze-portfolio
source_url: https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis
unmanaged_assets:
agents: []
hooks: []
lsp_servers: []
mcp_servers: []
output_styles: []
updated_at: '2025-01-01T00:00:00.000Z'
version: 1.0.0
description: Indicates a successful response
summary: List plugins
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/plugins\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/plugins
'
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/plugins/{pluginId}:
delete:
description: '**Spaces method and path for this operation:**
delete /s/{space_id}/api/agent_builder/plugins/{pluginId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Delete an installed plugin by ID. This action cannot be undone.
[Required authorization] Route required privileges: agentBuilder:write.'
operationId: delete-agent-builder-plugins-pluginid
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the plugin.
in: path
name: pluginId
required: true
schema:
type: string
- description: If true, removes the plugin skills from agents that use them and then deletes the plugin. If false and any agent uses the plugin skills, the request returns 409 Conflict with the list of agents.
in: query
name: force
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
application/json:
examples:
deletePluginResponseExample:
description: Example response showing that deletion of the plugin has been successful
value:
success: true
description: Indicates a successful response
summary: Delete a plugin
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X DELETE \"${KIBANA_URL}/api/agent_builder/plugins/{id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\"\n"
- lang: Console
source: 'DELETE kbn://api/agent_builder/plugins/{id}
'
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/plugins/{pluginId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Get a specific plugin by ID.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-plugins-pluginid
parameters:
- description: The unique identifier of the plugin.
in: path
name: pluginId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
getPluginByIdResponseExample:
description: Example response returning a single installed plugin
value:
created_at: '2025-01-01T00:00:00.000Z'
description: Financial analysis tools and skills for Claude
id: financial-analysis
manifest:
author:
name: Anthropic
url: https://www.anthropic.com
keywords:
- finance
- analysis
repository: https://github.com/anthropics/financial-services-plugins
name: financial-analysis
skill_ids:
- financial-analysis-analyze-portfolio
source_url: https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis
unmanaged_assets:
agents: []
hooks: []
lsp_servers: []
mcp_servers: []
output_styles: []
updated_at: '2025-01-01T00:00:00.000Z'
version: 1.0.0
description: Indicates a successful response
summary: Get a plugin by id
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"${KIBANA_URL}/api/agent_builder/plugins/{id}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn://api/agent_builder/plugins/{id}
'
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/plugins/install:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/plugins/install
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Install a plugin from a [GitHub Claude plugin URL](https://code.claude.com/docs/en/plugins) or a direct ZIP URL. Plugins bundle agent capabilities such as skills.
[Required authorization] Route required privileges: agentBuilder:write.'
operationId: post-agent-builder-plugins-install
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
examples:
installPluginFromGithubExample:
description: Example request for installing a plugin from a GitHub URL
value:
url: https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis
installPluginFromZipExample:
description: Example request for installing a plugin from a direct zip URL
value:
url: https://my-server.example.com/my-plugin.zip
installPluginWithNameOverrideExample:
description: Example request for installing a plugin with a custom name
value:
plugin_name: my-custom-plugin-name
url: https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis
schema:
additionalProperties: false
type: object
properties:
plugin_name:
description: Optional name override for the plugin. Defaults to the manifest name.
type: string
url:
description: URL to install the plugin from (GitHub URL or direct zip URL).
type: string
required:
- url
responses:
'200':
content:
application/json:
examples:
installPluginResponseExample:
description: Example response returning the definition of the installed plugin
value:
created_at: '2025-01-01T00:00:00.000Z'
description: Financial analysis tools and skills for Claude
id: financial-analysis
manifest:
author:
name: Anthropic
url: https://www.anthropic.com
keywords:
- finance
- analysis
repository: https://github.com/anthropics/financial-services-plugins
name: financial-analysis
skill_ids:
- financial-analysis-analyze-portfolio
source_url: https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis
unmanaged_assets:
agents: []
hooks: []
lsp_servers: []
mcp_servers: []
output_styles: []
updated_at: '2025-01-01T00:00:00.000Z'
version: 1.0.0
description: Indicates a successful response
summary: Install a plugin
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"${KIBANA_URL}/api/agent_builder/plugins/install\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"url\": \"https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis\"\n}'\n"
- lang: Console
source: "POST kbn://api/agent_builder/plugins/install\n{\n \"url\": \"https://github.com/anthropics/financial-services-plugins/tree/main/financial-analysis\"\n}\n"
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/skills:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/skills
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
List all available skills (built-in and user-created).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-skills
parameters:
- description: Set to true to include skills from plugins.
in: query
name: include_plugins
required: false
schema:
default: false
type: boolean
responses: {}
summary: List skills
tags:
- agent builder
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/skills
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Create a new user-defined skill.
[Required authorization] Route required privileges: agentBuilder:manageSkills.'
operationId: post-agent-builder-skills
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
content:
description: Skill instructions content (markdown).
type: string
description:
description: Description of what the skill does.
type: string
id:
description: Unique identifier for the skill.
type: string
name:
description: Human-readable name for the skill.
type: string
referenced_content:
items:
additionalProperties: false
type: object
properties:
content:
description: Content of the reference.
type: string
name:
description: Name of the referenced content.
type: string
relativePath:
description: Relative path of the referenced content.
type: string
required:
- name
- relativePath
- content
maxItems: 100
type: array
tool_ids:
default: []
description: Tool IDs from the tool registry that this skill references.
items:
description: Tool ID from the tool registry.
type: string
maxItems: 100
type: array
required:
- id
- name
- description
- content
responses: {}
summary: Create a skill
tags:
- agent builder
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/skills/{skillId}:
delete:
description: '**Spaces method and path for this operation:**
delete /s/{space_id}/api/agent_builder/skills/{skillId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Delete a user-created skill by ID. If agents still reference the skill, the request returns 409 unless force=true, which removes the skill from agents first. Built-in skills cannot be deleted.
[Required authorization] Route required privileges: agentBuilder:manageSkills.'
operationId: delete-agent-builder-skills-skillid
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the skill.
in: path
name: skillId
required: true
schema:
maxLength: 512
minLength: 1
type: string
- description: If true, removes the skill from agents that use it and then deletes it. If false and any agent uses the skill, the request returns 409 Conflict with the list of agents.
in: query
name: force
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
application/json:
examples:
deleteSkillResponseExample:
description: Example response showing that the deletion operation was successful
value:
success: true
description: Indicates a successful response
summary: Delete a skill
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X DELETE \"https://${KIBANA_URL}/api/agent_builder/skills/{skillId}?force=false\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\"\n"
- lang: Console
source: 'DELETE kbn:/api/agent_builder/skills/{skillId}
'
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/skills/{skillId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Get a specific skill by ID.
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-skills-skillid
parameters:
- description: The unique identifier of the skill.
in: path
name: skillId
required: true
schema:
maxLength: 512
minLength: 1
type: string
responses: {}
summary: Get a skill by id
tags:
- agent builder
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
put:
description: '**Spaces method and path for this operation:**
put /s/{space_id}/api/agent_builder/skills/{skillId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update an existing user-created skill.
[Required authorization] Route required privileges: agentBuilder:manageSkills.'
operationId: put-agent-builder-skills-skillid
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the skill.
in: path
name: skillId
required: true
schema:
maxLength: 512
minLength: 1
type: string
requestBody:
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
content:
description: Updated skill instructions content.
type: string
description:
description: Updated description.
type: string
name:
description: Updated name for the skill.
type: string
referenced_content:
items:
additionalProperties: false
type: object
properties:
content:
description: Content of the reference.
type: string
name:
description: Name of the referenced content.
type: string
relativePath:
description: Relative path of the referenced content.
type: string
required:
- name
- relativePath
- content
maxItems: 100
type: array
tool_ids:
description: Updated tool IDs from the tool registry.
items:
description: Updated tool ID.
type: string
maxItems: 100
type: array
responses: {}
summary: Update a skill
tags:
- agent builder
x-state: Technical Preview; added in 9.4.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/tools:
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/tools
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-tools
parameters: []
responses:
'200':
content:
application/json:
examples:
listToolsResponseExample:
description: Example response returning a list of existing tools
value:
results:
- configuration: {}
description: "A powerful tool for searching and analyzing data within your Elasticsearch cluster.\nIt supports both full-text relevance searches and structured analytical queries.\n\nUse this tool for any query that involves finding documents, counting, aggregating, or summarizing data from a known index.\n\nExamples of queries:\n- \"find articles about serverless architecture\"\n- \"search for support tickets mentioning 'billing issue' or 'refund request'\"\n- \"what is our policy on parental leave?\"\n- \"list all products where the category is 'electronics'\"\n- \"show me the last 5 documents from that index\"\n- \"show me the sales over the last year break down by month\"\n\nNote:\n- The 'index' parameter can be used to specify which index to search against.\n If not provided, the tool will decide itself which is the best index to use.\n- It is perfectly fine not to specify the 'index' parameter. It should only be specified when you already\n know about the index and fields you want to search on, e.g. if the user explicitly specified it."
id: platform.core.search
readonly: true
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
index:
description: (optional) Index to search against. If not provided, will automatically select the best index to use based on the query.
type: string
query:
description: A natural language query expressing the search request
type: string
required:
- query
tags: []
type: builtin
- configuration: {}
description: Retrieve the full content (source) of an Elasticsearch document based on its ID and index name.
id: platform.core.get_document_by_id
readonly: true
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
id:
description: ID of the document to retrieve
type: string
index:
description: Name of the index to retrieve the document from
type: string
required:
- id
- index
tags: []
type: builtin
- configuration: {}
description: 'Execute an ES|QL query and return the results in a tabular format.
**IMPORTANT**: This tool only **runs** queries; it does not write them.
Think of this as the final step after a query has been prepared.
You **must** get the query from one of two sources before calling this tool:
1. The output of the `platform.core.generate_esql` tool (if the tool is available).
2. A verbatim query provided directly by the user.
Under no circumstances should you invent, guess, or modify a query yourself for this tool.
If you need a query, use the `platform.core.generate_esql` tool first.'
id: platform.core.execute_esql
readonly: true
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
query:
description: The ES|QL query to execute
type: string
required:
- query
tags: []
type: builtin
- configuration:
params:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
type: date
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit
description: Example ES|QL query tool for analyzing financial trades with time filtering
id: example-esql-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
description: Parameters needed to execute the query
type: object
properties:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
format: date-time
type: string
required:
- startTime
- limit
tags:
- analytics
- finance
type: esql
- configuration:
pattern: financial_*
description: Search tool specifically for financial data analysis and reporting
id: example-index-search-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
nlQuery:
description: A natural language query expressing the search request
type: string
required:
- nlQuery
tags:
- search
- finance
type: index_search
description: Indicates a successful response
summary: List tools
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"https://${KIBANA_URL}/api/agent_builder/tools\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn:/api/agent_builder/tools
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/tools
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).
[Required authorization] Route required privileges: agentBuilder:manageTools.'
operationId: post-agent-builder-tools
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
examples:
createEsqlToolRequest:
description: Example request to create an ESQL query tool with a pre-defined query
value:
configuration:
params:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
type: date
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit
description: Example ES|QL query tool for analyzing financial trades with time filtering
id: example-esql-tool
tags:
- analytics
- finance
type: esql
createIndexSearchToolRequest:
description: Example request to create an index_search tool with a pre-defined index pattern
value:
configuration:
pattern: financial_*
description: Search tool specifically for financial data analysis and reporting
id: example-index-search-tool
tags:
- search
- finance
type: index_search
schema:
additionalProperties: false
type: object
properties:
configuration:
additionalProperties:
nullable: true
description: Tool-specific configuration parameters. See examples for details.
type: object
description:
default: ''
description: Description of what the tool does.
type: string
id:
description: Unique identifier for the tool.
type: string
tags:
default: []
description: Optional tags for categorizing and organizing tools.
items:
description: Tag for categorizing the tool.
type: string
type: array
type:
description: The type of tool to create (e.g., esql, index_search).
enum:
- esql
- index_search
- workflow
- mcp
type: string
required:
- id
- type
- configuration
responses:
'200':
content:
application/json:
examples:
createEsqlToolExample:
description: Example response returning a definition of ESQL tool created
value:
configuration:
params:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
type: date
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit
description: Example ES|QL query tool for analyzing financial trades with time filtering
id: example-esql-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
description: Parameters needed to execute the query
type: object
properties:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
format: date-time
type: string
required:
- startTime
- limit
tags:
- analytics
- finance
type: esql
createIndexSearchToolExample:
description: Example response returning a definition of search tool tool created
value:
configuration:
pattern: financial_*
description: Search tool specifically for financial data analysis and reporting
id: example-index-search-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
nlQuery:
description: A natural language query expressing the search request
type: string
required:
- nlQuery
tags:
- search
- finance
type: index_search
description: Indicates a successful response
summary: Create a tool
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"https://${KIBANA_URL}/api/agent_builder/tools\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"id\": \"example-esql-tool\",\n \"type\": \"esql\",\n \"description\": \"Example ES|QL query tool for analyzing financial trades with time filtering\",\n \"tags\": [\"analytics\", \"finance\"],\n \"configuration\": {\n \"query\": \"FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit\",\n \"params\": {\n \"startTime\": {\n \"type\": \"date\",\n \"description\": \"Start time for the analysis in ISO format\"\n },\n \"limit\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results to return\"\n }\n }\n }\n }'\n"
- lang: Console
source: "POST kbn:/api/agent_builder/tools\n{\n \"id\": \"example-esql-tool\",\n \"type\": \"esql\",\n \"description\": \"An ES|QL query tool for analyzing financial trades with time filtering\",\n \"tags\": [\"analytics\", \"finance\", \"updated\"],\n \"configuration\": {\n \"query\": \"FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit\",\n \"params\": {\n \"startTime\": {\n \"type\": \"date\",\n \"description\": \"Start time for the analysis in ISO format\"\n },\n \"limit\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results to return\"\n }\n }\n }\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/tools/_execute:
post:
description: '**Spaces method and path for this operation:**
post /s/{space_id}/api/agent_builder/tools/_execute
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Run a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: post-agent-builder-tools-execute
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
requestBody:
content:
application/json:
examples:
executeBuiltinEsqlToolRequest:
description: Example request executing platform.core.execute_esql tool
value:
tool_id: platform.core.execute_esql
tool_params:
query: FROM financial_trades | LIMIT 3
executeBuiltinToolRequest:
description: Example request executing platform.core.get_document_by_id tool
value:
tool_id: platform.core.get_document_by_id
tool_params:
id: TRD-20250805-0820a89f
index: financial_trades
executeCustomEsqlToolRequest:
description: Example request executing custom example-esql-tool tool
value:
tool_id: example-esql-tool
tool_params:
limit: 3
startTime: '2024-01-01T00:00:00Z'
executeIndexSearchToolRequest:
description: Example request executing custom example-index-search-tool tool
value:
tool_id: example-index-search-tool
tool_params:
nlQuery: find trades with high execution prices above 100
schema:
additionalProperties: false
type: object
properties:
connector_id:
description: Optional connector ID for tools that require external integrations.
type: string
tool_id:
description: The ID of the tool to execute.
type: string
tool_params:
additionalProperties:
nullable: true
description: Parameters to pass to the tool execution. See examples for details
type: object
required:
- tool_id
- tool_params
responses:
'200':
content:
application/json:
examples:
executeBuiltinEsqlToolExample:
description: Example response calling built-in platform.core.execute_esql tool
value:
results:
- data:
esql: FROM financial_trades | LIMIT 3
type: query
- data:
columns:
- name: account_id
type: keyword
- name: execution_price
type: double
- name: symbol
type: keyword
- name: trade_type
type: keyword
query: FROM financial_trades | LIMIT 3
source: esql
values:
- - ACC00179-1f91
- 43.77000045776367
- CVX
- sell
- - ACC00407-0bbb
- 660.4199829101562
- V
- buy
- - ACC00179-1f91
- 440.3599853515625
- KO
- buy
tool_result_id: xTpT
type: esql_results
executeBuiltinToolExample:
description: Example response calling built-in platform.core.get_document_by_id tool
value:
results:
- data:
content:
account_id: ACC00271-fb5c
execution_price: 488.54
execution_timestamp: '2025-08-05T08:04:11.649855'
last_updated: '2025-09-15T13:23:36'
order_status: executed
order_type: market
quantity: 131
status_reason: fully_filled
symbol: EWL
trade_cost: 63998.74
trade_id: TRD-20250805-0820a89f
trade_type: sell
partial: false
reference:
id: TRD-20250805-0820a89f
index: financial_trades
type: resource
executeCustomEsqlToolExample:
description: Example response calling custom example-esql-tool tool
value:
results:
- data:
columns:
- name: trade_count
type: long
- name: avg_price
type: double
- name: symbol
type: keyword
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit
source: esql
values:
- - 2115
- 89.33911587329621
- US_T_BOND_20YR
- - 2112
- 104.20854155945055
- INTL_CORP_ASIA_D
- - 2105
- 89.93244177666526
- INTL_CORP_EU_B
tool_result_id: Voy8
type: esql_results
executeIndexSearchToolExample:
description: Example response calling custom example-index-search-tool tool
value:
results:
- data:
esql: 'FROM financial_trades
| WHERE execution_price > 100
| LIMIT 100'
type: query
- data:
columns:
- name: account_id
type: keyword
- name: execution_price
type: double
- name: execution_timestamp
type: date
- name: symbol
type: keyword
- name: trade_type
type: keyword
query: 'FROM financial_trades
| WHERE execution_price > 100
| LIMIT 100'
source: esql
values:
- - ACC00407-0bbb
- 660.4199829101562
- '2020-09-25T11:06:08.687Z'
- V
- buy
- - ACC00179-1f91
- 440.3599853515625
- '2025-08-07T21:56:45.377Z'
- KO
- buy
- - ACC00407-0bbb
- 132.8800048828125
- '2020-11-19T04:39:13.655Z'
- JAP_JGB_10YR
- sell
tool_result_id: uE8y
type: esql_results
description: Indicates a successful response
summary: Run a tool
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X POST \"https://${KIBANA_URL}/api/agent_builder/tools/_execute\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"tool_id\": \"platform.core.search\",\n \"tool_params\": {\n \"query\": \"can you find john doe's email from the employee index?\"}\n }\n }'\n"
- lang: Console
source: "POST kbn:/api/agent_builder/tools/_execute\n{\n \"tool_id\": \"platform.core.search\",\n \"tool_params\": {\n \"query\": \"can you find john doe's email from the employee index?\"\n }\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
/api/agent_builder/tools/{toolId}:
delete:
description: '**Spaces method and path for this operation:**
delete /s/{space_id}/api/agent_builder/tools/{toolId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Delete a tool by ID. This action cannot be undone. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).
[Required authorization] Route required privileges: agentBuilder:manageTools.'
operationId: delete-agent-builder-tools-toolid
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the tool to delete.
in: path
name: toolId
required: true
schema:
type: string
- description: If true, removes the tool from agents that use it and then deletes it. If false and any agent uses the tool, the request returns 409 Conflict with the list of agents.
in: query
name: force
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
application/json:
examples:
deleteAgentResponseExample:
description: Example response showing that the deletion operation was successful
value:
success: true
description: Indicates a successful response
summary: Delete a tool
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X DELETE \"https://${KIBANA_URL}/api/agent_builder/tools/{toolId}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\"\n"
- lang: Console
source: 'DELETE kbn:/api/agent_builder/tools/{toolId}
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
get:
description: '**Spaces method and path for this operation:**
get /s/{space_id}/api/agent_builder/tools/{toolId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).
[Required authorization] Route required privileges: agentBuilder:read.'
operationId: get-agent-builder-tools-toolid
parameters:
- description: The unique identifier of the tool to retrieve.
in: path
name: toolId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
examples:
getBuiltinToolExample:
description: Example response returning built-in platform.core.search tool
value:
configuration: {}
description: "A powerful tool for searching and analyzing data within your Elasticsearch cluster.\nIt supports both full-text relevance searches and structured analytical queries.\n\nUse this tool for any query that involves finding documents, counting, aggregating, or summarizing data from a known index.\n\nExamples of queries:\n- \"find articles about serverless architecture\"\n- \"search for support tickets mentioning 'billing issue' or 'refund request'\"\n- \"what is our policy on parental leave?\"\n- \"list all products where the category is 'electronics'\"\n- \"show me the last 5 documents from that index\"\n- \"show me the sales over the last year break down by month\"\n\nNote:\n- The 'index' parameter can be used to specify which index to search against.\n If not provided, the tool will decide itself which is the best index to use.\n- It is perfectly fine not to specify the 'index' parameter. It should only be specified when you already\n know about the index and fields you want to search on, e.g. if the user explicitly specified it."
id: platform.core.search
readonly: true
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
index:
description: (optional) Index to search against. If not provided, will automatically select the best index to use based on the query.
type: string
query:
description: A natural language query expressing the search request
type: string
required:
- query
tags: []
type: builtin
getEsqlToolExample:
description: Example response returning custom example-esql-tool tool
value:
configuration:
params:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
type: date
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit
description: Example ES|QL query tool for analyzing financial trades with time filtering
id: example-esql-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
description: Parameters needed to execute the query
type: object
properties:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
format: date-time
type: string
required:
- startTime
- limit
tags:
- analytics
- finance
type: esql
getIndexSearchToolExample:
description: Example response returning custom example-index-search-tool tool
value:
configuration:
pattern: financial_*
description: Search tool specifically for financial data analysis and reporting
id: example-index-search-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
nlQuery:
description: A natural language query expressing the search request
type: string
required:
- nlQuery
tags:
- search
- finance
type: index_search
description: Indicates a successful response
summary: Get a tool by id
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X GET \"https://${KIBANA_URL}/api/agent_builder/tools/{toolId}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n"
- lang: Console
source: 'GET kbn:/api/agent_builder/tools/{toolId}
'
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
put:
description: '**Spaces method and path for this operation:**
put /s/{space_id}/api/agent_builder/tools/{toolId}
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update an existing tool. Use this endpoint to modify any aspect of the tool''s configuration or metadata. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).
[Required authorization] Route required privileges: agentBuilder:manageTools.'
operationId: put-agent-builder-tools-toolid
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- description: The unique identifier of the tool to update.
in: path
name: toolId
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
updateEsqlToolRequest:
description: Example request to update the custom ESQL tool
value:
configuration:
params:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
type: date
symbolPattern:
description: Pattern to filter symbols (e.g., 'US_*' for US instruments)
type: keyword
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime AND symbol LIKE ?symbolPattern | STATS trade_count=COUNT(*), avg_price=AVG(execution_price), total_volume=SUM(quantity) BY symbol | SORT trade_count DESC | LIMIT ?limit
description: Updated ES|QL query tool for comprehensive financial analysis with enhanced filtering
tags:
- analytics
- finance
- reporting
updateIndexSearchToolRequest:
description: Example request to update the custom Search tool
value:
description: Updated search tool for comprehensive financial data analysis, reporting, and compliance monitoring
tags:
- search
- finance
- compliance
- reporting
schema:
additionalProperties: false
type: object
properties:
configuration:
additionalProperties:
nullable: true
description: Updated tool-specific configuration parameters. See examples for details.
type: object
description:
description: Updated description of what the tool does.
type: string
tags:
description: Updated tags for categorizing and organizing tools.
items:
description: Updated tag for categorizing the tool.
type: string
type: array
responses:
'200':
content:
application/json:
examples:
updateEsqlToolExample:
description: Example response showing the updated ESQL tool
value:
configuration:
params:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
type: date
symbolPattern:
description: Pattern to filter symbols (e.g., 'US_*' for US instruments)
type: keyword
query: FROM financial_trades | WHERE execution_timestamp >= ?startTime AND symbol LIKE ?symbolPattern | STATS trade_count=COUNT(*), avg_price=AVG(execution_price), total_volume=SUM(quantity) BY symbol | SORT trade_count DESC | LIMIT ?limit
description: Updated ES|QL query tool for comprehensive financial analysis with enhanced filtering
id: example-esql-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
description: Parameters needed to execute the enhanced query
type: object
properties:
limit:
description: Maximum number of results to return
type: integer
startTime:
description: Start time for the analysis in ISO format
format: date-time
type: string
symbolPattern:
description: Pattern to filter symbols (e.g., 'US_*' for US instruments)
type: string
required:
- startTime
- symbolPattern
- limit
tags:
- analytics
- finance
- reporting
type: esql
updateIndexSearchToolExample:
description: Example response showing the updated Search tool
value:
configuration:
pattern: financial_*
description: Updated search tool for comprehensive financial data analysis, reporting, and compliance monitoring
id: example-index-search-tool
readonly: false
schema:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: false
type: object
properties:
nlQuery:
description: A natural language query expressing the search request
type: string
required:
- nlQuery
tags:
- search
- finance
- compliance
- reporting
type: index_search
description: Indicates a successful response
summary: Update a tool
tags:
- agent builder
x-codeSamples:
- lang: curl
source: "curl \\\n -X PUT \"https://${KIBANA_URL}/api/agent_builder/tools/{toolId}\" \\\n -H \"Authorization: ApiKey ${API_KEY}\" \\\n -H \"kbn-xsrf: true\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"description\": \"Updated ES|QL query tool for analyzing financial trades with time filtering\",\n \"tags\": [\"analytics\", \"finance\", \"updated\"],\n \"configuration\": {\n \"query\": \"FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit\",\n \"params\": {\n \"startTime\": {\n \"type\": \"date\",\n \"description\": \"Start time for the analysis in ISO format\"\n },\n \"limit\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results to return\"\n }\n }\n }\n }'\n"
- lang: Console
source: "PUT kbn:/api/agent_builder/tools/{toolId}\n{\n \"description\": \"Updated ES|QL query tool for analyzing financial trades with time filtering\",\n \"tags\": [\"analytics\", \"finance\", \"updated\"],\n \"configuration\": {\n \"query\": \"FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit\",\n \"params\": {\n \"startTime\": {\n \"type\": \"date\",\n \"description\": \"Start time for the analysis in ISO format\"\n },\n \"limit\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results to return\"\n }\n }\n }\n}\n"
x-state: Added in 9.2.0
x-metaTags:
- content: Kibana
name: product_name
components:
securitySchemes:
apiKeyAuth:
description: 'These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
'
in: header
name: Authorization
type: apiKey
basicAuth:
scheme: basic
type: http
x-topics:
- title: Kibana spaces
content: "Spaces enable you to organize your dashboards and other saved objects into meaningful categories.\nYou can use the default space or create your own spaces.\n\nTo run APIs in non-default spaces, you must add `s/{space_id}/` to the path.\nFor example:\n\n```bash\ncurl -X GET \"http://${KIBANA_URL}/s/marketing/api/data_views\" \\\n -H \"Authorization: ApiKey ${API_KEY}\"\n```\n\nIf you use the Kibana console to send API requests, it automatically adds the appropriate space identifier.\n\nTo learn more, check out [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces).\n"