Skip to main content
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"
  }'
{
  "success": true,
  "message": "Stream created successfully",
  "stream": {
    "id": "stream_345xyz",
    "chatId": "chat_123abc",
    "createdAt": "2024-01-17T10:30:00Z"
  }
}

Path Parameters

chatId
string
required
Chat ID where the stream will be created

Body Parameters

chatId
string
required
Chat ID (must match path parameter)

Response

success
boolean
Indicates if the stream was created successfully
message
string
Success or error message
stream
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"
  }'
{
  "success": true,
  "message": "Stream created successfully",
  "stream": {
    "id": "stream_345xyz",
    "chatId": "chat_123abc",
    "createdAt": "2024-01-17T10:30:00Z"
  }
}

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