REST ClientPhone Numbers

set_relay_topic

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

resource_id
strRequired

ID of the phone number to bind.

topic
strRequired

Relay topic name.

status_callback_url
str | NoneDefaults to None

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

request_options
RequestOptions | NoneDefaults to None

Per-call timeout and retry overrides. See RequestOptions.

**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_relay_topic(
"phone-number-id",
"office",
status_callback_url="https://example.com/status",
)