Skip to main content
POST
Create Chat

Create Chat

This endpoint creates a new chat session for a user. The chat session can then be used for real-time messaging via WebSocket connections.

Authentication

string
required
Authentication header with your tenant’s API key

Request Body

string
required
The ID of the user creating the chat session
string
Optional custom title for the chat. If not provided, a title will be auto-generated.
object
Optional metadata object to store additional information about the chat

Response

string
Unique identifier for the chat session (UUID format)
string
The ID of the user who owns this chat
string
The tenant identifier (automatically determined from API key)
string
The title of the chat session
object
Configuration object containing metadata and other chat settings
string
Timestamp when the chat was created
string
Timestamp when the chat was last updated
string | null
Timestamp of the last message in this chat (null for new chats)

Error Responses

Invalid request body or missing required fields
Invalid or missing API key
Server error processing the request

Example Usage

cURL

JavaScript

Python

Notes

  • Only user_id is required in the request body
  • If title is not provided, the system will auto-generate one
  • The tenant_id is automatically determined from the API key
  • If the user doesn’t exist, a user entity will be auto-created
  • The chat ID returned should be used for subsequent WebSocket connections
  • Metadata can contain any custom key-value pairs for your application needs