Skip to main content

WebSocket Message Types

The ProductFlo WebSocket API uses a structured message format with different message codes for various operations. This page details all available message types and their data structures.

Base Message Structure

All WebSocket messages share a common base structure:

Response Structure

All server responses follow this structure:

Message Codes (CodeType Enum)

The WebSocket API uses the CodeType enum to define message types:

Client-to-Server Message Codes

string
Standard chat messages
string
Messages for the Haitch AI assistant
string
Product idea generation requests
string
Documentation generation requests
string
Engineering-specific requests (CAD, DFM, etc.)

Server-to-Client Message Codes

string
Response to standard chat messages
string
Response to idea generation requests
string
Response to documentation generation requests
string
Response to engineering-specific requests

System Message Codes

string
System messages (connection status, errors, etc.)
string
User notifications
string
Debug and process logs
Cookie management messages

Status Types

All responses include a status field:
string
The operation completed successfully
string
An error occurred during the operation
string
The operation is still in progress

Data Models

ChatData

Used for standard chat messages:

HaitchChatData

Used for AI assistant chat:

DocumentationData

Used for documentation generation:

IdeaData

Used for product idea generation:

EngineeringData

Used for engineering-specific requests (CAD, DFM, etc.):

SystemData

Used for system messages:

ErrorData

Used for error responses (following BaseResponse model):

NotificationData

Used for user notifications:

Common Error Codes

The WebSocket API uses the following error codes:

Message Data Validation

All messages are validated using Pydantic models in the server implementation. This provides type safety and ensures messages conform to the expected structure. The system will return detailed validation errors if your message format is incorrect:

Usage Examples

Chat Message with Reply

AI Assistant Request with Context

Documentation Generation with Format