curl --request POST \
--url https://api.yourdomain.com/api/chats/chat_123abc/streams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "chat_123abc"
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/streams', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatId: "chat_123abc"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/streams"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {"chatId": "chat_123abc"}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Stream created successfully",
"stream": {
"id": "stream_345xyz",
"chatId": "chat_123abc",
"createdAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Streaming
Create Stream
Creates a new stream for a specific chat
POST
/
api
/
chats
/
{chatId}
/
streams
curl --request POST \
--url https://api.yourdomain.com/api/chats/chat_123abc/streams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "chat_123abc"
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/streams', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatId: "chat_123abc"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/streams"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {"chatId": "chat_123abc"}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Stream created successfully",
"stream": {
"id": "stream_345xyz",
"chatId": "chat_123abc",
"createdAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Path Parameters
string
required
Chat ID where the stream will be created
Body Parameters
string
required
Chat ID (must match path parameter)
Response
boolean
Indicates if the stream was created successfully
string
Success or error message
object
The created stream object
curl --request POST \
--url https://api.yourdomain.com/api/chats/chat_123abc/streams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "chat_123abc"
}'
const response = await fetch('https://api.yourdomain.com/api/chats/chat_123abc/streams', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chatId: "chat_123abc"
})
});
const data = await response.json();
import requests
url = "https://api.yourdomain.com/api/chats/chat_123abc/streams"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {"chatId": "chat_123abc"}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Stream created successfully",
"stream": {
"id": "stream_345xyz",
"chatId": "chat_123abc",
"createdAt": "2024-01-17T10:30:00Z"
}
}
{
"success": false,
"message": "Unauthorized"
}
{
"success": false,
"message": "Chat not found"
}
Notes
- Streams are typically used for real-time message delivery
- Multiple streams can be created for a single chat
- Ensure the chat exists before creating a stream
⌘I

