> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # setAiAgent > Route inbound calls to an AI Agent Fabric resource by ID. [update]: /docs/server-sdks/reference/typescript/rest/phone-numbers/update Route inbound calls on this phone number to an existing AI Agent Fabric resource by its ID. This is a typed wrapper over [`update`][update] that sets `call_handler` to `ai_agent` and populates `call_ai_agent_id` for you. ## **Parameters** **`resourceId`** `string` — required ID of the phone number to bind. --- **`agentId`** `string` — required ID of the AI Agent Fabric resource to route calls to. --- **`extra`** `Record` — default: \{} Additional wire-level fields merged into the PUT body. --- ## **Returns** `Promise` — The updated phone-number resource. ## **Example** ```typescript {9} import { RestClient } from "@signalwire/sdk"; const client = new RestClient({ project: "your-project-id", token: "your-api-token", host: "your-space.signalwire.com" }); await client.phoneNumbers.setAiAgent("phone-number-id", "ai-agent-id"); ``` > Route inbound calls to an AI Agent Fabric resource by ID.