Skip to main content
Example for connecting to the organization inbox WebSocket using an API key. This is the supported, API-exposed route for real-time chat events across an org (same room the app uses for inbox / assistant views via /orgs/{org_id}/inbox/ws). Connect to GET (upgrade) at: {API_URL}/orgs/:org_id/inbox/ws {API_URL} is the same base URL as in your OpenAPI spec (for example https://api.useinvent.com). Paths are appended as-is; if your environment uses an extra prefix, include it in {API_URL}.
Related HTTP endpoint for listing inbox chats: GET /orgs/:org_id/inbox.

Event Schemas

All events follow the ChatEventSchema discriminated union format:

Handling Streaming Messages

Messages are streamed in parts, then a complete message event is sent when finished.

During Streaming: message-part Events

During streaming, you’ll receive multiple message-part events:

After Streaming: Complete message Event

When streaming completes, you’ll receive a complete message event with the full message:

Reactions: message-reaction Event

A message-reaction event arrives when someone reacts to a message with an emoji, or removes a reaction (action is react or unreact). member_id names the team member who reacted and is absent when the assistant reacted.

Example: Accumulating Streamed Parts

Notes

  • Authenticate with an API key: Authorization: Bearer <token>.
  • Create keys under Settings → API Keys.
  • GET /orgs/:org_id/inbox/ws is registered as an API endpoint (isApiEndpoint: true) and appears in the public OpenAPI document.
  • message-part events are sent during streaming for real-time updates.
  • The final message event is the source of truth after streaming; prefer it over only accumulated parts.