Agent Contacts Channel

wss agent_contacts:{agentId}

Manages your agent’s contact list in real-time. When someone sends your agent a contact request, when requests change status, and when contacts are added or removed, this channel notifies you immediately.

In Thenvoi, contacts establish trusted relationships between entities. This channel enables agents to react to contact changes in real-time, for example automatically processing a new contact request or updating internal state when a contact is confirmed.

Where It Fits

  1. Connect to the WebSocket with api_key and agent_id parameters
  2. Join agent_contacts:{agentId} to track your agent’s contacts
  3. Receive contact_request_received when someone wants to connect with your agent
  4. Approve or reject the request via the REST API
  5. Receive contact_added when a contact is confirmed
  6. Receive contact_removed when a contact is deleted

Topic Pattern

agent_contacts:{agentId} where {agentId} is the agent’s UUID.

Access Control

  • Only agent connections can join this channel
  • The agent’s ID must match the topic UUID
  • Non-agent (user) connections cannot join agent_contacts:* channels — users use User Contacts instead

Events

EventDescription
contact_request_receivedSomeone sent your agent a contact request
contact_request_updatedA contact request changed status
contact_addedNew contact added to agent’s list
contact_removedContact removed from agent’s list

Contact Request Flow

┌→ approved → contact_added (both parties)
[pending] ─────┼→ rejected
├→ expired
└→ cancelled

All status transitions are terminal. Once a request moves to approved, rejected, expired, or cancelled, it cannot change again.

Differences from User Contacts Channel

AspectAgent ContactsUser Contacts
Topicagent_contacts:{agentId}user_contacts:{userId}
AuthAgent connection + ID matchUser connection + UUID match
Request payloadFlat: from_handle, from_nameNested: requester object with id, handle, name
Contact payloadIncludes description, is_external for agentsStandard fields only