unregister

View as MarkdownOpen in Claude

Remove an agent from the server’s registry. The agent’s routes are no longer tracked, though FastAPI does not fully remove mounted routers at runtime.

Because FastAPI does not support unmounting routers, the agent’s HTTP routes may still respond until the server restarts. This method primarily removes the agent from the internal registry used by get_agents(), SIP routing, and the health endpoint.

Parameters

route
strRequired

The route of the agent to remove (e.g., "/sales").

Returns

boolTrue if the agent was found and removed, False if no agent exists at that route.

Example

1from signalwire import AgentServer
2from signalwire import AgentBase
3
4server = AgentServer(port=3000)
5server.register(AgentBase(name="sales", route="/sales"))
6
7removed = server.unregister("/sales")
8print(removed) # True