REST ClientPhone Numbers

set_ai_agent

View as MarkdownOpen in Claude

Route inbound calls on this phone number to an existing AI Agent Fabric resource by its ID.

This is a typed wrapper over update that sets call_handler to ai_agent and populates call_ai_agent_id for you.

Parameters

resource_id
strRequired

ID of the phone number to bind.

agent_id
strRequired

ID of the AI Agent Fabric resource to route calls to.

**extra
Any

Additional fields forwarded to update.

Returns

dict — The updated phone number resource.

Example

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
client.phone_numbers.set_ai_agent(
"phone-number-id",
"ai-agent-id",
)