Create Thread
POST /api/chat/threads
Create a new conversation thread
Creates a new conversation thread for organized chat management with proper threading and persistence.
Args: request: FastAPI request object request_data: Thread creation request with title and project context backend: Backend service instance (injected via dependency)
Returns: ChatThread: Created thread information
Request Body required
Section titled “Request Body required ”Conversation thread creation request model.
Request model for creating a new conversation thread with optional initial message and tags. Threads organize related chat messages and enable conversation history navigation and management.
Fields: title: Human-readable thread title project_id: Project context identifier (default: “my-project”) initial_message: Optional first message to start the conversation tags: Optional list of tags for categorization and filtering created_at: Timestamp when thread was created (auto-generated)
Used By: - POST /api/chat/threads endpoint - Thread creation UI - New conversation initialization - Conversation organization
Responses
Section titled “ Responses ”Successful Response
Conversation thread data model - ULTRA-COMPLETE (50+ fields).
Represents a single conversation thread with metadata including title, project context, creation time, message count, and tags. Used for thread listing and navigation.
Fields: thread_id: Unique thread identifier title: Human-readable thread title project_id: Project context identifier created_at: Timestamp when thread was created message_count: Number of messages in thread tags: List of tags for categorization and filtering
Used By: - ThreadListResponse for thread listings - Thread navigation UI - Conversation history browser - Thread search and filtering
object
Unique thread identifier
Human-readable thread title
Project context identifier
Thread creation timestamp
Number of messages in thread
Tags for categorization
Custom metadata container for extensibility.
Provides a structured container for custom key-value metadata that doesn’t fit into predefined fields. Supports common metadata patterns.
Fields: tags: List of tags for categorization labels: Key-value labels annotations: Additional annotations source: Data source identifier version: Data version
Used By: - Various models’ custom_metadata fields
object
Thread-specific settings and configuration.
Stores customizable settings for a conversation thread including AI parameters, display preferences, and behavior configurations.
Fields: temperature: LLM temperature for this thread max_tokens: Maximum tokens per response use_rag: Whether to use RAG for context persona: Default persona for thread stance: Default stance for thread auto_title: Whether to auto-generate titles notifications: Whether to send notifications
Used By: - ChatThread.settings
object
Thread access permissions and sharing settings.
Controls who can access, modify, and share a conversation thread. Supports ownership, read/write access, and sharing capabilities.
Fields: owner_id: User ID of thread owner can_read: List of user IDs with read access can_write: List of user IDs with write access can_delete: List of user IDs with delete access is_public: Whether thread is publicly accessible share_link: Shareable link if sharing is enabled
Used By: - ChatThread.permissions
object
Custom metadata container for extensibility.
Provides a structured container for custom key-value metadata that doesn’t fit into predefined fields. Supports common metadata patterns.
Fields: tags: List of tags for categorization labels: Key-value labels annotations: Additional annotations source: Data source identifier version: Data version
Used By: - Various models’ custom_metadata fields
object
Validation Error