---
title: "Query Agent Directly"
method: POST
path: "/api/ai-agents/{agent_id}/query"
tags: ["ai-agents", "ai-agents"]
---

# Query Agent Directly

`POST /api/ai-agents/{agent_id}/query`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/ai-agents/{agent_id}/query`
- Auth: none declared

Send a direct message to an agent. Runs in background, streams events via WebSocket.

## Path parameters

- `agent_id` integer, required

## Request body

- AgentDirectQueryRequest
  - `message` string, required
  - `session_id` string, nullable
  - `ws_client_id` string, nullable
  - `execution_mode` string, nullable
  - `attachment_file_ids` integer[], nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/d84e7dc9977d?raw)
