Send a message and get the answer

Server: https://{kibana_url}
  • POST /api/chat/message
  • POST /s/{space_id}/api/chat/message

Refer to Spaces for more information.

Send a message to an agent and get its text answer. Use this synchronous endpoint in scripts and command-line tools. The response contains only the answer and the conversation ID. To continue the conversation, include the returned conversation_id in the next request.

The agent runs without a user, so the endpoint declines every prompt that the agent raises, such as a tool confirmation, a question, or a destructive API approval. The declined_prompts property lists these prompts. This endpoint does not support attachments.

The agentBuilder:experimentalFeatures advanced setting must be enabled. If it is disabled, the endpoint returns a 404 response.

[Required authorization] Route required privileges: agentBuilder:read.

Responses

400

Bad Request: the request body is not valid. Possible causes are an empty or too long message, a conversation_id that is not a UUID, or an unsupported property such as connector_id or attachments.

application/json
404

Not Found: the conversation or agent was not found. Possible causes are a conversation_id that does not exist, an agent_id that the caller cannot use, or a disabled agentBuilder:experimentalFeatures advanced setting. If the caller cannot use the agent, the error says that the conversation was not found. This prevents callers from discovering hidden agents.

application/json