Skip to navigation

setRelayTopic

View as MarkdownOpen in Claude

Route inbound calls on this phone number to a Relay topic. Relay clients subscribed to the topic will receive the inbound call event.

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

Parameters

resourceId
stringRequired

ID of the phone number to bind.

topic
stringRequired

Relay topic name. Serialized as call_relay_topic.

status_callback_url
string

URL that receives status updates for calls routed via this topic. Serialized as call_relay_topic_status_callback_url.

extra
Record<string, unknown>

Additional fields merged into the request body.

Returns

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

Example

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.setRelayTopic("phone-number-id", "office", "https://example.com/status");