Create an agent Technical Preview
Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options.
[Required authorization] Route required privileges: manage_onechat.
Body
-
Optional hex color code for the agent avatar.
-
Optional symbol/initials for the agent avatar.
-
Configuration settings for the agent.
Additional properties are NOT allowed.
-
Description of what the agent does.
-
Unique identifier for the agent.
-
Optional labels for categorizing and organizing agents.
-
Display name for the agent.
POST /api/agent_builder/agents
curl \ --request POST 'https://<KIBANA_URL>/api/agent_builder/agents' \ --header "Authorization: $API_KEY" \ --header "Content-Type: application/json" \ --header "kbn-xsrf: true" \ --data '{"id":"created-agent-id","name":"Search Index Helper","labels":["custom-indices","department-search"],"description":"Hi! I can help you search the data within the indices starting with \"content-\" prefix.","avatar_color":"#BFDBFF","avatar_symbol":"SI","configuration":{"tools":[{"tool_ids":["platform.core.search","platform.core.list_indices","platform.core.get_index_mapping","platform.core.get_document_by_id"]}],"instructions":"You are a custom agent that wants to help searching data using all indices starting with prefix \"content-\"."}}'
Request example
Example request for creating a custom agent with special prompt and tools
{ "id": "created-agent-id", "name": "Search Index Helper", "labels": [ "custom-indices", "department-search" ], "description": "Hi! I can help you search the data within the indices starting with \"content-\" prefix.", "avatar_color": "#BFDBFF", "avatar_symbol": "SI", "configuration": { "tools": [ { "tool_ids": [ "platform.core.search", "platform.core.list_indices", "platform.core.get_index_mapping", "platform.core.get_document_by_id" ] } ], "instructions": "You are a custom agent that wants to help searching data using all indices starting with prefix \"content-\"." } }
Response examples (200)
Example response returning the definition of an agent created as a result of the request
{ "id": "created-agent-id", "name": "Search Index Helper", "type": "chat", "labels": [ "custom-indices", "department-search" ], "description": "Hi! I can help you search the data within the indices starting with \"content-\" prefix.", "avatar_color": "#BFDBFF", "avatar_symbol": "SI", "configuration": { "tools": [ { "tool_ids": [ "platform.core.search", "platform.core.list_indices", "platform.core.get_index_mapping", "platform.core.get_document_by_id" ] } ], "instructions": "You are a custom agent that wants to help searching data using all indices starting with prefix \"content-\"." } }