---
title: "Add message to agent conversation with streaming response"
method: POST
path: "/agents/{agentKey}/conversations/{conversationId}/messages/stream"
tags: ["Agents"]
---

# Add message to agent conversation with streaming response

`POST /agents/{agentKey}/conversations/{conversationId}/messages/stream`

Append a user message to an existing agent conversation and stream the
assistant reply over SSE.

## Path parameters

- `agentKey` string, required
- `conversationId` string, objectId, required

## Request body

- AgentAddMessageStreamRequest — Request body for `POST /agents/{agentKey}/conversations/{conversationId}/messages/stream`. Only `query` is required; all other fields are optional overrides or routing hints. Unknown fields are stripped during validation.
  - `query` string, required — User follow-up prompt to append to the existing agent conversation. Saved as a new `user_query` message before the upstream AI stream starts.
  - `filters` Filters — App connector instance ids and knowledge-base / record-group ids that narrow retrieval for a turn. For **org assistant** chat streams, send explicit `apps` / `kb` lists. For **agent** chat streams, send explicit id lists, or **omit** `filters` (and `tools`) to let the service use the agent’s stored knowledge and tool configuration. Sending `{ "apps": [], "kb": [] }` on an agent stream means **no** knowledge sources for that turn (it is not “full org default”).
    - `apps` string[] — Connector instance ids to scope retrieval for this turn. Each element must be a UUID (connector instance id, record-group id, etc.) or the org knowledge-base collection sentinel `knowledgeBase_<orgId>` (pattern `knowledgeBase_[a-zA-Z0-9_-]+`). Gateway validation matches Zod `appOrKbIdSchema`.
    - `kb` string[] — Knowledge-base / record-group ids to scope retrieval for this turn. Each element uses the same accepted formats as `apps`: a UUID or `knowledgeBase_<orgId>` (pattern `knowledgeBase_[a-zA-Z0-9_-]+`).
  - `appliedFilters` AppliedFilters — Rich filter state selected by the user, used for display and persistence only. This mirrors the active selection shown in the UI and is distinct from the machine-readable `filters` field used for retrieval scoping.
    - `apps` AppliedFilterNode[] — Applied app/connector filter nodes
      - `id` string — Unique identifier of the filter node
      - `name` string — Display name of the filter node
      - `nodeType` string — Type of the node (e.g. app, recordGroup, folder, record)
      - `connector` string — Connector identifier associated with this node
    - `kb` AppliedFilterNode[] — Applied knowledge-base filter nodes
      - `id` string — Unique identifier of the filter node
      - `name` string — Display name of the filter node
      - `nodeType` string — Type of the node (e.g. app, recordGroup, folder, record)
      - `connector` string — Connector identifier associated with this node
  - `attachments` ChatAttachmentRef[] — Uploaded attachments to ground this turn. Each entry references a record id returned from the agent attachment upload endpoint.
    - `recordId` string, required — Attachment record id returned from the upload endpoint.
    - `recordName` string — Original display name of the file when known.
    - `mimeType` string — MIME type of the uploaded file.
    - `extension` string — File extension (e.g. `pdf`).
    - `virtualRecordId` string — Optional synthetic record id used by the graph layer.
  - `chatMode` 'auto' | 'quick' | 'verification' | 'deep' — Chat mode hint forwarded to the agent backend. Defaults to `auto` in the upstream AI payload when omitted. - `auto` lets the agent pick its default strategy. - `quick` favors low-latency answers over depth. - `verification` runs additional grounding/verification passes. - `deep` performs deeper retrieval and reasoning.
  - `modelKey` string — AI model configuration id override for this turn. Omit to use the agent's default model.
  - `modelName` string — Provider model name (the underlying LLM identifier).
  - `modelFriendlyName` string — Friendly UI label for the selected model.
  - `timezone` string — Client IANA timezone, such as `America/New_York`. Helps the agent resolve relative date references in the prompt.
  - `currentTime` string, date-time — Client time in ISO 8601 / RFC 3339 format (UTC `Z` or numeric offset). Sent alongside `timezone` for time-aware answers.
  - `tools` string[] — Allowed tool ids for this turn, such as `jira.create_issue`. Omit to let the agent use its default toolset; send `[]` to disable tools for this turn.

## Response `200`

SSE stream (text/event-stream)

## Other responses

- `400` — Invalid request body
- `401` — Unauthorized
- `404` — Conversation not found

---

[API](https://skmtc.net/pipeshub-ai/apis/pipeshub-api.md) · [All operations](https://skmtc.net/pipeshub-ai/apis/pipeshub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipeshub-ai/pipeshub-api/versions/abd27cfefc73/schema)
