# Conversations and Message Replies (Streaming/Synchronous)

Send messages to AI assistant and receive responses.

```bash
curl -X POST \
  'https://api.maiagent.ai/api/v1/chatbots/{chatbot_id}/completions/' \
  -H 'Authorization: Api-Key YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "conversation": "string|null",
    "message": {
      "content": "string",
      "attachments": []
    },
    "is_streaming": boolean
  }'
```

**Parameters:**

* `chatbot_id` (path parameter): Chatbot ID
* `conversation` (request content): Optional conversation ID for continuing conversations
* `message.content` (request content): Message content to be sent
* `message.attachments` (request content): Array of attachments (if any)
* `is_streaming` (request content): Whether to use streaming response

**Response (Non-streaming):**

```json
{
  "content": "string",
  "conversationId": "string"
}
```

**Response (Streaming):**

Server-sent events format:

```
data: {
  "content": "string",
  "conversation_id": "string",
  "done": boolean
}
```

Notes:

* For streaming responses, the server will send multiple events containing partial content until the response is complete
* The conversation ID returned in the response can be used for subsequent requests to continue the conversation

## Integration Results

{% embed url="<https://drive.google.com/file/d/1sCIoxxASZ-SnHPAmkjDT270B3dz0LyHo/view?usp=sharing>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.maiagent.ai/tech/maiagent-tech-en/api-integration/dui-hua-yu-xun-xi-hui-fu-chuan-liu-tong-bu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
