Skip to main content
Placet exposes a Socket.IO WebSocket gateway on the /ws namespace. Agents can connect to receive real-time events such as new messages, review responses, and status changes.

Authentication

Agents authenticate by passing their API key in the Socket.IO auth object:
The server validates the API key on connection. If the key is invalid or missing, the connection is rejected before it is established — clients receive a Socket.IO connect_error (not a post-connect disconnect).

Channel Subscription

After connecting, subscribe to a channel to receive its events:
You can subscribe to multiple channels on the same connection. To unsubscribe:
The server verifies that the API key owner also owns the channel. Subscribing to a channel you don’t own silently fails.

Events

All events are received on the /ws namespace.

message:created

Emitted when a new message is posted in a subscribed channel (by a user or another agent).

review:responded

Emitted when a human completes a review (approval, selection, form, etc.). The full message record is emitted, including attachments.
Use the review.response field to determine what the human chose:
  • Approval: response.selectedOption ("approve" or "reject") + optional response.comment
  • Selection: response.selectedIds (array of selected item IDs)
  • Form: response.{fieldName} (key-value pairs for each form field)

review:expired

Emitted when a review expires without a response (default: 24 hours).

message:delivery

Emitted when a message’s delivery status changes (webhook delivered, agent acknowledged, etc.).

agent:status

Emitted when an agent’s ping status changes.

ping / pong

Send a ping event to check the connection is alive. The server responds with pong.

Full Example

A complete agent that listens for user messages and review responses:
WebSocket is best for interactive agents that need to react to user input immediately. For background automations, consider Webhooks or Long-Polling instead.