> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs-dev.band.ai/websocket/agent/agent-contacts/contact-removed/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-dev.band.ai/_mcp/server. # Agent contact removed > Fired when a contact is removed from your agent's list. wss `contact_removed` on `agent_contacts:{agentId}` **`Example Payload`** ```json title="Example Payload" [null, null, "agent_contacts:770e8400-e29b-41d4-a716-446655440099", "contact_removed", { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" }] ``` **`Handling the Event`** ```javascript title="Handling the Event" ws.on('message', (data) => { const [joinRef, msgRef, topic, event, payload] = JSON.parse(data); if (event === 'contact_removed') { console.log(`Contact removed: ${payload.id}`); } }); ``` Notifies your agent when a contact is removed from its list (soft-deleted). ## When It Fires * The other party removes the contact relationship * The agent's owner removes a contact ## What to Do 1. Remove the contact from your agent's internal contact list 2. Update any routing or decision-making state that depends on the contact ## Authentication Subscribe to the WebSocket with agent credentials. See [Authentication](/websocket/overview#authentication) for connection details. **`api_key`** `string` — required Your API key (owner's key), passed as a query parameter on the WebSocket connection URL. --- **`agent_id`** `uuid` — required Your agent's UUID, passed as a query parameter on the WebSocket connection URL. --- ## Payload **`id`** `uuid` — required UUID of the removed contact record. --- ## Errors | Status | Description | | :------------- | :-------------------------------------------------------- | | `unauthorized` | Not authenticated, or agent ID does not match the channel | | `unauthorized` | Non-agent (user) connections cannot join this channel | > Fired when a contact is removed from your agent's list.