setCallFlow

View as MarkdownOpen in Claude

Route inbound calls on this phone number to an existing Call Flow by its ID.

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

Parameters

resourceId
stringRequired

ID of the phone number to bind.

params
SetCallFlowParamsRequired

Flow ID and options.

params.flowId
stringRequired

ID of the Call Flow to route calls to. Serialized as call_flow_id.

params.version
string

Which Call Flow version to invoke. Accepts "working_copy" or "current_deployed". Defaults to the server’s current deployed version when omitted. Serialized as call_flow_version.

Returns

Promise<any> — The updated phone-number resource.

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9await client.phoneNumbers.setCallFlow("phone-number-id", {
10 flowId: "call-flow-id",
11 version: "working_copy",
12});