setRelayApplication

View as MarkdownOpen in Claude

Route inbound calls on this phone number to a named RELAY application. The server auto-creates a relay_application Fabric resource referencing the application name.

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

Parameters

resourceId
stringRequired

ID of the phone number to bind.

name
stringRequired

Name of the RELAY application to route calls to.

extra
Record<string, unknown>Defaults to {}

Additional wire-level fields merged into the PUT body.

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.setRelayApplication("phone-number-id", "my-relay-app");