WebSocket API for TrustGraph - providing multiplexed, asynchronous access to all services.
The WebSocket API provides access to all TrustGraph services over a single persistent connection:
All messages are JSON with:
id: Client-generated unique identifier for request/response correlationservice: Service identifier (e.g., "config", "agent", "document-rag")flow: Optional flow ID for flow-hosted servicesrequest/response: Service-specific payload (identical to REST API schemas)error: Error information on failureGlobal Services (no flow parameter):
Flow-Hosted Services (require flow parameter):
Request and response payloads use identical schemas to the REST API. See OpenAPI specification for detailed schema documentation.
Local development WebSocket server
Bearer token authentication when GATEWAY_SECRET is configured. Include as query parameter: ws://localhost:8088/api/v1/socket?token=
Request message for any TrustGraph service
Generic request message that can invoke any TrustGraph service.
The request field payload varies by service and matches the REST API request body schema.
Service request envelope with id, service, optional flow, and service-specific request payload
Successful response from any TrustGraph service
Generic response message from any TrustGraph service.
The response field payload varies by service and matches the REST API response body schema.
For streaming services, multiple messages with the same id may be sent.
WebSocket response message envelope for successful responses.
Contains the request ID for correlation and the service-specific response payload.
Error response from any TrustGraph service
Error message sent when a service request fails.
Contains the request ID and error details.
WebSocket error message envelope.
Sent when a request fails. Contains the request ID and error details.
WebSocket request message envelope.
Wraps service-specific request payloads with routing and correlation metadata.
WebSocket response message envelope for successful responses.
Contains the request ID for correlation and the service-specific response payload.
WebSocket error message envelope.
Sent when a request fails. Contains the request ID and error details.