> ## Documentation Index
> Fetch the complete documentation index at: https://botsify.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Converse Stream — POST /api/v1/converse/stream

> Send a message to a Botsify AI agent and receive the reply as a server-sent event stream, delivering tokens in real time for a responsive chat experience.

Use this endpoint when you want to display the agent's reply to the user as it is generated, token by token, rather than waiting for the full response. This creates a more responsive and engaging experience — similar to how modern AI chat interfaces work. The endpoint accepts the same inputs as the standard [Converse](/api-reference/messaging/converse.md) endpoint but returns a continuous stream instead of a single payload.

> [!NOTE]
>
> The response is delivered as a **Server-Sent Events (SSE)** stream. You should read the response body incrementally and process each `data:` event as it arrives. The stream ends with a terminal event (typically `data: [DONE]`). Make sure your HTTP client or frontend library supports streaming responses — for example, use `EventSource` in the browser or a streaming-capable HTTP client on the server side.

## Request

**`POST https://app.botsify.com/api/v1/converse/stream`**

**Authorization:** Bearer token — include your token in the `Authorization: Bearer <token>` header.

### Body Parameters

**bot\_key** `string` *required*

The unique key that identifies your bot. You can find this in your Botsify dashboard under bot settings.

**fbId** `string` *required*

A unique identifier for the user's session. Used to maintain conversation context across multiple turns.

**current\_messages** `string`

A serialized string representing the current conversation context for this turn.

**messages** `object[]`

An array of message objects (each with `role` and `content`) representing the conversation history to provide as context.

**append** `string`

Additional text to append to the prompt before it is sent to the agent — useful for injecting dynamic user attributes or retrieved data.

## Example

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/converse/stream" \
  --header "Authorization: Bearer <your_token>" \
  --header "Content-Type: application/json" \
  --header "Accept: text/event-stream" \
  --no-buffer \
  --data '{
    "bot_key": "bot_abc123",
    "fbId": "user_9876",
    "messages": [
      { "role": "user", "content": "Can you explain your return policy?" }
    ]
  }'
```

## Response

The server responds with `Content-Type: text/event-stream`. Each line is a SSE event delivering a token chunk. The stream terminates with `data: [DONE]`.

```
data: {"token": "Our"}

data: {"token": " return"}

data: {"token": " policy"}

data: {"token": " allows"}

data: {"token": " returns within 30 days of purchase."}

data: [DONE]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.