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
Optional[str]

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

**extra
Any

Additional fields forwarded to update.

Returns

dict — The updated phone number resource.

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9client.phone_numbers.set_relay_topic(
10 "phone-number-id",
11 "office",
12 status_callback_url="https://example.com/status",
13)